Remove some usages of deprecated location APIs
Bug: 13302202 Change-Id: I916568d2b310eaf9a8b30da9a9980344aaf76c21
This commit is contained in:
@@ -84,8 +84,8 @@ public class RestrictionUtils {
|
|||||||
userRestrictions.putBoolean(entry.getKey(), !entry.getSelectedState());
|
userRestrictions.putBoolean(entry.getKey(), !entry.getSelectedState());
|
||||||
if (entry.getKey().equals(UserManager.DISALLOW_SHARE_LOCATION)
|
if (entry.getKey().equals(UserManager.DISALLOW_SHARE_LOCATION)
|
||||||
&& !entry.getSelectedState()) {
|
&& !entry.getSelectedState()) {
|
||||||
Secure.putStringForUser(context.getContentResolver(),
|
Secure.putIntForUser(context.getContentResolver(),
|
||||||
Secure.LOCATION_PROVIDERS_ALLOWED, "", user.getIdentifier());
|
Secure.LOCATION_MODE, Secure.LOCATION_MODE_OFF, user.getIdentifier());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
um.setUserRestrictions(userRestrictions, user);
|
um.setUserRestrictions(userRestrictions, user);
|
||||||
|
@@ -345,8 +345,8 @@ public class UserSettings extends RestrictedSettingsFragment
|
|||||||
UserHandle user = new UserHandle(userId);
|
UserHandle user = new UserHandle(userId);
|
||||||
mUserManager.setUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, true, user);
|
mUserManager.setUserRestriction(UserManager.DISALLOW_MODIFY_ACCOUNTS, true, user);
|
||||||
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user);
|
mUserManager.setUserRestriction(UserManager.DISALLOW_SHARE_LOCATION, true, user);
|
||||||
Secure.putStringForUser(getContentResolver(),
|
Secure.putIntForUser(getContentResolver(),
|
||||||
Secure.LOCATION_PROVIDERS_ALLOWED, "", userId);
|
Secure.LOCATION_MODE, Secure.LOCATION_MODE_OFF, userId);
|
||||||
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
|
Bitmap bitmap = BitmapFactory.decodeResource(getResources(),
|
||||||
UserSettings.USER_DRAWABLES[
|
UserSettings.USER_DRAWABLES[
|
||||||
userId % UserSettings.USER_DRAWABLES.length]);
|
userId % UserSettings.USER_DRAWABLES.length]);
|
||||||
|
Reference in New Issue
Block a user