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;
case ACTION_INSTALL:
checkRootTask.execute(); checkRootTask.execute();
} else if (ACTION_FIRST_TIME.equals(action)) { break;
case ACTION_FIRST_TIME:
checkRootTask.execute(); checkRootTask.execute();
} else if (ACTION_POST_INSTALL.equals(action)) { break;
case ACTION_POST_INSTALL:
postInstall(); 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) {
case ACTION_UNINSTALL:
uninstallTask.execute(); uninstallTask.execute();
} else if (ACTION_INSTALL.equals(action)) { break;
case ACTION_INSTALL:
installTask.execute(); installTask.execute();
} else if (ACTION_FIRST_TIME.equals(action)) { break;
case ACTION_FIRST_TIME:
firstTime(); firstTime();
break;
} }
} else { } else {
// root access denied // root access denied