Merge "ReolverActivity: try auto launching single choice" into nyc-mr2-dev am: daacf547ac

am: 0a804ff49c

Change-Id: I8f378b98f29aea48773804bb65306c5b6760a758
This commit is contained in:
Xiaohui Chen
2017-02-16 19:37:17 +00:00
committed by android-build-merger

View File

@@ -123,6 +123,13 @@ public class ResolverActivity extends Activity {
bindProfileView();
}
}
@Override
public boolean onPackageChanged(String packageName, int uid, String[] components) {
// We care about all package changes, not just the whole package itself which is
// default behavior.
return true;
}
};
/**
@@ -1555,7 +1562,15 @@ public class ResolverActivity extends Activity {
}
public void onListRebuilt() {
// This space for rent
int count = getUnfilteredCount();
if (count == 1 && getOtherProfile() == null) {
// Only one target, so we're a candidate to auto-launch!
final TargetInfo target = targetInfoForPosition(0, false);
if (shouldAutoLaunchSingleChoice(target)) {
safelyStartActivity(target);
finish();
}
}
}
public boolean shouldGetResolvedFilter() {