Merge "Remove some usages of deprecated location APIs"

This commit is contained in:
Tom O'Neill
2014-03-06 17:30:36 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 4 deletions

View File

@@ -84,8 +84,8 @@ public class RestrictionUtils {
userRestrictions.putBoolean(entry.getKey(), !entry.getSelectedState());
if (entry.getKey().equals(UserManager.DISALLOW_SHARE_LOCATION)
&& !entry.getSelectedState()) {
Secure.putStringForUser(context.getContentResolver(),
Secure.LOCATION_PROVIDERS_ALLOWED, "", user.getIdentifier());
Secure.putIntForUser(context.getContentResolver(),
Secure.LOCATION_MODE, Secure.LOCATION_MODE_OFF, user.getIdentifier());
}
}
um.setUserRestrictions(userRestrictions, user);

View File

@@ -345,8 +345,8 @@ public class UserSettings extends RestrictedSettingsFragment
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);
Secure.putIntForUser(getContentResolver(),
Secure.LOCATION_MODE, Secure.LOCATION_MODE_OFF, userId);
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
UserSettings.USER_DRAWABLES[
userId % UserSettings.USER_DRAWABLES.length]);