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
This commit is contained in:
Dianne Hackborn
2012-10-10 19:01:09 -07:00
parent c9ff3bce8b
commit 9da0812284
9 changed files with 285 additions and 1 deletions

View File

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