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
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
switch (intent.getAction()) {
|
switch (intent.getAction()) {
|
||||||
case Installer.ACTION_UNINSTALL_STARTED: {
|
case Installer.ACTION_UNINSTALL_STARTED:
|
||||||
headerFragment.startProgress();
|
headerFragment.startProgress();
|
||||||
headerFragment.showIndeterminateProgress(getString(R.string.uninstalling));
|
headerFragment.showIndeterminateProgress(getString(R.string.uninstalling));
|
||||||
break;
|
break;
|
||||||
}
|
case Installer.ACTION_UNINSTALL_COMPLETE:
|
||||||
case Installer.ACTION_UNINSTALL_COMPLETE: {
|
|
||||||
headerFragment.removeProgress();
|
headerFragment.removeProgress();
|
||||||
onAppChanged();
|
onAppChanged();
|
||||||
|
|
||||||
localBroadcastManager.unregisterReceiver(this);
|
localBroadcastManager.unregisterReceiver(this);
|
||||||
break;
|
break;
|
||||||
}
|
case Installer.ACTION_UNINSTALL_INTERRUPTED:
|
||||||
case Installer.ACTION_UNINSTALL_INTERRUPTED: {
|
|
||||||
headerFragment.removeProgress();
|
headerFragment.removeProgress();
|
||||||
|
|
||||||
String errorMessage =
|
String errorMessage =
|
||||||
@ -640,8 +638,7 @@ public class AppDetails extends AppCompatActivity {
|
|||||||
|
|
||||||
localBroadcastManager.unregisterReceiver(this);
|
localBroadcastManager.unregisterReceiver(this);
|
||||||
break;
|
break;
|
||||||
}
|
case Installer.ACTION_UNINSTALL_USER_INTERACTION:
|
||||||
case Installer.ACTION_UNINSTALL_USER_INTERACTION: {
|
|
||||||
PendingIntent uninstallPendingIntent =
|
PendingIntent uninstallPendingIntent =
|
||||||
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
||||||
|
|
||||||
@ -652,10 +649,8 @@ public class AppDetails extends AppCompatActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
default:
|
||||||
default: {
|
|
||||||
throw new RuntimeException("intent action not handled!");
|
throw new RuntimeException("intent action not handled!");
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -798,37 +798,32 @@ public class SwapWorkflowActivity extends AppCompatActivity {
|
|||||||
private final BroadcastReceiver installReceiver = new BroadcastReceiver() {
|
private final BroadcastReceiver installReceiver = new BroadcastReceiver() {
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
switch (intent.getAction()) {
|
switch (intent.getAction()) {
|
||||||
case Installer.ACTION_INSTALL_STARTED: {
|
case Installer.ACTION_INSTALL_STARTED:
|
||||||
break;
|
break;
|
||||||
}
|
case Installer.ACTION_INSTALL_COMPLETE:
|
||||||
case Installer.ACTION_INSTALL_COMPLETE: {
|
localBroadcastManager.unregisterReceiver(this);
|
||||||
localBroadcastManager.unregisterReceiver(this);
|
|
||||||
|
|
||||||
showRelevantView(true);
|
showRelevantView(true);
|
||||||
break;
|
break;
|
||||||
}
|
case Installer.ACTION_INSTALL_INTERRUPTED:
|
||||||
case Installer.ACTION_INSTALL_INTERRUPTED: {
|
localBroadcastManager.unregisterReceiver(this);
|
||||||
localBroadcastManager.unregisterReceiver(this);
|
// TODO: handle errors!
|
||||||
// TODO: handle errors!
|
break;
|
||||||
break;
|
case Installer.ACTION_INSTALL_USER_INTERACTION:
|
||||||
}
|
PendingIntent installPendingIntent =
|
||||||
case Installer.ACTION_INSTALL_USER_INTERACTION: {
|
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
||||||
PendingIntent installPendingIntent =
|
|
||||||
intent.getParcelableExtra(Installer.EXTRA_USER_INTERACTION_PI);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
installPendingIntent.send();
|
installPendingIntent.send();
|
||||||
} catch (PendingIntent.CanceledException e) {
|
} catch (PendingIntent.CanceledException e) {
|
||||||
Log.e(TAG, "PI canceled", 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