diff options
| -rw-r--r-- | services/core/java/com/android/server/StorageManagerService.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/services/core/java/com/android/server/StorageManagerService.java b/services/core/java/com/android/server/StorageManagerService.java index 32830aeacf06..a04f25b0d20c 100644 --- a/services/core/java/com/android/server/StorageManagerService.java +++ b/services/core/java/com/android/server/StorageManagerService.java @@ -4322,6 +4322,19 @@ class StorageManagerService extends IStorageManager.Stub public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int mode) { + if (code == OP_REQUEST_INSTALL_PACKAGES && mIsFuseEnabled) { + // When using FUSE, we basically have no other choice but to kill the app + // after the app op is either granted or rejected. + final IActivityManager am = ActivityManager.getService(); + try { + am.killApplication(packageName, + UserHandle.getAppId(uid), + UserHandle.USER_ALL, AppOpsManager.opToName(code) + " changed."); + } catch (RemoteException e) { + } + + return; + } if (mode == MODE_ALLOWED && (code == OP_READ_EXTERNAL_STORAGE || code == OP_WRITE_EXTERNAL_STORAGE || code == OP_REQUEST_INSTALL_PACKAGES)) { |