[Catalyst] Update permission check API signature
NO_IFTTT=Catalyst only Bug: 374115149 Flag: com.android.settings.flags.catalyst Test: manual Change-Id: Ib13a5fddd517e3e260815b753b55c008e24d70d8
This commit is contained in:
@@ -35,11 +35,15 @@ class AdaptiveConnectivityTogglePreference :
|
||||
override fun storage(context: Context): KeyValueStore =
|
||||
AdaptiveConnectivityToggleStorage(context, SettingsSecureStore.get(context))
|
||||
|
||||
override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) =
|
||||
override fun getReadPermit(context: Context, callingPid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
|
||||
override fun getWritePermit(context: Context, value: Boolean?, myUid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
override fun getWritePermit(
|
||||
context: Context,
|
||||
value: Boolean?,
|
||||
callingPid: Int,
|
||||
callingUid: Int,
|
||||
) = ReadWritePermit.ALLOW
|
||||
|
||||
override val sensitivityLevel
|
||||
get() = SensitivityLevel.NO_SENSITIVITY
|
||||
|
||||
@@ -65,10 +65,15 @@ class AirplaneModePreference :
|
||||
override val restrictionKeys
|
||||
get() = arrayOf(UserManager.DISALLOW_AIRPLANE_MODE)
|
||||
|
||||
override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) =
|
||||
override fun getReadPermit(context: Context, callingPid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
|
||||
override fun getWritePermit(context: Context, value: Boolean?, myUid: Int, callingUid: Int) =
|
||||
override fun getWritePermit(
|
||||
context: Context,
|
||||
value: Boolean?,
|
||||
callingPid: Int,
|
||||
callingUid: Int,
|
||||
) =
|
||||
when {
|
||||
isSatelliteOn(context) || isInEcmMode(context) -> ReadWritePermit.DISALLOW
|
||||
else -> ReadWritePermit.ALLOW
|
||||
|
||||
@@ -45,11 +45,15 @@ class MobileDataPreference :
|
||||
|
||||
override fun storage(context: Context): KeyValueStore = MobileDataStorage(context)
|
||||
|
||||
override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) =
|
||||
override fun getReadPermit(context: Context, callingPid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
|
||||
override fun getWritePermit(context: Context, value: Boolean?, myUid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
override fun getWritePermit(
|
||||
context: Context,
|
||||
value: Boolean?,
|
||||
callingPid: Int,
|
||||
callingUid: Int,
|
||||
) = ReadWritePermit.ALLOW
|
||||
|
||||
override val sensitivityLevel
|
||||
get() = SensitivityLevel.LOW_SENSITIVITY
|
||||
|
||||
@@ -77,11 +77,15 @@ class BluetoothTetherSwitchPreference :
|
||||
return !dataSaverBackend.isDataSaverEnabled
|
||||
}
|
||||
|
||||
override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) =
|
||||
override fun getReadPermit(context: Context, callingPid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
|
||||
override fun getWritePermit(context: Context, value: Boolean?, myUid: Int, callingUid: Int) =
|
||||
ReadWritePermit.ALLOW
|
||||
override fun getWritePermit(
|
||||
context: Context,
|
||||
value: Boolean?,
|
||||
callingPid: Int,
|
||||
callingUid: Int,
|
||||
) = ReadWritePermit.ALLOW
|
||||
|
||||
override val sensitivityLevel: Int
|
||||
get() = SensitivityLevel.LOW_SENSITIVITY
|
||||
|
||||
Reference in New Issue
Block a user