Merge "Ensure that hasFirstRunActivity is only called when necessary" into jb-ub-now-kermit

This commit is contained in:
Adam Cohen 2014-01-15 00:26:07 +00:00 committed by Android (Google) Code Review
commit 13b563bcae
1 changed files with 4 additions and 3 deletions

View File

@ -4309,12 +4309,13 @@ public class Launcher extends Activity
}
private boolean shouldRunFirstRunActivity() {
return !ActivityManager.isRunningInTestHarness();
return !ActivityManager.isRunningInTestHarness() &&
!mSharedPrefs.getBoolean(FIRST_RUN_ACTIVITY_DISPLAYED, false);
}
public void showFirstRunActivity() {
if (shouldRunFirstRunActivity() && hasFirstRunActivity()
&& !mSharedPrefs.getBoolean(FIRST_RUN_ACTIVITY_DISPLAYED, false)) {
if (shouldRunFirstRunActivity() &&
hasFirstRunActivity()) {
Intent firstRunIntent = getFirstRunActivity();
if (firstRunIntent != null) {
startActivity(firstRunIntent);