Some Java 1.7 string switch goodness

This commit is contained in:
Daniel Martí 2015-09-11 17:29:58 -07:00
parent a2c8c4678e
commit c0a13ad65f

View File

@ -76,15 +76,19 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity {
apkFile = getIntent().getStringExtra(EXTRA_INSTALL_APK); apkFile = getIntent().getStringExtra(EXTRA_INSTALL_APK);
action = getIntent().getAction(); switch (getIntent().getAction()) {
if (ACTION_UNINSTALL.equals(action)) { case ACTION_UNINSTALL:
uninstall(); uninstall();
} else if (ACTION_INSTALL.equals(action)) { break;
checkRootTask.execute(); case ACTION_INSTALL:
} else if (ACTION_FIRST_TIME.equals(action)) { checkRootTask.execute();
checkRootTask.execute(); break;
} else if (ACTION_POST_INSTALL.equals(action)) { case ACTION_FIRST_TIME:
postInstall(); checkRootTask.execute();
break;
case ACTION_POST_INSTALL:
postInstall();
break;
} }
} }
@ -224,12 +228,16 @@ public class InstallPrivilegedDialogActivity extends FragmentActivity {
if (rootGranted) { if (rootGranted) {
// root access granted // root access granted
if (ACTION_UNINSTALL.equals(action)) { switch (action) {
uninstallTask.execute(); case ACTION_UNINSTALL:
} else if (ACTION_INSTALL.equals(action)) { uninstallTask.execute();
installTask.execute(); break;
} else if (ACTION_FIRST_TIME.equals(action)) { case ACTION_INSTALL:
firstTime(); installTask.execute();
break;
case ACTION_FIRST_TIME:
firstTime();
break;
} }
} else { } else {
// root access denied // root access denied