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

Commit e038216c authored by Gustav Sennton's avatar Gustav Sennton Committed by android-build-merger
Browse files

Merge "Allow using USER_ALL as user id when killing package dependents." into nyc-dev

am: c2ba2907

* commit 'c2ba2907':
  Allow using USER_ALL as user id when killing package dependents.
parents 38d8cd36 c2ba2907
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -20802,7 +20802,7 @@ public final class ActivityManagerService extends ActivityManagerNative
            pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, userId);
            pkgUid = pm.getPackageUid(packageName, MATCH_DEBUG_TRIAGED_MISSING, userId);
        } catch (RemoteException e) {
        } catch (RemoteException e) {
        }
        }
        if (pkgUid == -1) {
        if (userId != UserHandle.USER_ALL && pkgUid == -1) {
            throw new IllegalArgumentException(
            throw new IllegalArgumentException(
                    "Cannot kill dependents of non-existing package " + packageName);
                    "Cannot kill dependents of non-existing package " + packageName);
        }
        }
+3 −2
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@ import android.content.pm.Signature;
import android.os.Binder;
import android.os.Binder;
import android.os.Process;
import android.os.Process;
import android.os.RemoteException;
import android.os.RemoteException;
import android.os.UserHandle;
import android.provider.Settings;
import android.provider.Settings;
import android.provider.Settings.Secure;
import android.provider.Settings.Secure;
import android.util.AndroidRuntimeException;
import android.util.AndroidRuntimeException;
@@ -141,7 +142,7 @@ public class WebViewUpdateService extends SystemService {
                                // only kills dependents of packages that are being removed.
                                // only kills dependents of packages that are being removed.
                                try {
                                try {
                                    ActivityManagerNative.getDefault().killPackageDependents(
                                    ActivityManagerNative.getDefault().killPackageDependents(
                                        oldProviderName, getContext().getUserId());
                                        oldProviderName, UserHandle.USER_ALL);
                                } catch (RemoteException e) {
                                } catch (RemoteException e) {
                                }
                                }
                            }
                            }
@@ -209,7 +210,7 @@ public class WebViewUpdateService extends SystemService {
        try {
        try {
            if (oldPackage != null) {
            if (oldPackage != null) {
                ActivityManagerNative.getDefault().killPackageDependents(
                ActivityManagerNative.getDefault().killPackageDependents(
                        oldPackage.packageName, getContext().getUserId());
                        oldPackage.packageName, UserHandle.USER_ALL);
            }
            }
        } catch (RemoteException e) {
        } catch (RemoteException e) {
        }
        }