Loading services/core/java/com/android/server/StorageManagerService.java +27 −27 Original line number Diff line number Diff line Loading @@ -4503,6 +4503,8 @@ class StorageManagerService extends IStorageManager.Stub } public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int mode) { final long token = Binder.clearCallingIdentity(); try { if (mIsFuseEnabled) { // When using FUSE, we may need to kill the app if the op changes switch(code) { Loading @@ -4513,10 +4515,10 @@ class StorageManagerService extends IStorageManager.Stub case OP_MANAGE_EXTERNAL_STORAGE: if (mode != MODE_ALLOWED) { // Only kill if op is denied, to lose external_storage gid // Killing when op is granted to pickup the gid automatically, 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. // Killing when op is granted to pickup the gid automatically, // 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. killAppForOpChange(code, uid, packageName); } return; Loading @@ -4529,17 +4531,15 @@ class StorageManagerService extends IStorageManager.Stub if (mode == MODE_ALLOWED && (code == OP_READ_EXTERNAL_STORAGE || code == OP_WRITE_EXTERNAL_STORAGE || code == OP_REQUEST_INSTALL_PACKAGES)) { final long token = Binder.clearCallingIdentity(); try { final UserManagerInternal userManagerInternal = LocalServices.getService(UserManagerInternal.class); if (userManagerInternal.isUserInitialized(UserHandle.getUserId(uid))) { onExternalStoragePolicyChanged(uid, packageName); } } } finally { Binder.restoreCallingIdentity(token); } } } } } Loading
services/core/java/com/android/server/StorageManagerService.java +27 −27 Original line number Diff line number Diff line Loading @@ -4503,6 +4503,8 @@ class StorageManagerService extends IStorageManager.Stub } public void onAppOpsChanged(int code, int uid, @Nullable String packageName, int mode) { final long token = Binder.clearCallingIdentity(); try { if (mIsFuseEnabled) { // When using FUSE, we may need to kill the app if the op changes switch(code) { Loading @@ -4513,10 +4515,10 @@ class StorageManagerService extends IStorageManager.Stub case OP_MANAGE_EXTERNAL_STORAGE: if (mode != MODE_ALLOWED) { // Only kill if op is denied, to lose external_storage gid // Killing when op is granted to pickup the gid automatically, 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. // Killing when op is granted to pickup the gid automatically, // 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. killAppForOpChange(code, uid, packageName); } return; Loading @@ -4529,17 +4531,15 @@ class StorageManagerService extends IStorageManager.Stub if (mode == MODE_ALLOWED && (code == OP_READ_EXTERNAL_STORAGE || code == OP_WRITE_EXTERNAL_STORAGE || code == OP_REQUEST_INSTALL_PACKAGES)) { final long token = Binder.clearCallingIdentity(); try { final UserManagerInternal userManagerInternal = LocalServices.getService(UserManagerInternal.class); if (userManagerInternal.isUserInitialized(UserHandle.getUserId(uid))) { onExternalStoragePolicyChanged(uid, packageName); } } } finally { Binder.restoreCallingIdentity(token); } } } } }