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
This commit is contained in:
Zoltan Szatmary-Ban
2014-12-09 19:20:21 +00:00
parent 1e1251cc04
commit d80e1278b0

View File

@@ -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);