serialVersionUID
*/
@@ -282,11 +284,11 @@ public class Netstat {
return protocol;
}
- public final void setProtocol(final byte protocol) {
+ final void setProtocol(final byte protocol) {
this.protocol = protocol;
}
- public final String getProtocolAsString() {
+ final String getProtocolAsString() {
switch (protocol) {
case TCP_CONNECTION:
return "TCP";
@@ -310,7 +312,7 @@ public class Netstat {
return pid;
}
- public final void setPID(final int pid) {
+ final void setPID(final int pid) {
this.pid = pid;
}
@@ -318,7 +320,7 @@ public class Netstat {
return pname;
}
- public final void setPName(final String pname) {
+ final void setPName(final String pname) {
this.pname = pname;
}
@@ -326,7 +328,7 @@ public class Netstat {
return localPort;
}
- public final void setLocalPort(final int localPort) {
+ final void setLocalPort(final int localPort) {
this.localPort = localPort;
}
@@ -334,7 +336,7 @@ public class Netstat {
return remoteAddress;
}
- public final void setRemoteAddress(final String remoteAddress) {
+ final void setRemoteAddress(final String remoteAddress) {
this.remoteAddress = remoteAddress;
}
@@ -342,7 +344,7 @@ public class Netstat {
return remotePort;
}
- public final void setRemotePort(final int remotePort) {
+ final void setRemotePort(final int remotePort) {
this.remotePort = remotePort;
}
@@ -350,22 +352,21 @@ public class Netstat {
return status;
}
- public final void setStatus(final String status) {
+ final void setStatus(final String status) {
this.status = status;
}
+ @NonNull
public String toString() {
- StringBuffer buf = new StringBuffer();
- buf.append("[Prot=").append(getProtocolAsString());
- buf.append(",POwner=").append(powner);
- buf.append(",PID=").append(pid);
- buf.append(",PName=").append(pname);
- buf.append(",LPort=").append(localPort);
- buf.append(",RAddress=").append(remoteAddress);
- buf.append(",RPort=").append(remotePort);
- buf.append(",Status=").append(status);
- buf.append("]");
- return buf.toString();
+ return "[Prot=" + getProtocolAsString() +
+ ",POwner=" + powner +
+ ",PID=" + pid +
+ ",PName=" + pname +
+ ",LPort=" + localPort +
+ ",RAddress=" + remoteAddress +
+ ",RPort=" + remotePort +
+ ",Status=" + status +
+ "]";
}
}
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/UiWatchers.java b/app/src/androidTest/java/org/fdroid/fdroid/UiWatchers.java
index 5e8800f96..002dc235a 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/UiWatchers.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/UiWatchers.java
@@ -16,12 +16,12 @@
package org.fdroid.fdroid;
+import android.util.Log;
+
import androidx.test.uiautomator.UiDevice;
import androidx.test.uiautomator.UiObject;
import androidx.test.uiautomator.UiObjectNotFoundException;
import androidx.test.uiautomator.UiSelector;
-import androidx.test.uiautomator.UiWatcher;
-import android.util.Log;
import java.util.ArrayList;
import java.util.List;
@@ -38,83 +38,71 @@ class UiWatchers {
* This is a sample watcher looking for ANR and crashes. it closes it and moves on. You should
* create your own watchers and handle error logging properly for your type of tests.
*/
- public void registerAnrAndCrashWatchers() {
- UiDevice.getInstance().registerWatcher("ANR", new UiWatcher() {
- @Override
- public boolean checkForCondition() {
- UiObject window = new UiObject(new UiSelector().className(
- "com.android.server.am.AppNotRespondingDialog"));
- String errorText = null;
- if (window.exists()) {
- try {
- errorText = window.getText();
- } catch (UiObjectNotFoundException e) {
- Log.e(LOG_TAG, "dialog gone?", e);
- }
- onAnrDetected(errorText);
- postHandler("Wait");
- return true; // triggered
+ void registerAnrAndCrashWatchers() {
+ UiDevice.getInstance().registerWatcher("ANR", () -> {
+ UiObject window = new UiObject(new UiSelector().className(
+ "com.android.server.am.AppNotRespondingDialog"));
+ String errorText = null;
+ if (window.exists()) {
+ try {
+ errorText = window.getText();
+ } catch (UiObjectNotFoundException e) {
+ Log.e(LOG_TAG, "dialog gone?", e);
}
- return false; // no trigger
+ onAnrDetected(errorText);
+ postHandler("Wait");
+ return true; // triggered
}
+ return false; // no trigger
});
// class names may have changed
- UiDevice.getInstance().registerWatcher("ANR2", new UiWatcher() {
- @Override
- public boolean checkForCondition() {
- UiObject window = new UiObject(new UiSelector().packageName("android")
- .textContains("isn't responding."));
- if (window.exists()) {
- String errorText = null;
- try {
- errorText = window.getText();
- } catch (UiObjectNotFoundException e) {
- Log.e(LOG_TAG, "dialog gone?", e);
- }
- onAnrDetected(errorText);
- postHandler("Wait");
- return true; // triggered
+ UiDevice.getInstance().registerWatcher("ANR2", () -> {
+ UiObject window = new UiObject(new UiSelector().packageName("android")
+ .textContains("isn't responding."));
+ if (window.exists()) {
+ String errorText = null;
+ try {
+ errorText = window.getText();
+ } catch (UiObjectNotFoundException e) {
+ Log.e(LOG_TAG, "dialog gone?", e);
}
- return false; // no trigger
+ onAnrDetected(errorText);
+ postHandler("Wait");
+ return true; // triggered
}
+ return false; // no trigger
});
- UiDevice.getInstance().registerWatcher("CRASH", new UiWatcher() {
- @Override
- public boolean checkForCondition() {
- UiObject window = new UiObject(new UiSelector().className(
- "com.android.server.am.AppErrorDialog"));
- if (window.exists()) {
- String errorText = null;
- try {
- errorText = window.getText();
- } catch (UiObjectNotFoundException e) {
- Log.e(LOG_TAG, "dialog gone?", e);
- }
- onCrashDetected(errorText);
- postHandler("OK");
- return true; // triggered
+ UiDevice.getInstance().registerWatcher("CRASH", () -> {
+ UiObject window = new UiObject(new UiSelector().className(
+ "com.android.server.am.AppErrorDialog"));
+ if (window.exists()) {
+ String errorText = null;
+ try {
+ errorText = window.getText();
+ } catch (UiObjectNotFoundException e) {
+ Log.e(LOG_TAG, "dialog gone?", e);
}
- return false; // no trigger
+ onCrashDetected(errorText);
+ postHandler("OK");
+ return true; // triggered
}
+ return false; // no trigger
});
- UiDevice.getInstance().registerWatcher("CRASH2", new UiWatcher() {
- @Override
- public boolean checkForCondition() {
- UiObject window = new UiObject(new UiSelector().packageName("android")
- .textContains("has stopped"));
- if (window.exists()) {
- String errorText = null;
- try {
- errorText = window.getText();
- } catch (UiObjectNotFoundException e) {
- Log.e(LOG_TAG, "dialog gone?", e);
- }
- onCrashDetected(errorText);
- postHandler("OK");
- return true; // triggered
+ UiDevice.getInstance().registerWatcher("CRASH2", () -> {
+ UiObject window = new UiObject(new UiSelector().packageName("android")
+ .textContains("has stopped"));
+ if (window.exists()) {
+ String errorText = null;
+ try {
+ errorText = window.getText();
+ } catch (UiObjectNotFoundException e) {
+ Log.e(LOG_TAG, "dialog gone?", e);
}
- return false; // no trigger
+ onCrashDetected(errorText);
+ postHandler("OK");
+ return true; // triggered
}
+ return false; // no trigger
});
Log.i(LOG_TAG, "Registered GUI Exception watchers");
}
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/compat/FileCompatTest.java b/app/src/androidTest/java/org/fdroid/fdroid/compat/FileCompatTest.java
index 93e42bbe4..c629173d2 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/compat/FileCompatTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/compat/FileCompatTest.java
@@ -1,13 +1,18 @@
package org.fdroid.fdroid.compat;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
import android.app.Instrumentation;
import android.content.Context;
import android.os.Build;
import android.os.Environment;
-import androidx.test.platform.app.InstrumentationRegistry;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
import android.util.Log;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
import org.fdroid.fdroid.AssetUtils;
import org.fdroid.fdroid.data.SanitizedFile;
import org.junit.After;
@@ -18,10 +23,6 @@ import org.junit.runner.RunWith;
import java.io.File;
import java.util.UUID;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assume.assumeTrue;
-
/**
* This test needs to run on the emulator, even though it technically could
@@ -78,7 +79,6 @@ public class FileCompatTest {
assertTrue(destFile.getAbsolutePath() + " should exist after symlinking", destFile.exists());
}
-
/**
* Prefer internal over external storage, because external tends to be FAT filesystems,
* which don't support symlinks (which we test using this method).
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/installer/ApkVerifierTest.java b/app/src/androidTest/java/org/fdroid/fdroid/installer/ApkVerifierTest.java
index 1a6b4356b..ff6c7a2fc 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/installer/ApkVerifierTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/installer/ApkVerifierTest.java
@@ -156,7 +156,8 @@ public class ApkVerifierTest {
try {
apkVerifier.verifyApk();
- } catch (ApkVerifier.ApkVerificationException | ApkVerifier.ApkPermissionUnequalException e) {
+ } catch (ApkVerifier.ApkVerificationException |
+ ApkVerifier.ApkPermissionUnequalException e) {
e.printStackTrace();
fail(e.getMessage());
}
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/nearby/BonjourManagerTest.java b/app/src/androidTest/java/org/fdroid/fdroid/nearby/BonjourManagerTest.java
index 0741badd3..918e7f3c7 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/nearby/BonjourManagerTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/nearby/BonjourManagerTest.java
@@ -1,5 +1,7 @@
package org.fdroid.fdroid.nearby;
+import static org.junit.Assert.assertTrue;
+
import android.content.Context;
import androidx.test.core.app.ApplicationProvider;
@@ -15,8 +17,6 @@ import java.util.concurrent.TimeUnit;
import javax.jmdns.ServiceEvent;
import javax.jmdns.ServiceListener;
-import static org.junit.Assert.assertTrue;
-
@RunWith(AndroidJUnit4.class)
public class BonjourManagerTest {
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/nearby/LocalHTTPDManagerTest.java b/app/src/androidTest/java/org/fdroid/fdroid/nearby/LocalHTTPDManagerTest.java
index 99212ba85..d3d31747f 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/nearby/LocalHTTPDManagerTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/nearby/LocalHTTPDManagerTest.java
@@ -1,14 +1,20 @@
package org.fdroid.fdroid.nearby;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
+import android.util.Log;
+import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.localbroadcastmanager.content.LocalBroadcastManager;
-import android.util.Log;
+
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Netstat;
import org.fdroid.fdroid.Utils;
@@ -23,11 +29,6 @@ import java.net.ServerSocket;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
/**
* Test the nearby webserver in the emulator.
*/
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/nearby/PublicSourceDirProviderTest.java b/app/src/androidTest/java/org/fdroid/fdroid/nearby/PublicSourceDirProviderTest.java
index 507feb1e6..59d89f387 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/nearby/PublicSourceDirProviderTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/nearby/PublicSourceDirProviderTest.java
@@ -1,5 +1,9 @@
package org.fdroid.fdroid.nearby;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
@@ -7,6 +11,9 @@ import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
+import androidx.test.ext.junit.runners.AndroidJUnit4;
+import androidx.test.platform.app.InstrumentationRegistry;
+
import org.apache.commons.io.FileUtils;
import org.junit.Before;
import org.junit.Test;
@@ -17,13 +24,6 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.List;
-import androidx.test.ext.junit.runners.AndroidJUnit4;
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
@RunWith(AndroidJUnit4.class)
public class PublicSourceDirProviderTest {
public static final String TAG = "DataApkProviderTest";
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/net/HttpDownloaderTest.java b/app/src/androidTest/java/org/fdroid/fdroid/net/HttpDownloaderTest.java
index 1f7e31f20..211d859e9 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/net/HttpDownloaderTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/net/HttpDownloaderTest.java
@@ -1,6 +1,9 @@
-
package org.fdroid.fdroid.net;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
import android.os.Build;
import android.util.Log;
@@ -11,7 +14,6 @@ import org.fdroid.download.HttpDownloader;
import org.fdroid.download.HttpManager;
import org.fdroid.download.Mirror;
import org.fdroid.fdroid.FDroidApp;
-import org.fdroid.fdroid.ProgressListener;
import org.fdroid.fdroid.Utils;
import org.fdroid.index.v1.IndexV1UpdaterKt;
import org.junit.Test;
@@ -26,10 +28,6 @@ import java.util.List;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
public class HttpDownloaderTest {
private static final String TAG = "HttpDownloaderTest";
@@ -84,12 +82,7 @@ public class HttpDownloaderTest {
File destFile = File.createTempFile("dl-", "");
final DownloadRequest request = new DownloadRequest(path, mirrors, null, null, null);
final HttpDownloader httpDownloader = new HttpDownloader(httpManager, request, destFile);
- httpDownloader.setListener(new ProgressListener() {
- @Override
- public void onProgress(long bytesRead, long totalBytes) {
- receivedProgress = true;
- }
- });
+ httpDownloader.setListener((bytesRead, totalBytes) -> receivedProgress = true);
new Thread() {
@Override
public void run() {
@@ -156,12 +149,9 @@ public class HttpDownloaderTest {
File destFile = File.createTempFile("dl-", "");
final DownloadRequest request = new DownloadRequest(path, mirrors, null, null, null);
final HttpDownloader httpDownloader = new HttpDownloader(httpManager, request, destFile);
- httpDownloader.setListener(new ProgressListener() {
- @Override
- public void onProgress(long bytesRead, long totalBytes) {
- receivedProgress = true;
- latch.countDown();
- }
+ httpDownloader.setListener((bytesRead, totalBytes) -> {
+ receivedProgress = true;
+ latch.countDown();
});
new Thread() {
@Override
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/updater/SwapRepoEmulatorTest.java b/app/src/androidTest/java/org/fdroid/fdroid/updater/SwapRepoEmulatorTest.java
index 631c920de..6e4879fb8 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/updater/SwapRepoEmulatorTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/updater/SwapRepoEmulatorTest.java
@@ -1,5 +1,11 @@
package org.fdroid.fdroid.updater;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
@@ -8,6 +14,9 @@ import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
+import androidx.test.filters.LargeTest;
+import androidx.test.platform.app.InstrumentationRegistry;
+
import org.fdroid.fdroid.BuildConfig;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Hasher;
@@ -30,15 +39,6 @@ import java.util.Locale;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
-import androidx.test.filters.LargeTest;
-import androidx.test.platform.app.InstrumentationRegistry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-
@LargeTest
public class SwapRepoEmulatorTest {
public static final String TAG = "SwapRepoEmulatorTest";
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/work/CleanCacheWorkerTest.java b/app/src/androidTest/java/org/fdroid/fdroid/work/CleanCacheWorkerTest.java
index e084fe6db..4e0a03ae6 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/work/CleanCacheWorkerTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/work/CleanCacheWorkerTest.java
@@ -1,12 +1,19 @@
package org.fdroid.fdroid.work;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
import android.app.Instrumentation;
+
import androidx.arch.core.executor.testing.InstantTaskExecutorRule;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkInfo;
+
import com.google.common.util.concurrent.ListenableFuture;
+
import org.apache.commons.io.FileUtils;
import org.fdroid.fdroid.compat.FileCompatTest;
import org.junit.Rule;
@@ -16,10 +23,6 @@ import java.io.File;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
/**
* This test cannot run on Robolectric unfortunately since it does not support
* getting the timestamps from the files completely.
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/work/FDroidMetricsWorkerTest.java b/app/src/androidTest/java/org/fdroid/fdroid/work/FDroidMetricsWorkerTest.java
index a3f3d08ff..19f6a8c46 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/work/FDroidMetricsWorkerTest.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/work/FDroidMetricsWorkerTest.java
@@ -18,12 +18,16 @@
package org.fdroid.fdroid.work;
+import static org.junit.Assert.assertEquals;
+
import androidx.arch.core.executor.testing.InstantTaskExecutorRule;
import androidx.test.filters.LargeTest;
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.work.OneTimeWorkRequest;
import androidx.work.WorkInfo;
+
import com.google.common.util.concurrent.ListenableFuture;
+
import org.junit.Ignore;
import org.junit.Rule;
import org.junit.Test;
@@ -31,8 +35,6 @@ import org.junit.Test;
import java.io.IOException;
import java.util.concurrent.ExecutionException;
-import static org.junit.Assert.assertEquals;
-
/**
* This actually runs {@link FDroidMetricsWorker} on a device/emulator and
* submits a report to https://metrics.cleaninsights.org
diff --git a/app/src/androidTest/java/org/fdroid/fdroid/work/WorkManagerTestRule.java b/app/src/androidTest/java/org/fdroid/fdroid/work/WorkManagerTestRule.java
index 26466963a..c6a03d1b6 100644
--- a/app/src/androidTest/java/org/fdroid/fdroid/work/WorkManagerTestRule.java
+++ b/app/src/androidTest/java/org/fdroid/fdroid/work/WorkManagerTestRule.java
@@ -3,11 +3,13 @@ package org.fdroid.fdroid.work;
import android.app.Instrumentation;
import android.content.Context;
import android.util.Log;
+
import androidx.test.platform.app.InstrumentationRegistry;
import androidx.work.Configuration;
import androidx.work.WorkManager;
import androidx.work.testing.SynchronousExecutor;
import androidx.work.testing.WorkManagerTestInitHelper;
+
import org.junit.rules.TestWatcher;
import org.junit.runner.Description;
diff --git a/app/src/basic/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java b/app/src/basic/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java
index f98619fbc..497073038 100644
--- a/app/src/basic/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java
+++ b/app/src/basic/java/org/fdroid/fdroid/nearby/TreeUriScannerIntentService.java
@@ -19,9 +19,10 @@
package org.fdroid.fdroid.nearby;
-import androidx.appcompat.app.AppCompatActivity;
import android.content.Intent;
+import androidx.appcompat.app.AppCompatActivity;
+
/**
* Dummy version for basic app flavor.
*/
diff --git a/app/src/basic/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java b/app/src/basic/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java
index 145c9e567..9b964356a 100644
--- a/app/src/basic/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java
+++ b/app/src/basic/java/org/fdroid/fdroid/nearby/WifiStateChangeService.java
@@ -21,6 +21,7 @@ package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.content.Intent;
+
import androidx.annotation.Nullable;
/**
diff --git a/app/src/basic/java/org/fdroid/fdroid/views/main/MainViewController.java b/app/src/basic/java/org/fdroid/fdroid/views/main/MainViewController.java
index cdfefe870..b9c8dd18b 100644
--- a/app/src/basic/java/org/fdroid/fdroid/views/main/MainViewController.java
+++ b/app/src/basic/java/org/fdroid/fdroid/views/main/MainViewController.java
@@ -20,10 +20,12 @@
package org.fdroid.fdroid.views.main;
import android.widget.FrameLayout;
+
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.fragment.app.Fragment;
import androidx.recyclerview.widget.RecyclerView;
+
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.views.PreferencesFragment;
import org.fdroid.fdroid.views.updates.UpdatesViewBinder;
@@ -51,14 +53,14 @@ class MainViewController extends RecyclerView.ViewHolder {
/**
* @see LatestViewBinder
*/
- public void bindLatestView() {
+ void bindLatestView() {
new LatestViewBinder(activity, frame);
}
/**
* @see UpdatesViewBinder
*/
- public void bindUpdates() {
+ void bindUpdates() {
if (updatesView == null) {
updatesView = new UpdatesViewBinder(activity, frame);
}
@@ -66,7 +68,7 @@ class MainViewController extends RecyclerView.ViewHolder {
updatesView.bind();
}
- public void unbindUpdates() {
+ void unbindUpdates() {
if (updatesView != null) {
updatesView.unbind();
}
@@ -75,11 +77,11 @@ class MainViewController extends RecyclerView.ViewHolder {
/**
* @see CategoriesViewBinder
*/
- public void bindCategoriesView() {
+ void bindCategoriesView() {
new CategoriesViewBinder(activity, frame);
}
- public void bindSwapView() {
+ void bindSwapView() {
throw new IllegalStateException("unimplemented");
}
@@ -96,7 +98,7 @@ class MainViewController extends RecyclerView.ViewHolder {
*
* @see SettingsView
*/
- public void bindSettingsView() {
+ void bindSettingsView() {
activity.getLayoutInflater().inflate(R.layout.main_tab_settings, frame, true);
}
}
diff --git a/app/src/basic/java/org/fdroid/fdroid/views/main/NearbyViewBinder.java b/app/src/basic/java/org/fdroid/fdroid/views/main/NearbyViewBinder.java
index 1829a4439..0d2329980 100644
--- a/app/src/basic/java/org/fdroid/fdroid/views/main/NearbyViewBinder.java
+++ b/app/src/basic/java/org/fdroid/fdroid/views/main/NearbyViewBinder.java
@@ -3,7 +3,7 @@ package org.fdroid.fdroid.views.main;
import android.content.Context;
class NearbyViewBinder {
- public static void updateUsbOtg(Context context) {
+ static void updateUsbOtg(Context context) {
throw new IllegalStateException("unimplemented");
}
}
diff --git a/app/src/basic/res/drawable-anydpi-v26/ic_launcher_foreground.xml b/app/src/basic/res/drawable-anydpi-v26/ic_launcher_foreground.xml
index 92f87f2b6..06e9368a8 100644
--- a/app/src/basic/res/drawable-anydpi-v26/ic_launcher_foreground.xml
+++ b/app/src/basic/res/drawable-anydpi-v26/ic_launcher_foreground.xml
@@ -4,52 +4,56 @@
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
- * This is mostly just synced from {@code SimpleWebServer.java} from NanoHTTPD. * - * @see webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java + * @see + * webserver/src/main/java/fi/iki/elonen/SimpleWebServer.java */ public class LocalHTTPD extends NanoHTTPD { private static final String TAG = "LocalHTTPD"; @@ -159,17 +160,20 @@ public class LocalHTTPD extends NanoHTTPD { } protected Response getInternalErrorResponse(String s) { - return newFixedLengthResponse(Response.Status.INTERNAL_ERROR, NanoHTTPD.MIME_PLAINTEXT, "INTERNAL ERROR: " + s); + return newFixedLengthResponse(Response.Status.INTERNAL_ERROR, NanoHTTPD.MIME_PLAINTEXT, + "INTERNAL ERROR: " + s); } protected Response getNotFoundResponse() { - return newFixedLengthResponse(Response.Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Error 404, file not found."); + return newFixedLengthResponse(Response.Status.NOT_FOUND, NanoHTTPD.MIME_PLAINTEXT, "Error 404, file not " + + "found."); } protected String listDirectory(String uri, File f) { String heading = "Directory " + uri; StringBuilder msg = - new StringBuilder("