Fix issue #7215984: java.lang.RuntimeException: Unable to create...

...service com.android.systemui.SystemUIService: java.lang.NullPointerException

- Don't acquire the activity manager lock in handleIncomingUser(),
  there is really no need to do so.
- Rework the settings provider client side cache code to not hold
  locks while calling into the provider.

I also changed the way the settings provider uses system properties
so that there is one property for all users.  We can't do one per
user, since the system property name space is limited with a fixed
size.  And we don't really need to do that; the worse that happens
by combining all users is that if one running user changes one of its
settings, all other running users will think they need to reload
settings when they go to fetch them next.

Change-Id: I13b90b832310d117eb6d721aacd122cfba7d749a
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index f0b8812..3a9b068 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -315,10 +315,10 @@
         String property = null, table = uri.getPathSegments().get(0);
         final boolean isGlobal = table.equals(TABLE_GLOBAL);
         if (table.equals(TABLE_SYSTEM)) {
-            property = Settings.System.SYS_PROP_SETTING_VERSION + '_' + userHandle;
+            property = Settings.System.SYS_PROP_SETTING_VERSION;
             backedUpDataChanged = true;
         } else if (table.equals(TABLE_SECURE)) {
-            property = Settings.Secure.SYS_PROP_SETTING_VERSION + '_' + userHandle;
+            property = Settings.Secure.SYS_PROP_SETTING_VERSION;
             backedUpDataChanged = true;
         } else if (isGlobal) {
             property = Settings.Global.SYS_PROP_SETTING_VERSION;    // this one is global
@@ -447,11 +447,6 @@
             sSystemCaches.delete(userHandle);
             sSecureCaches.delete(userHandle);
             sKnownMutationsInFlight.delete(userHandle);
-
-            String property = Settings.System.SYS_PROP_SETTING_VERSION + '_' + userHandle;
-            SystemProperties.set(property, "");
-            property = Settings.Secure.SYS_PROP_SETTING_VERSION + '_' + userHandle;
-            SystemProperties.set(property, "");
         }
     }