Add Sensors Off QS tile and display status bar icon when active
This CL will replace the SensorPrivacyTile with a new tile that can be
enabled from the developer settings. When this new tile is enabled only
the camera, mic, and sensors controlled by the SensorManager will be
disabled; the location and airplane mode tiles will not be modified.
The user will be notified when this tile is enabled with the sensors
off icon in the status bar.
Fixes: 126618519
Test: Manually verified airplane and location are not modified when sensors
off is enabled; also verified icon is displayed when mode is active.
Change-Id: Iabf099d0d76c015015ce9859edc0b225ec554020
diff --git a/packages/SystemUI/src/com/android/systemui/Dependency.java b/packages/SystemUI/src/com/android/systemui/Dependency.java
index b7d1900..70f2cce 100644
--- a/packages/SystemUI/src/com/android/systemui/Dependency.java
+++ b/packages/SystemUI/src/com/android/systemui/Dependency.java
@@ -97,6 +97,7 @@
import com.android.systemui.statusbar.policy.RemoteInputQuickSettingsDisabler;
import com.android.systemui.statusbar.policy.RotationLockController;
import com.android.systemui.statusbar.policy.SecurityController;
+import com.android.systemui.statusbar.policy.SensorPrivacyController;
import com.android.systemui.statusbar.policy.SmartReplyConstants;
import com.android.systemui.statusbar.policy.UserInfoController;
import com.android.systemui.statusbar.policy.UserSwitcherController;
@@ -291,6 +292,7 @@
@Inject Lazy<ActivityManagerWrapper> mActivityManagerWrapper;
@Inject Lazy<DevicePolicyManagerWrapper> mDevicePolicyManagerWrapper;
@Inject Lazy<PackageManagerWrapper> mPackageManagerWrapper;
+ @Inject Lazy<SensorPrivacyController> mSensorPrivacyController;
@Inject
public Dependency() {
@@ -461,6 +463,7 @@
mProviders.put(ActivityManagerWrapper.class, mActivityManagerWrapper::get);
mProviders.put(DevicePolicyManagerWrapper.class, mDevicePolicyManagerWrapper::get);
mProviders.put(PackageManagerWrapper.class, mPackageManagerWrapper::get);
+ mProviders.put(SensorPrivacyController.class, mSensorPrivacyController::get);
// TODO(b/118592525): to support multi-display , we start to add something which is