Add trunk flag check to prevent changing the special app access settings for 'Change media output' for direct intent based entry when trunk flag is not enabled.
Bug: 321905521 Test: Ensure trunk flag is disabled > Open app specific settings for 'Change media output' > Ensure that settings should not be changeable Change-Id: Iedfd82d97eb49fc65c56d332bde815ff41e24736
This commit is contained in:
@@ -22,6 +22,7 @@ import android.app.role.RoleManager
|
||||
import android.app.settings.SettingsEnums
|
||||
import android.companion.AssociationRequest
|
||||
import android.content.Context
|
||||
import com.android.media.flags.Flags;
|
||||
import com.android.settings.R
|
||||
import com.android.settings.overlay.FeatureFactory.Companion.featureFactory
|
||||
import com.android.settingslib.spaprivileged.template.app.AppOpPermissionListModel
|
||||
@@ -48,8 +49,9 @@ class MediaRoutingControlAppsListModel(context: Context) : AppOpPermissionListMo
|
||||
}
|
||||
|
||||
override fun isChangeable(record: AppOpPermissionRecord): Boolean {
|
||||
return super.isChangeable(record) && (this.roleManager
|
||||
?.getRoleHolders(AssociationRequest.DEVICE_PROFILE_WATCH)
|
||||
return Flags.enablePrivilegedRoutingForMediaRoutingControl()
|
||||
&& super.isChangeable(record)
|
||||
&& (this.roleManager?.getRoleHolders(AssociationRequest.DEVICE_PROFILE_WATCH)
|
||||
?.contains(record.app.packageName) == true)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user