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

Commit 23875b26 authored by Gustav Sennton's avatar Gustav Sennton
Browse files

Allow using USER_ALL as user id when killing package dependents.

Don't check package uid when trying to kill app dependents for all users
since that check will always fail.

Bug: 26973351
Change-Id: I52b28fe82791887e2af5f937afdfff6e5d565d6e
parent eb33c0a5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -20758,7 +20758,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, userId);
        } catch (RemoteException e) {
        }
        if (pkgUid == -1) {
        if (userId != UserHandle.USER_ALL && pkgUid == -1) {
            throw new IllegalArgumentException(
                    "Cannot kill dependents of non-existing package " + packageName);
        }
+3 −2
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ import android.content.pm.Signature;
import android.os.Binder;
import android.os.Process;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.util.AndroidRuntimeException;
@@ -141,7 +142,7 @@ public class WebViewUpdateService extends SystemService {
                                // only kills dependents of packages that are being removed.
                                try {
                                    ActivityManagerNative.getDefault().killPackageDependents(
                                        oldProviderName, getContext().getUserId());
                                        oldProviderName, UserHandle.USER_ALL);
                                } catch (RemoteException e) {
                                }
                            }
@@ -209,7 +210,7 @@ public class WebViewUpdateService extends SystemService {
        try {
            if (oldPackage != null) {
                ActivityManagerNative.getDefault().killPackageDependents(
                        oldPackage.packageName, getContext().getUserId());
                        oldPackage.packageName, UserHandle.USER_ALL);
            }
        } catch (RemoteException e) {
        }