@@ -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