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

Commit e06b8951 authored by Alex Stetson's avatar Alex Stetson
Browse files

Allow all SystemUI processes to skip permission check

Similar workaround as ag/17513858 (b/221782106) but for all SystemUI
processes (regardless of user).

Bug: 261777399
Test: manual
Change-Id: I2c087982ea7ea61aed739bb156844641807ddd3b
parent 649bb14d
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -863,8 +863,9 @@ public final class SensorPrivacyService extends SystemService {
         */
        private void enforceObserveSensorPrivacyPermission() {
            String systemUIPackage = mContext.getString(R.string.config_systemUi);
            if (Binder.getCallingUid() == mPackageManagerInternal
                    .getPackageUid(systemUIPackage, MATCH_SYSTEM_ONLY, UserHandle.USER_SYSTEM)) {
            int systemUIAppId = UserHandle.getAppId(mPackageManagerInternal
                    .getPackageUid(systemUIPackage, MATCH_SYSTEM_ONLY, UserHandle.USER_SYSTEM));
            if (UserHandle.getCallingAppId() == systemUIAppId) {
                // b/221782106, possible race condition with role grant might bootloop device.
                return;
            }