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

Commit 425fa132 authored by Pawan Wagh's avatar Pawan Wagh
Browse files

Expose stopAppForUser in ActivityManger

Adding wrapper function to call stopAppForUser from
ActivityManagerService. It can be used stop app when
full scale 'force stop' is not required.

Flag: EXEMPT bug_fix
Test: m && boot device
Test: m Settings && adb install -r $ANDROID_PRODUCT_OUT/system_ext/priv-app/Settings/Settings.apk
Bug: 389696304
Change-Id: I34e8720e2f227c7f93e2e9e1df7db993aa81c607
parent 82f044c5
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -4974,6 +4974,25 @@ public class ActivityManager {
        }
    }

    /**
     * Fully stop the given app's processes without restoring service starts or
     * bindings, but without the other durable effects of the full-scale
     * "force stop" intervention.
     *
     * @param packageName The name of the package to be stopped.
     *
     * @hide This is not available to third party applications due to
     * it allowing them to break other applications by stopping their
     * services.
     */
    public void stopPackageForUser(String packageName) {
        try {
            getService().stopAppForUser(packageName, mContext.getUserId());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Sets the current locales of the device. Calling app must have the permission
     * {@code android.permission.CHANGE_CONFIGURATION} and