Fix repeating apps on pause/resume

Preference list was getting duplicated on pausing and resuming the activity.

Pull the user info out of the preference list and make it a static header
so that it stays fixed. Can now remove all entries before re-adding.

Disable location by default and disable ability to change Unknown sources
 toggle.

Bug: 8685561
Bug: 8688400

Change-Id: I64ce728d5369e03ddaba562bcd66bb0720a037d2
This commit is contained in:
Amith Yamasani
2013-04-22 13:37:58 -07:00
parent bf3391f19b
commit 1bad7141b4
5 changed files with 130 additions and 32 deletions

View File

@@ -45,6 +45,7 @@ import android.preference.Preference.OnPreferenceClickListener;
import android.preference.PreferenceGroup;
import android.provider.ContactsContract;
import android.provider.ContactsContract.Contacts;
import android.provider.Settings.Secure;
import android.util.Log;
import android.util.SparseArray;
import android.view.Menu;
@@ -305,7 +306,9 @@ public class UserSettings extends SettingsPreferenceFragment
int userId = newUserInfo.id;
UserHandle user = new UserHandle(userId);
mUserManager.setUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, true, user);
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user);
Secure.putStringForUser(getContentResolver(),
Secure.LOCATION_PROVIDERS_ALLOWED, "", userId);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
UserSettings.USER_DRAWABLES[
userId % UserSettings.USER_DRAWABLES.length]);