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

Commit 4f15843c authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8521661 from cec18f58 to tm-qpr1-release

Change-Id: I49a7ad8fa6a7db4fb901585a7bbdaf0532761746
parents 291444d5 cec18f58
Loading
Loading
Loading
Loading
+17 −25
Original line number Diff line number Diff line
@@ -2637,15 +2637,18 @@ public class AlarmManagerService extends SystemService {
     * Returns true if the given uid can set window to be as small as it wants.
     */
    boolean isExemptFromMinWindowRestrictions(int uid) {
        return isExemptFromExactAlarmPermission(uid);
        return isExemptFromExactAlarmPermissionNoLock(uid);
    }

    /**
     * Returns true if the given uid does not require SCHEDULE_EXACT_ALARM to set exact,
     * allow-while-idle alarms.
     * Note: It is ok to call this method without the lock {@link #mLock} held.
     * <b> Note: This should not be called with {@link #mLock} held.</b>
     */
    boolean isExemptFromExactAlarmPermission(int uid) {
    boolean isExemptFromExactAlarmPermissionNoLock(int uid) {
        if (Build.IS_DEBUGGABLE && Thread.holdsLock(mLock)) {
            Slog.wtfStack(TAG, "Alarm lock held while calling into DeviceIdleController");
        }
        return (UserHandle.isSameApp(mSystemUiUid, uid)
                || UserHandle.isCore(uid)
                || mLocalDeviceIdleController == null
@@ -2747,7 +2750,7 @@ public class AlarmManagerService extends SystemService {
                }
                if (needsPermission && !hasScheduleExactAlarmInternal(callingPackage, callingUid)
                        && !hasUseExactAlarmInternal(callingPackage, callingUid)) {
                    if (!isExemptFromExactAlarmPermission(callingUid)) {
                    if (!isExemptFromExactAlarmPermissionNoLock(callingUid)) {
                        final String errorMessage = "Caller " + callingPackage + " needs to hold "
                                + Manifest.permission.SCHEDULE_EXACT_ALARM + " to set "
                                + "exact alarms.";
@@ -2810,7 +2813,7 @@ public class AlarmManagerService extends SystemService {
            if (!isExactAlarmChangeEnabled(packageName, userId)) {
                return true;
            }
            return isExemptFromExactAlarmPermission(packageUid)
            return isExemptFromExactAlarmPermissionNoLock(packageUid)
                    || hasScheduleExactAlarmInternal(packageName, packageUid)
                    || hasUseExactAlarmInternal(packageName, packageUid);
        }
@@ -3862,10 +3865,7 @@ public class AlarmManagerService extends SystemService {
                // added: true => package was added to the deny list
                // added: false => package was removed from the deny list
                if (added) {
                    synchronized (mLock) {
                        removeExactAlarmsOnPermissionRevokedLocked(uid,
                                changedPackage, /*killUid = */ true);
                    }
                    removeExactAlarmsOnPermissionRevoked(uid, changedPackage, /*killUid = */ true);
                } else {
                    sendScheduleExactAlarmPermissionStateChangedBroadcast(changedPackage, userId);
                }
@@ -3880,9 +3880,8 @@ public class AlarmManagerService extends SystemService {
     *
     * This is not expected to get called frequently.
     */
    @GuardedBy("mLock")
    void removeExactAlarmsOnPermissionRevokedLocked(int uid, String packageName, boolean killUid) {
        if (isExemptFromExactAlarmPermission(uid)
    void removeExactAlarmsOnPermissionRevoked(int uid, String packageName, boolean killUid) {
        if (isExemptFromExactAlarmPermissionNoLock(uid)
                || !isExactAlarmChangeEnabled(packageName, UserHandle.getUserId(uid))) {
            return;
        }
@@ -3891,7 +3890,9 @@ public class AlarmManagerService extends SystemService {

        final Predicate<Alarm> whichAlarms = a -> (a.uid == uid && a.packageName.equals(packageName)
                && a.windowLength == 0);
        synchronized (mLock) {
            removeAlarmsInternalLocked(whichAlarms, REMOVE_REASON_EXACT_PERMISSION_REVOKED);
        }

        if (killUid && mConstants.KILL_ON_SCHEDULE_EXACT_ALARM_REVOKED) {
            PermissionManagerService.killUid(UserHandle.getAppId(uid), UserHandle.getUserId(uid),
@@ -4807,10 +4808,7 @@ public class AlarmManagerService extends SystemService {
                case REMOVE_EXACT_ALARMS:
                    int uid = msg.arg1;
                    String packageName = (String) msg.obj;
                    synchronized (mLock) {
                        removeExactAlarmsOnPermissionRevokedLocked(uid, packageName, /*killUid = */
                                true);
                    }
                    removeExactAlarmsOnPermissionRevoked(uid, packageName, /*killUid = */true);
                    break;
                case EXACT_ALARM_DENY_LIST_PACKAGES_ADDED:
                    handleChangesToExactAlarmDenyList((ArraySet<String>) msg.obj, true);
@@ -4826,10 +4824,7 @@ public class AlarmManagerService extends SystemService {
                    uid = msg.arg1;
                    if (!hasScheduleExactAlarmInternal(packageName, uid)
                            && !hasUseExactAlarmInternal(packageName, uid)) {
                        synchronized (mLock) {
                            removeExactAlarmsOnPermissionRevokedLocked(uid,
                                    packageName, /*killUid = */false);
                        }
                        removeExactAlarmsOnPermissionRevoked(uid, packageName, /*killUid = */false);
                    }
                    break;
                case CHECK_EXACT_ALARM_PERMISSION_ON_FEATURE_TOGGLE:
@@ -4849,10 +4844,7 @@ public class AlarmManagerService extends SystemService {
                            if (defaultDenied) {
                                if (!hasScheduleExactAlarmInternal(pkg, uid)
                                        && !hasUseExactAlarmInternal(pkg, uid)) {
                                    synchronized (mLock) {
                                        removeExactAlarmsOnPermissionRevokedLocked(uid, pkg,
                                                true);
                                    }
                                    removeExactAlarmsOnPermissionRevoked(uid, pkg, true);
                                }
                            } else if (hasScheduleExactAlarmInternal(pkg, uid)) {
                                sendScheduleExactAlarmPermissionStateChangedBroadcast(pkg,
+2 −4
Original line number Diff line number Diff line
@@ -1414,11 +1414,9 @@ public class PackageParser {
        final ParseTypeImpl input = ParseTypeImpl.forDefaultParsing();
        final ParseResult<android.content.pm.SigningDetails> result;
        if (skipVerify) {
            // systemDir APKs are already trusted, save time by not verifying; since the signature
            // is not verified and some system apps can have their V2+ signatures stripped allow
            // pulling the certs from the jar signature.
            // systemDir APKs are already trusted, save time by not verifying
            result = ApkSignatureVerifier.unsafeGetCertsWithoutVerification(
                    input, apkPath, SigningDetails.SignatureSchemeVersion.JAR);
                    input, apkPath, minSignatureScheme);
        } else {
            result = ApkSignatureVerifier.verify(input, apkPath, minSignatureScheme);
        }
+0 −31
Original line number Diff line number Diff line
@@ -167,15 +167,6 @@
    {
      "name": "CtsIncrementalInstallHostTestCases"
    },
    {
      "name": "CtsInstallHostTestCases"
    },
    {
      "name": "CtsStagedInstallHostTestCases"
    },
    {
      "name": "CtsExtractNativeLibsHostTestCases"
    },
    {
      "name": "CtsAppSecurityHostTestCases",
      "options": [
@@ -187,17 +178,6 @@
        }
      ]
    },
    {
      "name": "FrameworksServicesTests",
      "options": [
        {
          "include-filter": "com.android.server.pm.PackageParserTest"
        }
      ]
    },
    {
      "name": "CtsRollbackManagerHostTestCases"
    },
    {
      "name": "CtsContentTestCases",
      "options": [
@@ -205,17 +185,6 @@
          "include-filter": "android.content.cts.IntentFilterTest"
        }
      ]
    },
    {
      "name": "CtsAppEnumerationTestCases"
    },
    {
      "name": "PackageManagerServiceUnitTests",
      "options": [
        {
          "include-filter": "com.android.server.pm.test.verify.domain"
        }
      ]
    }
  ]
}
+15 −14
Original line number Diff line number Diff line
@@ -7678,20 +7678,6 @@ public final class Settings {
        public static final String ZEN_SETTINGS_SUGGESTION_VIEWED =
                "zen_settings_suggestion_viewed";
        /**
         * State of whether review notification permissions notification needs to
         * be shown the user, and whether the user has interacted.
         *
         * Valid values:
         *   -1 = UNKNOWN
         *    0 = SHOULD_SHOW
         *    1 = USER_INTERACTED
         *    2 = DISMISSED
         * @hide
         */
        public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE =
                "review_permissions_notification_state";
        /**
         * Whether the in call notification is enabled to play sound during calls.  The value is
         * boolean (1 or 0).
@@ -16973,6 +16959,21 @@ public final class Settings {
        public static final String MANAGED_PROVISIONING_DEFER_PROVISIONING_TO_ROLE_HOLDER =
                "managed_provisioning_defer_provisioning_to_role_holder";
        /**
         * State of whether review notification permissions notification needs to
         * be shown the user, and whether the user has interacted.
         *
         * Valid values:
         *   -1 = UNKNOWN
         *    0 = SHOULD_SHOW
         *    1 = USER_INTERACTED
         *    2 = DISMISSED
         *    3 = RESHOWN
         * @hide
         */
        public static final String REVIEW_PERMISSIONS_NOTIFICATION_STATE =
                "review_permissions_notification_state";
        /**
         * Settings migrated from Wear OS settings provider.
         * @hide
+8 −0
Original line number Diff line number Diff line
@@ -999,6 +999,14 @@ public class DreamService extends Service implements Window.Callback {
        return mDreamServiceWrapper;
    }

    @Override
    public boolean onUnbind(Intent intent) {
        // We must unbind from any overlay connection if we are unbound before finishing.
        mOverlayConnection.unbind(this);

        return super.onUnbind(intent);
    }

    /**
     * Stops the dream and detaches from the window.
     * <p>
Loading