Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e8fb93cc authored by Greg Kaiser's avatar Greg Kaiser
Browse files

CameraService: Initialize two fields in constructor

isIndividual was potentially being read uninitialized in
onSensorPrivacyChanged().  In theory, userId wasn't being read
uninitialized with the current logic, but we choose to
future-proof by initializing it to a known value.

Bug: 170156750
Bug: 162549680
Test: TreeHugger
Change-Id: I7672fe90556ab71bc3d9021d5adc91b9f4e0a5c3
parent c5634ebd
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -637,7 +637,8 @@ private:
            public virtual IBinder::DeathRecipient {
        public:
            explicit SensorPrivacyPolicy(wp<CameraService> service)
                    : mService(service), mSensorPrivacyEnabled(false), mRegistered(false) {}
                    : mService(service), mSensorPrivacyEnabled(false), mRegistered(false),
                      isIndividual(false), userId(0) {}

            void registerSelf();
            status_t registerSelfForIndividual(int userId);