Merge changes from topic "catalyst" into main
* changes: [Catalyst] Specify read/write permissions for "Mobile data" [Catalyst] Update permission check API signature
This commit is contained in:
committed by
Android (Google) Code Review
commit
4bfd857a7e
@@ -92,10 +92,15 @@ class WifiSwitchPreference :
|
||||
return true
|
||||
}
|
||||
|
||||
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 {
|
||||
(value == true && !context.isRadioAllowed()) || isSatelliteOn(context) ->
|
||||
ReadWritePermit.DISALLOW
|
||||
|
||||
@@ -60,10 +60,15 @@ class WifiCallingMainSwitchPreference(private val subId: Int) :
|
||||
|
||||
override fun createWidget(context: Context) = SettingsMainSwitchPreference(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) =
|
||||
override fun getWritePermit(
|
||||
context: Context,
|
||||
value: Boolean?,
|
||||
callingPid: Int,
|
||||
callingUid: Int,
|
||||
) =
|
||||
when {
|
||||
value == true &&
|
||||
(DisclaimerItemFactory.create(context, subId).isNotEmpty() ||
|
||||
|
||||
@@ -106,11 +106,15 @@ class WifiHotspotSwitchPreference(context: Context, dataSaverStore: KeyValueStor
|
||||
override val restrictionKeys
|
||||
get() = arrayOf(UserManager.DISALLOW_WIFI_TETHERING)
|
||||
|
||||
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.HIGH_SENSITIVITY
|
||||
|
||||
Reference in New Issue
Block a user