Merge changes from topic "catalyst" into main
* changes:
[Catalyst] Specify read/write permissions for "Mobile data"
[Catalyst] Update permission check API signature
diff --git a/src/com/android/settings/SettingsService.kt b/src/com/android/settings/SettingsService.kt
index 70713c3..1783a7d 100644
--- a/src/com/android/settings/SettingsService.kt
+++ b/src/com/android/settings/SettingsService.kt
@@ -41,7 +41,7 @@
override fun hasPermission(
application: Application,
- myUid: Int,
+ callingPid: Int,
callingUid: Int,
request: PreferenceSetterRequest,
) = true
@@ -52,7 +52,7 @@
override fun hasPermission(
application: Application,
- myUid: Int,
+ callingPid: Int,
callingUid: Int,
request: PreferenceGetterRequest,
) = true
diff --git a/src/com/android/settings/accessibility/RemoveAnimationsPreference.kt b/src/com/android/settings/accessibility/RemoveAnimationsPreference.kt
index 65519e9..ddf2590 100644
--- a/src/com/android/settings/accessibility/RemoveAnimationsPreference.kt
+++ b/src/com/android/settings/accessibility/RemoveAnimationsPreference.kt
@@ -65,11 +65,15 @@
override fun storage(context: Context): KeyValueStore = RemoveAnimationsStorage(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
diff --git a/src/com/android/settings/accessibility/VibrationMainSwitchPreference.kt b/src/com/android/settings/accessibility/VibrationMainSwitchPreference.kt
index 70a0033..3265447 100644
--- a/src/com/android/settings/accessibility/VibrationMainSwitchPreference.kt
+++ b/src/com/android/settings/accessibility/VibrationMainSwitchPreference.kt
@@ -30,16 +30,16 @@
import com.android.settingslib.metadata.PreferenceLifecycleContext
import com.android.settingslib.metadata.PreferenceLifecycleProvider
import com.android.settingslib.metadata.ReadWritePermit
-import com.android.settingslib.preference.MainSwitchPreferenceBinding
-/**
- * Accessibility settings for vibration.
- */
+/** Accessibility settings for vibration. */
// LINT.IfChange
-class VibrationMainSwitchPreference : MainSwitchPreference(
- key = Settings.System.VIBRATE_ON,
- title = R.string.accessibility_vibration_primary_switch_title,
-), PreferenceLifecycleProvider, OnCheckedChangeListener {
+class VibrationMainSwitchPreference :
+ MainSwitchPreference(
+ key = Settings.System.VIBRATE_ON,
+ title = R.string.accessibility_vibration_primary_switch_title,
+ ),
+ PreferenceLifecycleProvider,
+ OnCheckedChangeListener {
override val keywords: Int
get() = R.string.keywords_accessibility_vibration_primary_switch
@@ -48,20 +48,26 @@
override fun storage(context: Context): KeyValueStore =
VibrationMainSwitchToggleStorage(SettingsSystemStore.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 fun onResume(context: PreferenceLifecycleContext) {
vibrator = context.getSystemService(Vibrator::class.java)
- context.findPreference<com.android.settingslib.widget.MainSwitchPreference>(key)
+ context
+ .findPreference<com.android.settingslib.widget.MainSwitchPreference>(key)
?.addOnSwitchChangeListener(this)
}
override fun onPause(context: PreferenceLifecycleContext) {
- context.findPreference<com.android.settingslib.widget.MainSwitchPreference>(key)
+ context
+ .findPreference<com.android.settingslib.widget.MainSwitchPreference>(key)
?.removeOnSwitchChangeListener(this)
}
@@ -69,16 +75,16 @@
if (isChecked) {
// Play a haptic as preview for the main toggle only when touch feedback is enabled.
VibrationPreferenceConfig.playVibrationPreview(
- vibrator, VibrationAttributes.USAGE_TOUCH
+ vibrator,
+ VibrationAttributes.USAGE_TOUCH,
)
}
}
/** Provides SettingsStore for vibration main switch with custom default value. */
@Suppress("UNCHECKED_CAST")
- private class VibrationMainSwitchToggleStorage(
- private val settingsStore: SettingsStore,
- ) : KeyedObservableDelegate<String>(settingsStore), KeyValueStore {
+ private class VibrationMainSwitchToggleStorage(private val settingsStore: SettingsStore) :
+ KeyedObservableDelegate<String>(settingsStore), KeyValueStore {
override fun contains(key: String) = settingsStore.contains(key)
diff --git a/src/com/android/settings/connecteddevice/BluetoothPreference.kt b/src/com/android/settings/connecteddevice/BluetoothPreference.kt
index c9b3953..93b2f20 100644
--- a/src/com/android/settings/connecteddevice/BluetoothPreference.kt
+++ b/src/com/android/settings/connecteddevice/BluetoothPreference.kt
@@ -52,10 +52,15 @@
override val restrictionKeys: Array<String>
get() = arrayOf(UserManager.DISALLOW_BLUETOOTH, UserManager.DISALLOW_CONFIG_BLUETOOTH)
- 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, 3000) ||
(value == true &&
diff --git a/src/com/android/settings/datausage/DataSaverMainSwitchPreference.kt b/src/com/android/settings/datausage/DataSaverMainSwitchPreference.kt
index 23cfadc..79d3dc3 100644
--- a/src/com/android/settings/datausage/DataSaverMainSwitchPreference.kt
+++ b/src/com/android/settings/datausage/DataSaverMainSwitchPreference.kt
@@ -36,11 +36,15 @@
override fun storage(context: Context) = createDataStore(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
diff --git a/src/com/android/settings/display/AdaptiveSleepPreference.kt b/src/com/android/settings/display/AdaptiveSleepPreference.kt
index a160001..7cc320d 100644
--- a/src/com/android/settings/display/AdaptiveSleepPreference.kt
+++ b/src/com/android/settings/display/AdaptiveSleepPreference.kt
@@ -77,11 +77,15 @@
override fun storage(context: Context): KeyValueStore = Storage(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
diff --git a/src/com/android/settings/display/AmbientDisplayAlwaysOnPreference.kt b/src/com/android/settings/display/AmbientDisplayAlwaysOnPreference.kt
index e50b00b..7a6df8e 100644
--- a/src/com/android/settings/display/AmbientDisplayAlwaysOnPreference.kt
+++ b/src/com/android/settings/display/AmbientDisplayAlwaysOnPreference.kt
@@ -71,11 +71,15 @@
override fun storage(context: Context): KeyValueStore = Storage(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
diff --git a/src/com/android/settings/display/AutoBrightnessScreen.kt b/src/com/android/settings/display/AutoBrightnessScreen.kt
index 32d70ad..319d95b 100644
--- a/src/com/android/settings/display/AutoBrightnessScreen.kt
+++ b/src/com/android/settings/display/AutoBrightnessScreen.kt
@@ -65,11 +65,15 @@
override fun storage(context: Context): KeyValueStore =
AutoBrightnessDataStore(SettingsSystemStore.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
diff --git a/src/com/android/settings/display/BatteryPercentageSwitchPreference.kt b/src/com/android/settings/display/BatteryPercentageSwitchPreference.kt
index 25623b3..fb2b74c 100644
--- a/src/com/android/settings/display/BatteryPercentageSwitchPreference.kt
+++ b/src/com/android/settings/display/BatteryPercentageSwitchPreference.kt
@@ -49,11 +49,15 @@
com.android.internal.R.bool.config_battery_percentage_setting_available
)
- 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
diff --git a/src/com/android/settings/display/PeakRefreshRateSwitchPreference.kt b/src/com/android/settings/display/PeakRefreshRateSwitchPreference.kt
index 3240616..32d2910 100644
--- a/src/com/android/settings/display/PeakRefreshRateSwitchPreference.kt
+++ b/src/com/android/settings/display/PeakRefreshRateSwitchPreference.kt
@@ -50,11 +50,15 @@
override fun storage(context: Context): KeyValueStore =
PeakRefreshRateStore(context, SettingsSystemStore.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
diff --git a/src/com/android/settings/display/darkmode/DarkModeScreen.kt b/src/com/android/settings/display/darkmode/DarkModeScreen.kt
index 7f8087a..807b0ae 100644
--- a/src/com/android/settings/display/darkmode/DarkModeScreen.kt
+++ b/src/com/android/settings/display/darkmode/DarkModeScreen.kt
@@ -71,11 +71,15 @@
override val keywords: Int
get() = R.string.keywords_dark_ui_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) =
- ReadWritePermit.ALLOW
+ override fun getWritePermit(
+ context: Context,
+ value: Boolean?,
+ callingPid: Int,
+ callingUid: Int,
+ ) = ReadWritePermit.ALLOW
override val sensitivityLevel
get() = SensitivityLevel.NO_SENSITIVITY
diff --git a/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt b/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt
index 95d73dd..49f219f 100644
--- a/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt
+++ b/src/com/android/settings/fuelgauge/BatteryHeaderPreference.kt
@@ -102,10 +102,10 @@
override fun getMaxValue(context: Context): Int = 100
- 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: Int?, myUid: Int, callingUid: Int) =
+ override fun getWritePermit(context: Context, value: Int?, callingPid: Int, callingUid: Int) =
ReadWritePermit.DISALLOW
companion object {
diff --git a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverPreference.kt b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverPreference.kt
index 93da40d..ce1c1be 100644
--- a/src/com/android/settings/fuelgauge/batterysaver/BatterySaverPreference.kt
+++ b/src/com/android/settings/fuelgauge/batterysaver/BatterySaverPreference.kt
@@ -43,11 +43,15 @@
override fun storage(context: Context) = BatterySaverStore(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
diff --git a/src/com/android/settings/network/AdaptiveConnectivityTogglePreference.kt b/src/com/android/settings/network/AdaptiveConnectivityTogglePreference.kt
index c29ec6e..77a141e 100644
--- a/src/com/android/settings/network/AdaptiveConnectivityTogglePreference.kt
+++ b/src/com/android/settings/network/AdaptiveConnectivityTogglePreference.kt
@@ -35,11 +35,15 @@
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
diff --git a/src/com/android/settings/network/AirplaneModePreference.kt b/src/com/android/settings/network/AirplaneModePreference.kt
index e3b7f55..c9377eb 100644
--- a/src/com/android/settings/network/AirplaneModePreference.kt
+++ b/src/com/android/settings/network/AirplaneModePreference.kt
@@ -65,10 +65,15 @@
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
diff --git a/src/com/android/settings/network/MobileDataPreference.kt b/src/com/android/settings/network/MobileDataPreference.kt
index d285a8c..04649d9 100644
--- a/src/com/android/settings/network/MobileDataPreference.kt
+++ b/src/com/android/settings/network/MobileDataPreference.kt
@@ -16,6 +16,7 @@
package com.android.settings.network
+import android.Manifest
import android.content.Context
import android.telephony.SubscriptionManager
import com.android.settings.R
@@ -45,11 +46,30 @@
override fun storage(context: Context): KeyValueStore = MobileDataStorage(context)
- override fun getReadPermit(context: Context, myUid: Int, callingUid: Int) =
+ override fun getReadPermissions(context: Context) =
+ arrayOf(
+ // required by TelephonyManager.isDataEnabledForReason
+ Manifest.permission.ACCESS_NETWORK_STATE,
+ Manifest.permission.READ_PHONE_STATE,
+ Manifest.permission.MODIFY_PHONE_STATE,
+ Manifest.permission.READ_BASIC_PHONE_STATE,
+ )
+
+ override fun getWritePermissions(context: Context) =
+ arrayOf(
+ // required by TelephonyManager.setDataEnabledForReason
+ Manifest.permission.MODIFY_PHONE_STATE
+ )
+
+ 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
diff --git a/src/com/android/settings/network/tether/BluetoothTetherSwitchPreference.kt b/src/com/android/settings/network/tether/BluetoothTetherSwitchPreference.kt
index a22df12..a6a400b 100644
--- a/src/com/android/settings/network/tether/BluetoothTetherSwitchPreference.kt
+++ b/src/com/android/settings/network/tether/BluetoothTetherSwitchPreference.kt
@@ -77,11 +77,15 @@
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
diff --git a/src/com/android/settings/notification/CallVolumePreference.kt b/src/com/android/settings/notification/CallVolumePreference.kt
index 031687f..0e45b23 100644
--- a/src/com/android/settings/notification/CallVolumePreference.kt
+++ b/src/com/android/settings/notification/CallVolumePreference.kt
@@ -76,10 +76,10 @@
}
}
- 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: Int?, myUid: Int, callingUid: Int) =
+ override fun getWritePermit(context: Context, value: Int?, callingPid: Int, callingUid: Int) =
ReadWritePermit.ALLOW
override val sensitivityLevel
diff --git a/src/com/android/settings/notification/MediaVolumePreference.kt b/src/com/android/settings/notification/MediaVolumePreference.kt
index a6d9c41..b644381 100644
--- a/src/com/android/settings/notification/MediaVolumePreference.kt
+++ b/src/com/android/settings/notification/MediaVolumePreference.kt
@@ -77,10 +77,10 @@
}
}
- 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: Int?, myUid: Int, callingUid: Int) =
+ override fun getWritePermit(context: Context, value: Int?, callingPid: Int, callingUid: Int) =
ReadWritePermit.ALLOW
override val sensitivityLevel
diff --git a/src/com/android/settings/notification/SeparateRingVolumePreference.kt b/src/com/android/settings/notification/SeparateRingVolumePreference.kt
index 6a22b12..0e557c4 100644
--- a/src/com/android/settings/notification/SeparateRingVolumePreference.kt
+++ b/src/com/android/settings/notification/SeparateRingVolumePreference.kt
@@ -94,10 +94,10 @@
}
}
- 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: Int?, myUid: Int, callingUid: Int) =
+ override fun getWritePermit(context: Context, value: Int?, callingPid: Int, callingUid: Int) =
ReadWritePermit.ALLOW
override val sensitivityLevel
diff --git a/src/com/android/settings/wifi/WifiSwitchPreference.kt b/src/com/android/settings/wifi/WifiSwitchPreference.kt
index ba6fb02..9549754 100644
--- a/src/com/android/settings/wifi/WifiSwitchPreference.kt
+++ b/src/com/android/settings/wifi/WifiSwitchPreference.kt
@@ -92,10 +92,15 @@
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
diff --git a/src/com/android/settings/wifi/calling/WifiCallingMainSwitchPreference.kt b/src/com/android/settings/wifi/calling/WifiCallingMainSwitchPreference.kt
index f6056f4..07adac0 100644
--- a/src/com/android/settings/wifi/calling/WifiCallingMainSwitchPreference.kt
+++ b/src/com/android/settings/wifi/calling/WifiCallingMainSwitchPreference.kt
@@ -60,10 +60,15 @@
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() ||
diff --git a/src/com/android/settings/wifi/tether/WifiHotspotSwitchPreference.kt b/src/com/android/settings/wifi/tether/WifiHotspotSwitchPreference.kt
index 931583a..2f72c4a 100644
--- a/src/com/android/settings/wifi/tether/WifiHotspotSwitchPreference.kt
+++ b/src/com/android/settings/wifi/tether/WifiHotspotSwitchPreference.kt
@@ -106,11 +106,15 @@
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