Loading core/java/android/hardware/ISensorPrivacyManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -41,4 +41,7 @@ interface ISensorPrivacyManager { void setIndividualSensorPrivacyForProfileGroup(int userId, int sensor, boolean enable); // =============== End of transactions used on native side as well ============================ void suppressIndividualSensorPrivacyReminders(int userId, String packageName, IBinder token, boolean suppress); } No newline at end of file core/java/android/hardware/SensorPrivacyManager.java +31 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.RequiresPermission; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.os.Binder; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; Loading @@ -44,6 +45,18 @@ import java.lang.annotation.RetentionPolicy; @TestApi @SystemService(Context.SENSOR_PRIVACY_SERVICE) public final class SensorPrivacyManager { /** * Unique Id of this manager to identify to the service * @hide */ private IBinder token = new Binder(); /** * An extra containing a sensor * @hide */ public static final String EXTRA_SENSOR = SensorPrivacyManager.class.getName() + ".extra.sensor"; /** Microphone * @hide */ Loading Loading @@ -299,4 +312,22 @@ public final class SensorPrivacyManager { throw e.rethrowFromSystemServer(); } } /** * Don't show dialogs to turn off sensor privacy for this package. * * @param packageName Package name not to show dialogs for * @param suppress Whether to suppress or re-enable. * * @hide */ public void suppressIndividualSensorPrivacyReminders(@NonNull String packageName, boolean suppress) { try { mService.suppressIndividualSensorPrivacyReminders(mContext.getUserId(), packageName, token, suppress); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } } packages/SystemUI/res/drawable/ic_camera_blocked.xml→core/res/res/drawable/ic_camera_blocked.xml +0 −0 File moved. View file packages/SystemUI/res/drawable/ic_mic_blocked.xml→core/res/res/drawable/ic_mic_blocked.xml +0 −0 File moved. View file core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2649,6 +2649,11 @@ <string name="config_usbResolverActivity" translatable="false" >com.android.systemui/com.android.systemui.usb.UsbResolverActivity</string> <!-- Component name of the activity used to inform a user about a sensory being blocked because of privacy settings. --> <string name="config_sensorUseStartedActivity" translatable="false" >com.android.systemui/com.android.systemui.sensorprivacy.SensorUseStartedActivity</string> <!-- Name of the dialog that is used to request the user's consent for a Platform VPN --> <string name="config_platformVpnConfirmDialogComponent" translatable="false" >com.android.vpndialogs/com.android.vpndialogs.PlatformVpnConfirmDialog</string> Loading Loading
core/java/android/hardware/ISensorPrivacyManager.aidl +3 −0 Original line number Diff line number Diff line Loading @@ -41,4 +41,7 @@ interface ISensorPrivacyManager { void setIndividualSensorPrivacyForProfileGroup(int userId, int sensor, boolean enable); // =============== End of transactions used on native side as well ============================ void suppressIndividualSensorPrivacyReminders(int userId, String packageName, IBinder token, boolean suppress); } No newline at end of file
core/java/android/hardware/SensorPrivacyManager.java +31 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ import android.annotation.RequiresPermission; import android.annotation.SystemService; import android.annotation.TestApi; import android.content.Context; import android.os.Binder; import android.os.IBinder; import android.os.RemoteException; import android.os.ServiceManager; Loading @@ -44,6 +45,18 @@ import java.lang.annotation.RetentionPolicy; @TestApi @SystemService(Context.SENSOR_PRIVACY_SERVICE) public final class SensorPrivacyManager { /** * Unique Id of this manager to identify to the service * @hide */ private IBinder token = new Binder(); /** * An extra containing a sensor * @hide */ public static final String EXTRA_SENSOR = SensorPrivacyManager.class.getName() + ".extra.sensor"; /** Microphone * @hide */ Loading Loading @@ -299,4 +312,22 @@ public final class SensorPrivacyManager { throw e.rethrowFromSystemServer(); } } /** * Don't show dialogs to turn off sensor privacy for this package. * * @param packageName Package name not to show dialogs for * @param suppress Whether to suppress or re-enable. * * @hide */ public void suppressIndividualSensorPrivacyReminders(@NonNull String packageName, boolean suppress) { try { mService.suppressIndividualSensorPrivacyReminders(mContext.getUserId(), packageName, token, suppress); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } }
packages/SystemUI/res/drawable/ic_camera_blocked.xml→core/res/res/drawable/ic_camera_blocked.xml +0 −0 File moved. View file
packages/SystemUI/res/drawable/ic_mic_blocked.xml→core/res/res/drawable/ic_mic_blocked.xml +0 −0 File moved. View file
core/res/res/values/config.xml +5 −0 Original line number Diff line number Diff line Loading @@ -2649,6 +2649,11 @@ <string name="config_usbResolverActivity" translatable="false" >com.android.systemui/com.android.systemui.usb.UsbResolverActivity</string> <!-- Component name of the activity used to inform a user about a sensory being blocked because of privacy settings. --> <string name="config_sensorUseStartedActivity" translatable="false" >com.android.systemui/com.android.systemui.sensorprivacy.SensorUseStartedActivity</string> <!-- Name of the dialog that is used to request the user's consent for a Platform VPN --> <string name="config_platformVpnConfirmDialogComponent" translatable="false" >com.android.vpndialogs/com.android.vpndialogs.PlatformVpnConfirmDialog</string> Loading