diff options
author | Yorke Lee <yorkelee@google.com> | 2015-04-20 16:53:40 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2015-04-20 16:53:41 +0000 |
commit | 577200257eb759075888eae000214f4c9f5cb035 (patch) | |
tree | 58f2e1cdbc998215ac48930d47f662e0ed29c2df | |
parent | 021395ece479114cc39f7d9c366c893fb0646155 (diff) | |
parent | b94249061098b35e9feb612cef8f36a988d20bde (diff) |
Merge "Use UserManager.isSystemUser API"
-rw-r--r-- | src/com/android/dialer/settings/DialerSettingsActivity.java | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/src/com/android/dialer/settings/DialerSettingsActivity.java b/src/com/android/dialer/settings/DialerSettingsActivity.java index 8653dc9a7..b84d8ab5f 100644 --- a/src/com/android/dialer/settings/DialerSettingsActivity.java +++ b/src/com/android/dialer/settings/DialerSettingsActivity.java @@ -105,19 +105,10 @@ public class DialerSettingsActivity extends PreferenceActivity { } /** - * Whether a user handle associated with the current user is that of the primary owner. That is, - * whether there is a user handle which has an id which matches the owner's handle. * @return Whether the current user is the primary user. */ private boolean isPrimaryUser() { - UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); - List<UserHandle> userHandles = userManager.getUserProfiles(); - for (int i = 0; i < userHandles.size(); i++){ - if (userHandles.get(i).myUserId() == OWNER_HANDLE_ID) { - return true; - } - } - - return false; + final UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE); + return userManager.isSystemUser(); } } |