Connect the sensor privacy feature to the camera service
Also known as the mic/camera toggles. This connects the UI from the
system to the muted camera stream.
Bug: 170156750
Bug: 162549680
Test: Use feature, observe blank camera preview with GoogleCamera
Same test on secondary user
Change-Id: Iedf38a8fffbd46994d0f02bd39461d5006ad47cd
diff --git a/services/camera/libcameraservice/CameraService.h b/services/camera/libcameraservice/CameraService.h
index bc6ad35..f455cbb 100644
--- a/services/camera/libcameraservice/CameraService.h
+++ b/services/camera/libcameraservice/CameraService.h
@@ -640,6 +640,7 @@
: mService(service), mSensorPrivacyEnabled(false), mRegistered(false) {}
void registerSelf();
+ status_t registerSelfForIndividual(int userId);
void unregisterSelf();
bool isSensorPrivacyEnabled();
@@ -655,6 +656,8 @@
Mutex mSensorPrivacyLock;
bool mSensorPrivacyEnabled;
bool mRegistered;
+ bool isIndividual;
+ userid_t userId;
};
sp<UidPolicy> mUidPolicy;
@@ -1029,6 +1032,9 @@
// Blocks all active clients.
void blockAllClients();
+ // Mutes all active clients for a user.
+ void setMuteForAllClients(userid_t userId, bool enabled);
+
// Overrides the UID state as if it is idle
status_t handleSetUidState(const Vector<String16>& args, int err);
@@ -1100,6 +1106,12 @@
// Current camera mute mode
bool mOverrideCameraMuteMode = false;
+
+ // Map from user to sensor privacy policy
+ std::map<userid_t, sp<SensorPrivacyPolicy>> mCameraSensorPrivacyPolicies;
+
+ // Checks if the sensor privacy is enabled for the uid
+ bool isUserSensorPrivacyEnabledForUid(uid_t uid);
};
} // namespace android