summaryrefslogtreecommitdiff
path: root/apps/Development/src/com/android/development/Development.java
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2012-10-10 19:01:09 -0700
committerDianne Hackborn <hackbod@google.com>2012-10-10 19:01:09 -0700
commit9da081228438a35c181c0f3d138698b007532c69 (patch)
treed6f3f7e81a5dcb6b3b29c457e79a82f4c5020025 /apps/Development/src/com/android/development/Development.java
parentc9ff3bce8b398252ee2978cca43b5ec88937f1ab (diff)
More on issue #7318666: hide developer options from user build
The Dev Tools app now tries to add a link to Development Settings at the top of its list. Also add a new "Development Settings" app that directly takes you to the development settings activity, as a stand-alone app that could be distributed as a regular third party app. Change-Id: I8fe2b6a32cf4e37d69f4ce7b8d646a147b492d99
Diffstat (limited to 'apps/Development/src/com/android/development/Development.java')
-rw-r--r--apps/Development/src/com/android/development/Development.java17
1 files changed, 16 insertions, 1 deletions
diff --git a/apps/Development/src/com/android/development/Development.java b/apps/Development/src/com/android/development/Development.java
index a3979f219..8a317cd27 100644
--- a/apps/Development/src/com/android/development/Development.java
+++ b/apps/Development/src/com/android/development/Development.java
@@ -16,8 +16,13 @@
package com.android.development;
+import java.util.List;
+
import android.app.LauncherActivity;
import android.content.Intent;
+import android.content.pm.PackageManager;
+import android.content.pm.ResolveInfo;
+import android.provider.Settings;
public class Development extends LauncherActivity
{
@@ -25,7 +30,17 @@ public class Development extends LauncherActivity
protected Intent getTargetIntent() {
Intent targetIntent = new Intent(Intent.ACTION_MAIN, null);
targetIntent.addCategory(Intent.CATEGORY_TEST);
- targetIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
return targetIntent;
}
+
+ protected void onSortResultList(List<ResolveInfo> results) {
+ super.onSortResultList(results);
+ Intent settingsIntent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
+ List<ResolveInfo> topItems = getPackageManager().queryIntentActivities(
+ settingsIntent, PackageManager.MATCH_DEFAULT_ONLY);
+ if (topItems != null) {
+ super.onSortResultList(topItems);
+ results.addAll(0, topItems);
+ }
+ }
}