Skip to content

Commit e2829e9

Browse files
Shafik Nassarandroid-build-merge-worker-robot
authored andcommitted
Merge "Always kill app when M_E_S is denied" into rvc-dev am: d7e1e46
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12048548 Change-Id: I825adf2261904a8458d5cccc2722bf6110ae740f
2 parents 458d37d + d7e1e46 commit e2829e9

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

services/core/java/com/android/server/StorageManagerService.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4736,7 +4736,7 @@ public boolean hasExternalStorage(int uid, String packageName) {
47364736
return true;
47374737
}
47384738

4739-
private void killAppForOpChange(int code, int uid, String packageName) {
4739+
private void killAppForOpChange(int code, int uid) {
47404740
final IActivityManager am = ActivityManager.getService();
47414741
try {
47424742
am.killUid(UserHandle.getAppId(uid), UserHandle.USER_ALL,
@@ -4753,7 +4753,7 @@ public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int
47534753
switch(code) {
47544754
case OP_REQUEST_INSTALL_PACKAGES:
47554755
// Always kill regardless of op change, to remount apps /storage
4756-
killAppForOpChange(code, uid, packageName);
4756+
killAppForOpChange(code, uid);
47574757
return;
47584758
case OP_MANAGE_EXTERNAL_STORAGE:
47594759
if (mode != MODE_ALLOWED) {
@@ -4762,12 +4762,7 @@ public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int
47624762
// results in a bad UX, especially since the gid only gives access
47634763
// to unreliable volumes, USB OTGs that are rarely mounted. The app
47644764
// will get the external_storage gid on next organic restart.
4765-
if (packageName != null) {
4766-
killAppForOpChange(code, uid, packageName);
4767-
} else {
4768-
// TODO(b/158283222) this can happen, figure out if we need
4769-
// to kill in this case as well.
4770-
}
4765+
killAppForOpChange(code, uid);
47714766
}
47724767
return;
47734768
case OP_LEGACY_STORAGE:

0 commit comments

Comments
 (0)