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) {
|
||||
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);
|
||||
//In API 26, there are multiplte developer settings activities, choose the one with highest priority
|
||||
ResolveInfo topItem = getPackageManager().resolveActivity(settingsIntent, PackageManager.MATCH_DEFAULT_ONLY);
|
||||
if (topItem != null) {
|
||||
results.add(0, topItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user