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

Commit 39bbae58 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/37863120',...

Merge cherrypicks of ['googleplex-android-review.googlesource.com/37863120', 'googleplex-android-review.googlesource.com/37883722'] into 25Q2-release.

Change-Id: Icf483356e8aa715a1d18b1b154cd37763febfabb
parents 73ad07fe fd6f923d
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -917,7 +917,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
        final AndroidPackageInternal pkg = p.getPkg();
        PackageSetting ret = addPackageLPw(name, p.getRealName(), p.getPath(), p.getAppId(),
                    p.getFlags(), p.getPrivateFlags(), mDomainVerificationManager.generateNewId(),
                pkg == null ? false : pkg.isSdkLibrary());
                    pkg == null ? false : pkg.isSdkLibrary(), p.hasSharedUser());
        if (ret != null) {
            ret.setLegacyNativeLibraryPath(p.getLegacyNativeLibraryPath());
            ret.setPrimaryCpuAbi(p.getPrimaryCpuAbiLegacy());
@@ -937,6 +937,7 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
            ret.setRestrictUpdateHash(p.getRestrictUpdateHash());
            ret.setScannedAsStoppedSystemApp(p.isScannedAsStoppedSystemApp());
            ret.setInstallSource(p.getInstallSource());
            ret.setSharedUserAppId(p.getSharedUserAppId());
        }
        mDisabledSysPackages.remove(name);
        return ret;
@@ -958,7 +959,8 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
    }

    PackageSetting addPackageLPw(String name, String realName, File codePath, int uid,
            int pkgFlags, int pkgPrivateFlags, @NonNull UUID domainSetId, boolean isSdkLibrary) {
            int pkgFlags, int pkgPrivateFlags, @NonNull UUID domainSetId, boolean isSdkLibrary,
            boolean hasSharedUser) {
        PackageSetting p = mPackages.get(name);
        if (p != null) {
            if (p.getAppId() == uid) {
@@ -971,7 +973,8 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
        p = new PackageSetting(name, realName, codePath, pkgFlags, pkgPrivateFlags, domainSetId)
                .setAppId(uid);
        if ((uid == Process.INVALID_UID && isSdkLibrary && Flags.disallowSdkLibsToBeApps())
                || mAppIds.registerExistingAppId(uid, p, name)) {
                || mAppIds.registerExistingAppId(uid, p, name)
                || hasSharedUser) {
            mPackages.put(name, p);
            return p;
        }
@@ -4266,7 +4269,8 @@ public final class Settings implements Watchable, Snappable, ResilientAtomicFile
            } else if (appId > 0 || (appId == Process.INVALID_UID && isSdkLibrary
                    && Flags.disallowSdkLibsToBeApps())) {
                packageSetting = addPackageLPw(name.intern(), realName, new File(codePathStr),
                        appId, pkgFlags, pkgPrivateFlags, domainSetId, isSdkLibrary);
                        appId, pkgFlags, pkgPrivateFlags, domainSetId, isSdkLibrary,
                        /* hasSharedUser= */ false);
                if (PackageManagerService.DEBUG_SETTINGS)
                    Log.i(PackageManagerService.TAG, "Reading package " + name + ": appId="
                            + appId + " pkg=" + packageSetting);
+1 −1
Original line number Diff line number Diff line
@@ -168,7 +168,7 @@ class MockSystem(withSession: (StaticMockitoSessionBuilder) -> Unit = {}) {
            null
        }
        whenever(mocks.settings.addPackageLPw(nullable(), nullable(), nullable(), nullable(),
                nullable(), nullable(), nullable(), nullable())) {
                nullable(), nullable(), nullable(), nullable(), nullable())) {
            val name: String = getArgument(0)
            val pendingAdd = mPendingPackageAdds.firstOrNull { it.first == name }
                    ?: return@whenever null
+4 −4
Original line number Diff line number Diff line
@@ -11176,7 +11176,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        mBinderService.addAutomaticZenRule(rule, "com.android.settings", false);
        // verify that zen mode helper gets passed in a package name of "android"
        verify(mockZenModeHelper).addAutomaticZenRule(any(), eq("android"), eq(rule),
        verify(zenModeHelper).addAutomaticZenRule(any(), eq("android"), eq(rule),
                eq(ZenModeConfig.ORIGIN_SYSTEM), anyString(), anyInt());
    }
@@ -11218,7 +11218,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        mBinderService.addAutomaticZenRule(rule, "another.package", false);
        // verify that zen mode helper gets passed in the package name from the arg, not the owner
        verify(mockZenModeHelper).addAutomaticZenRule(any(), eq("another.package"), eq(rule),
        verify(zenModeHelper).addAutomaticZenRule(any(), eq("another.package"), eq(rule),
                eq(ZenModeConfig.ORIGIN_APP), anyString(),
                anyInt());  // doesn't count as a system/systemui call
    }
@@ -16976,7 +16976,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        mBinderService.getNotificationPolicy("package");
        verify(zenHelper).getNotificationPolicyFromImplicitZenRule(any(), eq("package"));
        verify(zenModeHelper).getNotificationPolicyFromImplicitZenRule(any(), eq("package"));
    }
    @Test
@@ -16990,7 +16990,7 @@ public class NotificationManagerServiceTest extends UiServiceTestCase {
        mBinderService.setInterruptionFilter("package", INTERRUPTION_FILTER_PRIORITY, false);
        verify(zenHelper).applyGlobalZenModeAsImplicitZenRule(any(), eq("package"), anyInt(),
        verify(zenModeHelper).applyGlobalZenModeAsImplicitZenRule(any(), eq("package"), anyInt(),
                eq(ZEN_MODE_IMPORTANT_INTERRUPTIONS));
    }