diff options
author | Harsh Shandilya <me@msfjarvis.dev> | 2018-06-02 13:38:36 +0530 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2018-06-02 19:14:56 +0200 |
commit | 4671f59c67db5576ea340a2f586642b3243c85a4 (patch) | |
tree | 87ff1560eed926402bc29b1617f6799c1fd60a03 /app/src/main/java/com/wireguard/android/preference/VersionPreference.java | |
parent | 4986d92f3d5fb0d7bb4f15bf2b02f8b36ef23dff (diff) |
android: Cleanup classes
- Use final modifer wherever possible
- Use try-with-resources for input/output streams
Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
Diffstat (limited to 'app/src/main/java/com/wireguard/android/preference/VersionPreference.java')
-rw-r--r-- | app/src/main/java/com/wireguard/android/preference/VersionPreference.java | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/app/src/main/java/com/wireguard/android/preference/VersionPreference.java b/app/src/main/java/com/wireguard/android/preference/VersionPreference.java index c0fb986b..b1a1cf49 100644 --- a/app/src/main/java/com/wireguard/android/preference/VersionPreference.java +++ b/app/src/main/java/com/wireguard/android/preference/VersionPreference.java @@ -27,10 +27,9 @@ public class VersionPreference extends Preference { versionSummary = getContext().getString(R.string.version_userspace_summary, GoBackend.getVersion()); } else if (Application.getComponent().getBackendType() == WgQuickBackend.class) { Application.getComponent().getToolsInstaller().getVersion().whenComplete((version, exception) -> { - if (exception == null) - versionSummary = getContext().getString(R.string.version_kernel_summary, version); - else - versionSummary = getContext().getString(R.string.version_kernel_unknown_summary); + versionSummary = exception == null + ? getContext().getString(R.string.version_kernel_summary, version) + : getContext().getString(R.string.version_kernel_unknown_summary); notifyChanged(); }); } |