Loading core/java/android/hardware/ISensorPrivacyManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,6 @@ interface ISensorPrivacyManager { void setIndividualSensorPrivacyForProfileGroup(int userId, int source, int sensor, boolean enable); // =============== End of transactions used on native side as well ============================ void suppressIndividualSensorPrivacyReminders(int userId, String packageName, IBinder token, void suppressIndividualSensorPrivacyReminders(int userId, int sensor, IBinder token, boolean suppress); } No newline at end of file core/java/android/hardware/SensorPrivacyManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -461,9 +461,9 @@ public final class SensorPrivacyManager { * @hide */ @RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY) public void suppressSensorPrivacyReminders(@NonNull String packageName, public void suppressSensorPrivacyReminders(int sensor, boolean suppress) { suppressSensorPrivacyReminders(packageName, suppress, mContext.getUserId()); suppressSensorPrivacyReminders(sensor, suppress, mContext.getUserId()); } /** Loading @@ -476,10 +476,10 @@ public final class SensorPrivacyManager { * @hide */ @RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY) public void suppressSensorPrivacyReminders(@NonNull String packageName, public void suppressSensorPrivacyReminders(int sensor, boolean suppress, @UserIdInt int userId) { try { mService.suppressIndividualSensorPrivacyReminders(userId, packageName, mService.suppressIndividualSensorPrivacyReminders(userId, sensor, token, suppress); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading packages/SystemUI/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -451,6 +451,7 @@ <!-- started from SensoryPrivacyService --> <activity android:name=".sensorprivacy.SensorUseStartedActivity" android:exported="true" android:launchMode="singleTop" android:permission="android.permission.MANAGE_SENSOR_PRIVACY" android:theme="@style/Theme.SystemUI.Dialog.Alert" android:finishOnCloseSystemDialogs="true"> Loading packages/SystemUI/src/com/android/systemui/sensorprivacy/SensorUseStartedActivity.kt +21 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.sensorprivacy import android.content.DialogInterface import android.content.Intent import android.content.Intent.EXTRA_PACKAGE_NAME import android.content.pm.PackageManager import android.content.res.Resources Loading Loading @@ -178,7 +179,7 @@ class SensorUseStartedActivity @Inject constructor( override fun onStart() { super.onStart() sensorPrivacyController.suppressSensorPrivacyReminders(sensorUsePackageName, true) setSuppressed(true) unsuppressImmediately = false } Loading Loading @@ -218,12 +219,10 @@ class SensorUseStartedActivity @Inject constructor( super.onStop() if (unsuppressImmediately) { sensorPrivacyController .suppressSensorPrivacyReminders(sensorUsePackageName, false) setSuppressed(false) } else { bgHandler.postDelayed({ sensorPrivacyController .suppressSensorPrivacyReminders(sensorUsePackageName, false) setSuppressed(false) }, SUPPRESS_REMINDERS_REMOVAL_DELAY_MILLIS) } } Loading @@ -237,6 +236,11 @@ class SensorUseStartedActivity @Inject constructor( // do not allow backing out } override fun onNewIntent(intent: Intent?) { setIntent(intent) recreate() } private fun disableSensorPrivacy() { if (sensor == ALL_SENSORS) { sensorPrivacyController.setSensorBlocked(DIALOG, MICROPHONE, false) Loading @@ -247,4 +251,16 @@ class SensorUseStartedActivity @Inject constructor( unsuppressImmediately = true setResult(RESULT_OK) } private fun setSuppressed(suppressed: Boolean) { if (sensor == ALL_SENSORS) { sensorPrivacyController .suppressSensorPrivacyReminders(MICROPHONE, suppressed) sensorPrivacyController .suppressSensorPrivacyReminders(CAMERA, suppressed) } else { sensorPrivacyController .suppressSensorPrivacyReminders(sensor, suppressed) } } } No newline at end of file packages/SystemUI/src/com/android/systemui/statusbar/policy/IndividualSensorPrivacyController.java +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ public interface IndividualSensorPrivacyController extends void setSensorBlocked(@Source int source, @Sensor int sensor, boolean blocked); void suppressSensorPrivacyReminders(String packageName, boolean suppress); void suppressSensorPrivacyReminders(int sensor, boolean suppress); interface Callback { void onSensorBlockedChanged(@Sensor int sensor, boolean blocked); Loading Loading
core/java/android/hardware/ISensorPrivacyManager.aidl +1 −1 Original line number Diff line number Diff line Loading @@ -46,6 +46,6 @@ interface ISensorPrivacyManager { void setIndividualSensorPrivacyForProfileGroup(int userId, int source, int sensor, boolean enable); // =============== End of transactions used on native side as well ============================ void suppressIndividualSensorPrivacyReminders(int userId, String packageName, IBinder token, void suppressIndividualSensorPrivacyReminders(int userId, int sensor, IBinder token, boolean suppress); } No newline at end of file
core/java/android/hardware/SensorPrivacyManager.java +4 −4 Original line number Diff line number Diff line Loading @@ -461,9 +461,9 @@ public final class SensorPrivacyManager { * @hide */ @RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY) public void suppressSensorPrivacyReminders(@NonNull String packageName, public void suppressSensorPrivacyReminders(int sensor, boolean suppress) { suppressSensorPrivacyReminders(packageName, suppress, mContext.getUserId()); suppressSensorPrivacyReminders(sensor, suppress, mContext.getUserId()); } /** Loading @@ -476,10 +476,10 @@ public final class SensorPrivacyManager { * @hide */ @RequiresPermission(Manifest.permission.MANAGE_SENSOR_PRIVACY) public void suppressSensorPrivacyReminders(@NonNull String packageName, public void suppressSensorPrivacyReminders(int sensor, boolean suppress, @UserIdInt int userId) { try { mService.suppressIndividualSensorPrivacyReminders(userId, packageName, mService.suppressIndividualSensorPrivacyReminders(userId, sensor, token, suppress); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); Loading
packages/SystemUI/AndroidManifest.xml +1 −0 Original line number Diff line number Diff line Loading @@ -451,6 +451,7 @@ <!-- started from SensoryPrivacyService --> <activity android:name=".sensorprivacy.SensorUseStartedActivity" android:exported="true" android:launchMode="singleTop" android:permission="android.permission.MANAGE_SENSOR_PRIVACY" android:theme="@style/Theme.SystemUI.Dialog.Alert" android:finishOnCloseSystemDialogs="true"> Loading
packages/SystemUI/src/com/android/systemui/sensorprivacy/SensorUseStartedActivity.kt +21 −5 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ package com.android.systemui.sensorprivacy import android.content.DialogInterface import android.content.Intent import android.content.Intent.EXTRA_PACKAGE_NAME import android.content.pm.PackageManager import android.content.res.Resources Loading Loading @@ -178,7 +179,7 @@ class SensorUseStartedActivity @Inject constructor( override fun onStart() { super.onStart() sensorPrivacyController.suppressSensorPrivacyReminders(sensorUsePackageName, true) setSuppressed(true) unsuppressImmediately = false } Loading Loading @@ -218,12 +219,10 @@ class SensorUseStartedActivity @Inject constructor( super.onStop() if (unsuppressImmediately) { sensorPrivacyController .suppressSensorPrivacyReminders(sensorUsePackageName, false) setSuppressed(false) } else { bgHandler.postDelayed({ sensorPrivacyController .suppressSensorPrivacyReminders(sensorUsePackageName, false) setSuppressed(false) }, SUPPRESS_REMINDERS_REMOVAL_DELAY_MILLIS) } } Loading @@ -237,6 +236,11 @@ class SensorUseStartedActivity @Inject constructor( // do not allow backing out } override fun onNewIntent(intent: Intent?) { setIntent(intent) recreate() } private fun disableSensorPrivacy() { if (sensor == ALL_SENSORS) { sensorPrivacyController.setSensorBlocked(DIALOG, MICROPHONE, false) Loading @@ -247,4 +251,16 @@ class SensorUseStartedActivity @Inject constructor( unsuppressImmediately = true setResult(RESULT_OK) } private fun setSuppressed(suppressed: Boolean) { if (sensor == ALL_SENSORS) { sensorPrivacyController .suppressSensorPrivacyReminders(MICROPHONE, suppressed) sensorPrivacyController .suppressSensorPrivacyReminders(CAMERA, suppressed) } else { sensorPrivacyController .suppressSensorPrivacyReminders(sensor, suppressed) } } } No newline at end of file
packages/SystemUI/src/com/android/systemui/statusbar/policy/IndividualSensorPrivacyController.java +1 −1 Original line number Diff line number Diff line Loading @@ -29,7 +29,7 @@ public interface IndividualSensorPrivacyController extends void setSensorBlocked(@Source int source, @Sensor int sensor, boolean blocked); void suppressSensorPrivacyReminders(String packageName, boolean suppress); void suppressSensorPrivacyReminders(int sensor, boolean suppress); interface Callback { void onSensorBlockedChanged(@Sensor int sensor, boolean blocked); Loading