Initialize two fields in constructor
mIsIndividualMic was potentially being read uninitialized in
onSensorPrivacyChanged(). In theory, mUserId isn't being read
uninitialized with the current logic, but we choose to
future-proof by initializing it to a known value.
Bug: 136069189
Test: TreeHugger
Change-Id: I60c76bfea0b224d9789ade2f2bdf35ffb8c1e361
diff --git a/services/sensorservice/SensorService.h b/services/sensorservice/SensorService.h
index dc1463b..5b198d8 100644
--- a/services/sensorservice/SensorService.h
+++ b/services/sensorservice/SensorService.h
@@ -223,7 +223,8 @@
// connections will be allowed again.
class SensorPrivacyPolicy : public hardware::BnSensorPrivacyListener {
public:
- explicit SensorPrivacyPolicy(wp<SensorService> service) : mService(service) {}
+ explicit SensorPrivacyPolicy(wp<SensorService> service)
+ : mService(service), mIsIndividualMic(false), mUserId(0) {}
void registerSelf();
void unregisterSelf();