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

Commit b2f850e0 authored by Norman Bintang's avatar Norman Bintang
Browse files

Use explicit user id for setSensorPrivacy

ag/28852819 changed the user id for setSensorPrivacy from
UserHandle.USER_CURRENT to mContext.getUserId(), which always be 0 when
it's called by PhoneWindowManager. Therefore, the explicit user id needs
to be specified.

Bug: 364440865
Test: Manually press mic input keyboard button
Flag: EXEMPT bug fix
Change-Id: I4b7fab19d25d4fac71bb14a20ea0045e5a30c795
parent 3b7526e1
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -183,6 +183,7 @@ import android.provider.DeviceConfig;
import android.provider.MediaStore;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.service.SensorPrivacyToggleSourceProto;
import android.service.dreams.DreamManagerInternal;
import android.service.dreams.DreamService;
import android.service.dreams.IDreamManager;
@@ -4538,8 +4539,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
                    SensorPrivacyManager.TOGGLE_TYPE_SOFTWARE,
                    SensorPrivacyManager.Sensors.MICROPHONE);

            mSensorPrivacyManager.setSensorPrivacy(SensorPrivacyManager.Sensors.MICROPHONE,
                    !isEnabled);
            mSensorPrivacyManager.setSensorPrivacy(SensorPrivacyToggleSourceProto.OTHER,
                    SensorPrivacyManager.Sensors.MICROPHONE, !isEnabled, mCurrentUserId);

            int toastTextResId;
            if (isEnabled) {