diff options
author | Kenny Guy <kennyguy@google.com> | 2014-04-02 13:29:20 +0100 |
---|---|---|
committer | Kenny Guy <kennyguy@google.com> | 2014-04-02 13:44:50 +0100 |
commit | 2a764949c943681a4d25a17a0b203a0127a4a486 (patch) | |
tree | 5cacb4e3be3f0c47e25f4e98389110310622e4b0 /packages | |
parent | 30cac644f161433fca92ca65edcb26b351a04e5a (diff) | |
download | frameworks_base-2a764949c943681a4d25a17a0b203a0127a4a486.zip frameworks_base-2a764949c943681a4d25a17a0b203a0127a4a486.tar.gz frameworks_base-2a764949c943681a4d25a17a0b203a0127a4a486.tar.bz2 |
Rename related users to profiles.
Rename the related user concept as profiles.
When returning profiles of a user include the
user as a profile of itself.
Change-Id: Id5d4f29017b7ca6844632ce643f10331ad733e1d
Diffstat (limited to 'packages')
6 files changed, 23 insertions, 24 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java index 9d2d6ee..ab2ad96 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java @@ -368,7 +368,7 @@ public class RecentTasksLoader implements View.OnTouchListener { final ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasksForUser(1, - ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_RELATED, + ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_PROFILES, UserHandle.CURRENT.getIdentifier()); TaskDescription item = null; if (recentTasks.size() > 0) { @@ -441,7 +441,7 @@ public class RecentTasksLoader implements View.OnTouchListener { final List<ActivityManager.RecentTaskInfo> recentTasks = am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE - | ActivityManager.RECENT_INCLUDE_RELATED); + | ActivityManager.RECENT_INCLUDE_PROFILES); int numTasks = recentTasks.size(); ActivityInfo homeInfo = new Intent(Intent.ACTION_MAIN) .addCategory(Intent.CATEGORY_HOME).resolveActivityInfo(pm, 0); diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java b/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java index f75ea92..7ab40b0 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentsActivity.java @@ -165,7 +165,7 @@ public class RecentsActivity extends Activity { am.getRecentTasks(2, ActivityManager.RECENT_WITH_EXCLUDED | ActivityManager.RECENT_IGNORE_UNAVAILABLE | - ActivityManager.RECENT_INCLUDE_RELATED); + ActivityManager.RECENT_INCLUDE_PROFILES); if (recentTasks.size() > 1 && mRecentsPanel.simulateClick(recentTasks.get(1).persistentId)) { // recents panel will take care of calling show(false) through simulateClick diff --git a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java index 1a616a0..227e19d 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java +++ b/packages/SystemUI/src/com/android/systemui/recents/AlternateRecentsComponent.java @@ -221,7 +221,7 @@ public class AlternateRecentsComponent { Bitmap loadFirstTaskThumbnail() { ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RecentTaskInfo> tasks = am.getRecentTasksForUser(1, - ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_RELATED, + ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_PROFILES, UserHandle.CURRENT.getIdentifier()); for (ActivityManager.RecentTaskInfo t : tasks) { // Skip tasks in the home stack @@ -239,7 +239,7 @@ public class AlternateRecentsComponent { boolean hasFirstTask() { ActivityManager am = (ActivityManager) mContext.getSystemService(Context.ACTIVITY_SERVICE); List<ActivityManager.RecentTaskInfo> tasks = am.getRecentTasksForUser(1, - ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_RELATED, + ActivityManager.RECENT_IGNORE_UNAVAILABLE | ActivityManager.RECENT_INCLUDE_PROFILES, UserHandle.CURRENT.getIdentifier()); for (ActivityManager.RecentTaskInfo t : tasks) { // Skip tasks in the home stack diff --git a/packages/SystemUI/src/com/android/systemui/recents/RecentsTaskLoader.java b/packages/SystemUI/src/com/android/systemui/recents/RecentsTaskLoader.java index b497b69..65cbd62 100644 --- a/packages/SystemUI/src/com/android/systemui/recents/RecentsTaskLoader.java +++ b/packages/SystemUI/src/com/android/systemui/recents/RecentsTaskLoader.java @@ -376,7 +376,7 @@ public class RecentsTaskLoader { // Get the recent tasks List<ActivityManager.RecentTaskInfo> tasks = am.getRecentTasksForUser(25, ActivityManager.RECENT_IGNORE_UNAVAILABLE | - ActivityManager.RECENT_INCLUDE_RELATED, UserHandle.CURRENT.getIdentifier()); + ActivityManager.RECENT_INCLUDE_PROFILES, UserHandle.CURRENT.getIdentifier()); Collections.reverse(tasks); Console.log(Constants.DebugFlags.App.TimeSystemCalls, "[RecentsTaskLoader|getRecentTasks]", diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index bad5641..e5e287d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -134,7 +134,7 @@ public abstract class BaseStatusBar extends SystemUI implements protected PopupMenu mNotificationBlamePopup; protected int mCurrentUserId = 0; - final protected SparseArray<UserInfo> mRelatedUsers = new SparseArray<UserInfo>(); + final protected SparseArray<UserInfo> mCurrentProfiles = new SparseArray<UserInfo>(); protected int mLayoutDirection = -1; // invalid private Locale mLocale; @@ -244,21 +244,21 @@ public abstract class BaseStatusBar extends SystemUI implements String action = intent.getAction(); if (Intent.ACTION_USER_SWITCHED.equals(action)) { mCurrentUserId = intent.getIntExtra(Intent.EXTRA_USER_HANDLE, -1); - updateRelatedUserCache(); + updateCurrentProfilesCache(); if (true) Log.v(TAG, "userId " + mCurrentUserId + " is in the house"); userSwitched(mCurrentUserId); } else if (Intent.ACTION_USER_ADDED.equals(action)) { - updateRelatedUserCache(); + updateCurrentProfilesCache(); } } }; - private void updateRelatedUserCache() { - synchronized (mRelatedUsers) { - mRelatedUsers.clear(); + private void updateCurrentProfilesCache() { + synchronized (mCurrentProfiles) { + mCurrentProfiles.clear(); if (mUserManager != null) { - for (UserInfo related : mUserManager.getRelatedUsers(mCurrentUserId)) { - mRelatedUsers.put(related.id, related); + for (UserInfo user : mUserManager.getProfiles(mCurrentUserId)) { + mCurrentProfiles.put(user.id, user); } } } @@ -361,24 +361,23 @@ public abstract class BaseStatusBar extends SystemUI implements filter.addAction(Intent.ACTION_USER_ADDED); mContext.registerReceiver(mBroadcastReceiver, filter); - updateRelatedUserCache(); + updateCurrentProfilesCache(); } public void userSwitched(int newUserId) { // should be overridden } - public boolean notificationIsForCurrentOrRelatedUser(StatusBarNotification n) { + public boolean notificationIsForCurrentProfiles(StatusBarNotification n) { final int thisUserId = mCurrentUserId; final int notificationUserId = n.getUserId(); if (DEBUG && MULTIUSER_DEBUG) { Log.v(TAG, String.format("%s: current userid: %d, notification userid: %d", n, thisUserId, notificationUserId)); } - synchronized (mRelatedUsers) { + synchronized (mCurrentProfiles) { return notificationUserId == UserHandle.USER_ALL - || thisUserId == notificationUserId - || mRelatedUsers.get(notificationUserId) != null; + || mCurrentProfiles.get(notificationUserId) != null; } } @@ -1258,7 +1257,7 @@ public abstract class BaseStatusBar extends SystemUI implements updateNotificationVetoButton(oldEntry.row, notification); // Is this for you? - boolean isForCurrentUser = notificationIsForCurrentOrRelatedUser(notification); + boolean isForCurrentUser = notificationIsForCurrentProfiles(notification); if (DEBUG) Log.d(TAG, "notification is " + (isForCurrentUser ? "" : "not ") + "for you"); // Restart the ticker if it's still running diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index e7f96dc..2257aaa 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -1078,8 +1078,8 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { Entry ent = mNotificationData.get(N-i-1); if (!(provisioned || showNotificationEvenIfUnprovisioned(ent.notification))) continue; - // TODO How do we want to badge notifcations from related users. - if (!notificationIsForCurrentOrRelatedUser(ent.notification)) continue; + // TODO How do we want to badge notifcations from profiles. + if (!notificationIsForCurrentProfiles(ent.notification)) continue; final int vis = ent.notification.getNotification().visibility; if (vis != Notification.VISIBILITY_SECRET) { @@ -1138,7 +1138,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { Entry ent = mNotificationData.get(N-i-1); if (!((provisioned && ent.notification.getScore() >= HIDE_ICONS_BELOW_SCORE) || showNotificationEvenIfUnprovisioned(ent.notification))) continue; - if (!notificationIsForCurrentOrRelatedUser(ent.notification)) continue; + if (!notificationIsForCurrentProfiles(ent.notification)) continue; if (isLockscreenPublicMode() && ent.notification.getNotification().visibility == Notification.VISIBILITY_SECRET @@ -2150,7 +2150,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode { if (!isDeviceProvisioned()) return; // not for you - if (!notificationIsForCurrentOrRelatedUser(n)) return; + if (!notificationIsForCurrentProfiles(n)) return; // Show the ticker if one is requested. Also don't do this // until status bar window is attached to the window manager, |