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

Commit 7bf4d300 authored by Shafik Nassar's avatar Shafik Nassar Committed by Automerger Merge Worker
Browse files

Merge "Always kill app when M_E_S is denied" into rvc-dev am: d7e1e468 am: e2829e98

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12048548

Change-Id: I306a30b5082074024a5c9357d74cb67ffa6ec609
parents d3844687 e2829e98
Loading
Loading
Loading
Loading
+3 −8
Original line number Diff line number Diff line
@@ -4736,7 +4736,7 @@ class StorageManagerService extends IStorageManager.Stub
            return true;
        }

        private void killAppForOpChange(int code, int uid, String packageName) {
        private void killAppForOpChange(int code, int uid) {
            final IActivityManager am = ActivityManager.getService();
            try {
                am.killUid(UserHandle.getAppId(uid), UserHandle.USER_ALL,
@@ -4753,7 +4753,7 @@ class StorageManagerService extends IStorageManager.Stub
                    switch(code) {
                        case OP_REQUEST_INSTALL_PACKAGES:
                            // Always kill regardless of op change, to remount apps /storage
                            killAppForOpChange(code, uid, packageName);
                            killAppForOpChange(code, uid);
                            return;
                        case OP_MANAGE_EXTERNAL_STORAGE:
                            if (mode != MODE_ALLOWED) {
@@ -4762,12 +4762,7 @@ class StorageManagerService extends IStorageManager.Stub
                                // results in a bad UX, especially since the gid only gives access
                                // to unreliable volumes, USB OTGs that are rarely mounted. The app
                                // will get the external_storage gid on next organic restart.
                                if (packageName != null) {
                                    killAppForOpChange(code, uid, packageName);
                                } else {
                                    // TODO(b/158283222) this can happen, figure out if we need
                                    // to kill in this case as well.
                                }
                                killAppForOpChange(code, uid);
                            }
                            return;
                        case OP_LEGACY_STORAGE: