From d80e1278b07e0ca211b61950a635255f855dbade Mon Sep 17 00:00:00 2001 From: Zoltan Szatmary-Ban Date: Tue, 9 Dec 2014 19:20:21 +0000 Subject: [PATCH] Bring up correct app for Recent location list items When clicking on a list item in Settings > Location > Recent locations, the correct app should be shown for items corresponding to managed profile apps. Bug: 17655978 Change-Id: Ie4b388f0ea103ee16629b0d8d92e5de08adffc5e --- .../android/settings/location/RecentLocationApps.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/com/android/settings/location/RecentLocationApps.java b/src/com/android/settings/location/RecentLocationApps.java index 9f2b8abaaed..c134889a722 100644 --- a/src/com/android/settings/location/RecentLocationApps.java +++ b/src/com/android/settings/location/RecentLocationApps.java @@ -61,9 +61,11 @@ public class RecentLocationApps { private class PackageEntryClickedListener implements Preference.OnPreferenceClickListener { private String mPackage; + private UserHandle mUserHandle; - public PackageEntryClickedListener(String packageName) { + public PackageEntryClickedListener(String packageName, UserHandle userHandle) { mPackage = packageName; + mUserHandle = userHandle; } @Override @@ -71,8 +73,8 @@ public class RecentLocationApps { // start new fragment to display extended information Bundle args = new Bundle(); args.putString(InstalledAppDetails.ARG_PACKAGE_NAME, mPackage); - mActivity.startPreferencePanel(InstalledAppDetails.class.getName(), args, - R.string.application_info_label, null, null, 0); + mActivity.startPreferencePanelAsUser(InstalledAppDetails.class.getName(), args, + R.string.application_info_label, null, mUserHandle); return true; } } @@ -200,7 +202,7 @@ public class RecentLocationApps { } preference = createRecentLocationEntry(icon, appLabel, highBattery, badgedAppLabel, - new PackageEntryClickedListener(packageName)); + new PackageEntryClickedListener(packageName, userHandle)); } catch (RemoteException e) { Log.w(TAG, "Error while retrieving application info for package " + packageName + ", userId " + userId, e);