global: Cleanup line lengths and misc lint warnings
I know we decided to ditch the idea of shutting up "Exception thrown with empty param" warnings but this pesters me too much and we can instead just treat this as a weird future proofing thing if and when we end up needing the exception messages. Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
committed by
Jason A. Donenfeld
parent
e2ab2210cd
commit
0b9bcf0f9e
@@ -46,7 +46,7 @@ public class TunnelEditorFragment extends BaseFragment {
|
||||
binding.setConfig(new Config.Observable(config, name));
|
||||
}
|
||||
|
||||
private void onConfigSaved(final Tunnel savedTunnel, final Config config,
|
||||
private void onConfigSaved(final Tunnel savedTunnel,
|
||||
final Throwable throwable) {
|
||||
final String message;
|
||||
if (throwable == null) {
|
||||
@@ -141,7 +141,7 @@ public class TunnelEditorFragment extends BaseFragment {
|
||||
} else {
|
||||
Log.d(TAG, "Attempting to save config of " + tunnel.getName());
|
||||
tunnel.setConfig(newConfig)
|
||||
.whenComplete((a, b) -> onConfigSaved(tunnel, a, b));
|
||||
.whenComplete((a, b) -> onConfigSaved(tunnel, b));
|
||||
}
|
||||
return true;
|
||||
default:
|
||||
@@ -192,7 +192,7 @@ public class TunnelEditorFragment extends BaseFragment {
|
||||
Log.d(TAG, message);
|
||||
// Now save the rest of configuration changes.
|
||||
Log.d(TAG, "Attempting to save config of renamed tunnel " + tunnel.getName());
|
||||
renamedTunnel.setConfig(newConfig).whenComplete((a, b) -> onConfigSaved(renamedTunnel, a, b));
|
||||
renamedTunnel.setConfig(newConfig).whenComplete((a, b) -> onConfigSaved(renamedTunnel, b));
|
||||
} else {
|
||||
final String error = ExceptionLoggers.unwrap(throwable).getMessage();
|
||||
message = getString(R.string.tunnel_rename_error, error);
|
||||
|
||||
@@ -94,7 +94,8 @@ public class TunnelListFragment extends BaseFragment {
|
||||
asyncWorker.supplyAsync(() -> {
|
||||
final String[] columns = {OpenableColumns.DISPLAY_NAME};
|
||||
String name = null;
|
||||
try (Cursor cursor = contentResolver.query(uri, columns, null, null, null)) {
|
||||
try (Cursor cursor = contentResolver.query(uri, columns,
|
||||
null, null, null)) {
|
||||
if (cursor != null && cursor.moveToFirst() && !cursor.isNull(0))
|
||||
name = cursor.getString(0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user