diff options
author | Amith Yamasani <yamasani@google.com> | 2012-08-03 13:09:11 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-08 16:52:53 -0700 |
commit | 8264408f5995534f8e3147b001664ea0df52aaa5 (patch) | |
tree | e6e963d2ec701047872bf641b28888a93c7b866a /packages/SystemUI/src/com/android | |
parent | fb11ffa2a04f0a6b1291cd7ffc68032fcc322312 (diff) | |
download | frameworks_base-8264408f5995534f8e3147b001664ea0df52aaa5.zip frameworks_base-8264408f5995534f8e3147b001664ea0df52aaa5.tar.gz frameworks_base-8264408f5995534f8e3147b001664ea0df52aaa5.tar.bz2 |
Start the correct settings from the status bar.
Added a new method to Context: startActivityAsUser() requiring the
INTERACT_ACROSS_USERS_FULL permission.
Show the correct Recents list, based on current user.
Added a getRecentTasksForUser() in ActivityManager. Hidden and requires
the INTERACT_ACROSS_USERS_FULL permission.
Change-Id: If5b56465efdd3ead36601a3b51ed4af157bbf35c
Diffstat (limited to 'packages/SystemUI/src/com/android')
3 files changed, 9 insertions, 5 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java index fefd0e8..3e03f85 100644 --- a/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java +++ b/packages/SystemUI/src/com/android/systemui/recent/RecentTasksLoader.java @@ -30,6 +30,7 @@ import android.graphics.drawable.Drawable; import android.os.AsyncTask; import android.os.Handler; import android.os.Process; +import android.os.UserId; import android.util.Log; import com.android.systemui.R; @@ -243,7 +244,8 @@ public class RecentTasksLoader { mContext.getSystemService(Context.ACTIVITY_SERVICE); final List<ActivityManager.RecentTaskInfo> recentTasks = - am.getRecentTasks(MAX_TASKS, ActivityManager.RECENT_IGNORE_UNAVAILABLE); + am.getRecentTasksForUser(MAX_TASKS, + ActivityManager.RECENT_IGNORE_UNAVAILABLE, UserId.USER_CURRENT); 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/statusbar/phone/PhoneStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java index 16e9345..34474687 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBar.java @@ -46,6 +46,7 @@ import android.os.Message; import android.os.RemoteException; import android.os.ServiceManager; import android.os.SystemClock; +import android.os.UserId; import android.provider.Settings; import android.util.DisplayMetrics; import android.util.Log; @@ -2222,8 +2223,8 @@ public class PhoneStatusBar extends BaseStatusBar { ActivityManagerNative.getDefault().dismissKeyguardOnNextActivity(); } catch (RemoteException e) { } - v.getContext().startActivity(new Intent(Settings.ACTION_SETTINGS) - .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); + v.getContext().startActivityAsUser(new Intent(Settings.ACTION_SETTINGS) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), UserId.USER_CURRENT); animateCollapse(); } }; diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java index 537ff66..da161a9 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/tablet/SettingsView.java @@ -19,6 +19,7 @@ package com.android.systemui.statusbar.tablet; import android.app.StatusBarManager; import android.content.Context; import android.content.Intent; +import android.os.UserId; import android.provider.Settings; import android.util.AttributeSet; import android.util.Slog; @@ -117,8 +118,8 @@ public class SettingsView extends LinearLayout implements View.OnClickListener { // Settings // ---------------------------- private void onClickSettings() { - getContext().startActivity(new Intent(Settings.ACTION_SETTINGS) - .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK)); + getContext().startActivityAsUser(new Intent(Settings.ACTION_SETTINGS) + .setFlags(Intent.FLAG_ACTIVITY_NEW_TASK), UserId.USER_CURRENT); getStatusBarManager().collapse(); } } |