Removes remaining scopes from switch statements
This commit is contained in:
parent
619c4f284b
commit
b149cd64fd
@ -610,19 +610,17 @@ public class AppDetails extends AppCompatActivity {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case Installer.ACTION_UNINSTALL_STARTED: {
|
||||
case Installer.ACTION_UNINSTALL_STARTED:
|
||||
headerFragment.startProgress();
|
||||
headerFragment.showIndeterminateProgress(getString(R.string.uninstalling));
|
||||
break;
|
||||
}
|
||||
case Installer.ACTION_UNINSTALL_COMPLETE: {
|
||||
case Installer.ACTION_UNINSTALL_COMPLETE:
|
||||
headerFragment.removeProgress();
|
||||
onAppChanged();
|
||||
|
||||
localBroadcastManager.unregisterReceiver(this);
|
||||
break;
|
||||
}
|
||||
case Installer.ACTION_UNINSTALL_INTERRUPTED: {
|
||||
case Installer.ACTION_UNINSTALL_INTERRUPTED:
|
||||
headerFragment.removeProgress();
|
||||
|
||||
String errorMessage =
|
||||
@ -640,8 +638,7 @@ public class AppDetails extends AppCompatActivity {
|
||||
|
||||
localBroadcastManager.unregisterReceiver(this);
|
||||
break;
|
||||
}
|
||||
case Installer.ACTION_UNINSTALL_USER_INTERACTION: {
|
||||
case Installer.ACTION_UNINSTALL_USER_INTERACTION:
|
||||
PendingIntent uninstallPendingIntent =
|
||||
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
||||
|
||||
@ -652,10 +649,8 @@ public class AppDetails extends AppCompatActivity {
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
default:
|
||||
throw new RuntimeException("intent action not handled!");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -798,37 +798,32 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
||||
private final BroadcastReceiver installReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
switch (intent.getAction()) {
|
||||
case Installer.ACTION_INSTALL_STARTED: {
|
||||
break;
|
||||
}
|
||||
case Installer.ACTION_INSTALL_COMPLETE: {
|
||||
localBroadcastManager.unregisterReceiver(this);
|
||||
switch (intent.getAction()) {
|
||||
case Installer.ACTION_INSTALL_STARTED:
|
||||
break;
|
||||
case Installer.ACTION_INSTALL_COMPLETE:
|
||||
localBroadcastManager.unregisterReceiver(this);
|
||||
|
||||
showRelevantView(true);
|
||||
break;
|
||||
}
|
||||
case Installer.ACTION_INSTALL_INTERRUPTED: {
|
||||
localBroadcastManager.unregisterReceiver(this);
|
||||
// TODO: handle errors!
|
||||
break;
|
||||
}
|
||||
case Installer.ACTION_INSTALL_USER_INTERACTION: {
|
||||
PendingIntent installPendingIntent =
|
||||
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
||||
showRelevantView(true);
|
||||
break;
|
||||
case Installer.ACTION_INSTALL_INTERRUPTED:
|
||||
localBroadcastManager.unregisterReceiver(this);
|
||||
// TODO: handle errors!
|
||||
break;
|
||||
case Installer.ACTION_INSTALL_USER_INTERACTION:
|
||||
PendingIntent installPendingIntent =
|
||||
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
||||
|
||||
try {
|
||||
installPendingIntent.send();
|
||||
} catch (PendingIntent.CanceledException e) {
|
||||
Log.e(TAG, "PI canceled", e);
|
||||
}
|
||||
try {
|
||||
installPendingIntent.send();
|
||||
} catch (PendingIntent.CanceledException e) {
|
||||
Log.e(TAG, "PI canceled", e);
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
throw new RuntimeException("intent action not handled!");
|
||||
}
|
||||
default: {
|
||||
throw new RuntimeException("intent action not handled!");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user