OSDN Git Service

am 5d6d2988: am d93e404e: am 1b872618: am 7a097ff1: Merge "Shared user retains permis...
authorSvetoslav Ganov <svetoslavganov@google.com>
Tue, 13 Oct 2015 02:00:13 +0000 (02:00 +0000)
committerAndroid Git Automerger <android-git-automerger@android.com>
Tue, 13 Oct 2015 02:00:13 +0000 (02:00 +0000)
* commit '5d6d29882354804050baacb156ac5e59f3fd2b7b':
  Shared user retains permissions no longer used by any app on an app update

1  2 
services/core/java/com/android/server/pm/PackageManagerService.java

@@@ -8695,12 -8570,12 +8707,14 @@@ public class PackageManagerService exte
              ps.installPermissionsFixed = true;
          }
  
-         // Persist the runtime permissions state for users with changes.
+         // Persist the runtime permissions state for users with changes. If permissions
+         // were revoked because no app in the shared user declares them we have to
+         // write synchronously to avoid losing runtime permissions state.
          for (int userId : changedRuntimePermissionUserIds) {
-             mSettings.writeRuntimePermissionsForUserLPr(userId, false);
+             mSettings.writeRuntimePermissionsForUserLPr(userId, runtimePermissionsRevoked);
          }
 +
 +        Trace.traceEnd(TRACE_TAG_PACKAGE_MANAGER);
      }
  
      private boolean isNewPlatformPermissionForPackage(String perm, PackageParser.Package pkg) {