Fixed the bug where there are multiple developer options
BUG: 69679218 Change-Id: Ib44bf9441ecc7378d810cb55e5d9acdedbde99d6 Signed-off-by: Weilun Du <wdu@google.com>
This commit is contained in:
@@ -36,11 +36,10 @@ public class Development extends LauncherActivity
|
|||||||
protected void onSortResultList(List<ResolveInfo> results) {
|
protected void onSortResultList(List<ResolveInfo> results) {
|
||||||
super.onSortResultList(results);
|
super.onSortResultList(results);
|
||||||
Intent settingsIntent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
|
Intent settingsIntent = new Intent(Settings.ACTION_APPLICATION_DEVELOPMENT_SETTINGS);
|
||||||
List<ResolveInfo> topItems = getPackageManager().queryIntentActivities(
|
//In API 26, there are multiplte developer settings activities, choose the one with highest priority
|
||||||
settingsIntent, PackageManager.MATCH_DEFAULT_ONLY);
|
ResolveInfo topItem = getPackageManager().resolveActivity(settingsIntent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||||
if (topItems != null) {
|
if (topItem != null) {
|
||||||
super.onSortResultList(topItems);
|
results.add(0, topItem);
|
||||||
results.addAll(0, topItems);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user