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

Commit 326340eb authored by Jing Ji's avatar Jing Ji
Browse files

Defer service starts/binding until its hosting package is unfrozen

When a package is frozen(install/update etc.), for the incoming request
to start/bind to the services in the package, delay the actual action
until the package is unfrozen.

Bug: 168292935
Test: see b/168292935#comment34
Change-Id: I80d928925a2ffe36deb19da37e11dbc66881f617
parent f90b99a5
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1139,4 +1139,15 @@ public abstract class PackageManagerInternal {
            @Checksum.Type int optional, @Checksum.Type int required,
            @Nullable List trustedInstallers, @NonNull IntentSender statusReceiver, int userId,
            @NonNull Executor executor, @NonNull Handler handler);

    /**
     * Returns true if the given {@code packageName} and {@code userId} is frozen.
     *
     * @param packageName a specific package
     * @param callingUid The uid of the caller
     * @param userId The user for whom the package is installed
     * @return {@code true} If the package is current frozen (due to install/update etc.)
     */
    public abstract boolean isPackageFrozen(
            @NonNull String packageName, int callingUid, int userId);
}
+194 −89

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0
Original line number Diff line number Diff line
@@ -13596,6 +13596,7 @@ public class ActivityManagerService extends IActivityManager.Stub
                                    cleanupDisabledPackageComponentsLocked(ssp, userId,
                                            intent.getStringArrayExtra(
                                                    Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST));
                                    mServices.schedulePendingServiceStartLocked(ssp, userId);
                                }
                            }
                            break;
+77 −10

File changed.

Preview size limit exceeded, changes collapsed.