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

Commit 44f894fa authored by Anthony Hugh's avatar Anthony Hugh Committed by Automerger Merge Worker
Browse files

Merge "Use correct UserId when checking for lock state" into sc-dev am: 54d4f306

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14474248

Change-Id: Ia7dd181efe61195cd4353a778d7ec073e9139799
parents 28b14986 54d4f306
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ public final class SensorPrivacyService extends SystemService {
        @Override
        public void setIndividualSensorPrivacy(@UserIdInt int userId, int sensor, boolean enable) {
            enforceManageSensorPrivacyPermission();
            if (!canChangeIndividualSensorPrivacy(sensor)) {
            if (!canChangeIndividualSensorPrivacy(userId, sensor)) {
                return;
            }

@@ -500,14 +500,14 @@ public final class SensorPrivacyService extends SystemService {
            mHandler.onSensorPrivacyChanged(userId, sensor, enable);
        }

        private boolean canChangeIndividualSensorPrivacy(int sensor) {
        private boolean canChangeIndividualSensorPrivacy(@UserIdInt int userId, int sensor) {
            if (sensor == MICROPHONE && mEmergencyCallHelper.isInEmergencyCall()) {
                // During emergency call the microphone toggle managed automatically
                Log.i(TAG, "Can't change mic toggle during an emergency call");
                return false;
            }

            if (mKeyguardManager != null && mKeyguardManager.isDeviceLocked()) {
            if (mKeyguardManager != null && mKeyguardManager.isDeviceLocked(userId)) {
                Log.i(TAG, "Can't change mic/cam toggle while device is locked");
                return false;
            }