From 8d866e52b209cb683159f2701cc4204163de245c Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Wed, 10 Oct 2012 18:39:45 -0700 Subject: [PATCH] More on issue #7318666: hide developer options from user build The action to launch the developer settings panel is now required by the platform. Add a new hidden API to LauncherActivity so I can better integrate these into the existing Dev Tools app. Change-Id: I9c082622fd4c8f4a5be51cabb664741a3782ece1 --- core/java/android/app/LauncherActivity.java | 11 +++++++++-- core/java/android/provider/Settings.java | 7 +++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/core/java/android/app/LauncherActivity.java b/core/java/android/app/LauncherActivity.java index 8eb9ba48b98e2..96c7246acf3cd 100644 --- a/core/java/android/app/LauncherActivity.java +++ b/core/java/android/app/LauncherActivity.java @@ -439,14 +439,21 @@ public abstract class LauncherActivity extends ListActivity { protected List onQueryPackageManager(Intent queryIntent) { return mPackageManager.queryIntentActivities(queryIntent, /* no flags */ 0); } - + + /** + * @hide + */ + protected void onSortResultList(List results) { + Collections.sort(results, new ResolveInfo.DisplayNameComparator(mPackageManager)); + } + /** * Perform the query to determine which results to show and return a list of them. */ public List makeListItems() { // Load all matching activities and sort correctly List list = onQueryPackageManager(mIntent); - Collections.sort(list, new ResolveInfo.DisplayNameComparator(mPackageManager)); + onSortResultList(list); ArrayList result = new ArrayList(list.size()); int listSize = list.size(); diff --git a/core/java/android/provider/Settings.java b/core/java/android/provider/Settings.java index 00ea8736d2328..8897039fbe66f 100644 --- a/core/java/android/provider/Settings.java +++ b/core/java/android/provider/Settings.java @@ -386,10 +386,9 @@ public final class Settings { /** * Activity Action: Show settings to allow configuration of application - * development-related settings. - *

- * In some cases, a matching Activity may not exist, so ensure you safeguard - * against this. + * development-related settings. As of + * {@link android.os.Build.VERSION_CODES#JELLY_BEAN_MR1} this action is + * a required part of the platform. *

* Input: Nothing. *