ui: Codestyle cleanups

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya
2020-03-10 13:08:28 +05:30
parent 021e16959f
commit a3b9c3b884
10 changed files with 65 additions and 63 deletions
@@ -53,12 +53,12 @@ public class ModuleDownloaderPreference extends Preference {
setState(State.SUCCESS);
Application.getAsyncWorker().runAsync(() -> {
Thread.sleep(1000 * 5);
Intent i = getContext().getPackageManager().getLaunchIntentForPackage(getContext().getPackageName());
if (i == null)
final Intent restartIntent = getContext().getPackageManager().getLaunchIntentForPackage(getContext().getPackageName());
if (restartIntent == null)
return;
i.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Application.get().startActivity(i);
restartIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
restartIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
Application.get().startActivity(restartIntent);
System.exit(0);
});
} else
@@ -42,7 +42,7 @@ public class VersionPreference extends Preference {
});
}
private String getBackendPrettyName(final Context context, final Backend backend) {
private static String getBackendPrettyName(final Context context, final Backend backend) {
if (backend instanceof WgQuickBackend)
return context.getString(R.string.type_name_kernel_module);
if (backend instanceof GoBackend)