Drop visibility on some fields and classes

As suggested by Android Studio.
This commit is contained in:
Daniel Martí 2016-02-01 15:02:26 +00:00
parent 7f78b46664
commit ff3cd9fb11
19 changed files with 45 additions and 46 deletions

View File

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="org.fdroid.fdroid" package="org.fdroid.fdroid"
android:installLocation="auto" android:installLocation="auto"
android:versionCode="99000" android:versionCode="99000"

View File

@ -23,7 +23,7 @@ import java.util.Arrays;
import java.util.List; import java.util.List;
public class FDroidCertPins { public class FDroidCertPins {
public static final String[] DEFAULT_PINS = { private static final String[] DEFAULT_PINS = {
// OU=PositiveSSL, CN=f-droid.org // OU=PositiveSSL, CN=f-droid.org
// Fingerprint: 84B91CDF2312CB9BA7F3BE803783302F8D8C299F // Fingerprint: 84B91CDF2312CB9BA7F3BE803783302F8D8C299F
@ -57,7 +57,7 @@ public class FDroidCertPins {
"87e3bf322427c1405d2736c381e01d1a71d4a039", "87e3bf322427c1405d2736c381e01d1a71d4a039",
}; };
public static List<String> pinList; private static List<String> pinList;
public static String[] getPinList() { public static String[] getPinList() {
if (pinList == null) { if (pinList == null) {

View File

@ -11,12 +11,12 @@ import java.io.InputStream;
public class ProgressBufferedInputStream extends BufferedInputStream { public class ProgressBufferedInputStream extends BufferedInputStream {
private static final String TAG = "ProgressBufferedInputSt"; private static final String TAG = "ProgressBufferedInputSt";
final Repo repo; private final Repo repo;
final ProgressListener progressListener; private final ProgressListener progressListener;
final Bundle data; private final Bundle data;
final int totalBytes; private final int totalBytes;
int currentBytes; private int currentBytes;
/** /**
* Reports progress to the specified {@link ProgressListener}, with the * Reports progress to the specified {@link ProgressListener}, with the

View File

@ -312,7 +312,7 @@ public class UpdateService extends IntentService implements ProgressListener {
/** /**
* If we are to update the repos only on wifi, make sure that connection is active * If we are to update the repos only on wifi, make sure that connection is active
*/ */
public static boolean isNetworkAvailableForUpdate(Context context) { private static boolean isNetworkAvailableForUpdate(Context context) {
ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE); ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
// this could be cellular or wifi // this could be cellular or wifi

View File

@ -359,7 +359,7 @@ public final class Utils {
} }
} }
public static String calcFingerprint(byte[] key) { private static String calcFingerprint(byte[] key) {
if (key == null) if (key == null)
return null; return null;
if (key.length < 256) { if (key.length < 256) {
@ -545,7 +545,7 @@ public final class Utils {
* @param bytes an array of bytes. * @param bytes an array of bytes.
* @return the bytes represented as a string of hexadecimal digits. * @return the bytes represented as a string of hexadecimal digits.
*/ */
public static String toHexString(byte[] bytes) { private static String toHexString(byte[] bytes) {
BigInteger bi = new BigInteger(1, bytes); BigInteger bi = new BigInteger(1, bytes);
return String.format("%0" + (bytes.length << 1) + "X", bi); return String.format("%0" + (bytes.length << 1) + "X", bi);
} }

View File

@ -23,7 +23,7 @@ class HoneycombClipboard extends ClipboardCompat {
private final ClipboardManager manager; private final ClipboardManager manager;
protected HoneycombClipboard(Context context) { HoneycombClipboard(Context context) {
this.manager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); this.manager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);
} }

View File

@ -239,7 +239,7 @@ public class ApkProvider extends FDroidProvider {
private static final UriMatcher matcher = new UriMatcher(-1); private static final UriMatcher matcher = new UriMatcher(-1);
public static final Map<String, String> REPO_FIELDS = new HashMap<>(); private static final Map<String, String> REPO_FIELDS = new HashMap<>();
static { static {
REPO_FIELDS.put(DataColumns.REPO_VERSION, RepoProvider.DataColumns.VERSION); REPO_FIELDS.put(DataColumns.REPO_VERSION, RepoProvider.DataColumns.VERSION);

View File

@ -125,7 +125,7 @@ public abstract class FDroidProvider extends ContentProvider {
} }
@TargetApi(11) @TargetApi(11)
protected Set<String> getKeySet(ContentValues values) { private Set<String> getKeySet(ContentValues values) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
return values.keySet(); return values.keySet();

View File

@ -2,7 +2,7 @@ package org.fdroid.fdroid.data;
import android.database.Cursor; import android.database.Cursor;
public class ValueObject { class ValueObject {
protected void checkCursorPosition(Cursor cursor) throws IllegalArgumentException { protected void checkCursorPosition(Cursor cursor) throws IllegalArgumentException {
if (cursor.getPosition() == -1) { if (cursor.getPosition() == -1) {

View File

@ -81,15 +81,15 @@ public final class LocalRepoManager {
private final Map<String, App> apps = new HashMap<>(); private final Map<String, App> apps = new HashMap<>();
public final SanitizedFile xmlIndex; private final SanitizedFile xmlIndex;
private final SanitizedFile xmlIndexJar; private final SanitizedFile xmlIndexJar;
private final SanitizedFile xmlIndexJarUnsigned; private final SanitizedFile xmlIndexJarUnsigned;
public final SanitizedFile webRoot; private final SanitizedFile webRoot;
public final SanitizedFile fdroidDir; private final SanitizedFile fdroidDir;
public final SanitizedFile fdroidDirCaps; private final SanitizedFile fdroidDirCaps;
public final SanitizedFile repoDir; private final SanitizedFile repoDir;
public final SanitizedFile repoDirCaps; private final SanitizedFile repoDirCaps;
public final SanitizedFile iconsDir; private final SanitizedFile iconsDir;
@Nullable @Nullable
private static LocalRepoManager localRepoManager; private static LocalRepoManager localRepoManager;
@ -243,7 +243,7 @@ public final class LocalRepoManager {
copyApksToRepo(new ArrayList<>(apps.keySet())); copyApksToRepo(new ArrayList<>(apps.keySet()));
} }
public void copyApksToRepo(List<String> appsToCopy) { private void copyApksToRepo(List<String> appsToCopy) {
for (final String packageName : appsToCopy) { for (final String packageName : appsToCopy) {
final App app = apps.get(packageName); final App app = apps.get(packageName);
@ -294,7 +294,7 @@ public final class LocalRepoManager {
/** /**
* Extracts the icon from an APK and writes it to the repo as a PNG * Extracts the icon from an APK and writes it to the repo as a PNG
*/ */
public void copyIconToRepo(Drawable drawable, String packageName, int versionCode) { private void copyIconToRepo(Drawable drawable, String packageName, int versionCode) {
Bitmap bitmap; Bitmap bitmap;
if (drawable instanceof BitmapDrawable) { if (drawable instanceof BitmapDrawable) {
bitmap = ((BitmapDrawable) drawable).getBitmap(); bitmap = ((BitmapDrawable) drawable).getBitmap();

View File

@ -78,7 +78,7 @@ public abstract class SwapType {
}.start(); }.start();
} }
public void ensureRunning() { private void ensureRunning() {
if (!isConnected()) { if (!isConnected()) {
start(); start();
} }

View File

@ -68,7 +68,7 @@ public class DownloaderFactory {
return "bluetooth".equalsIgnoreCase(url.getProtocol()); return "bluetooth".equalsIgnoreCase(url.getProtocol());
} }
static boolean isLocalFile(URL url) { private static boolean isLocalFile(URL url) {
return "file".equalsIgnoreCase(url.getProtocol()); return "file".equalsIgnoreCase(url.getProtocol());
} }
@ -89,7 +89,7 @@ public class DownloaderFactory {
return new AsyncDownloadWrapper(create(context, url, destFile, credentials), listener); return new AsyncDownloadWrapper(create(context, url, destFile, credentials), listener);
} }
static boolean isOnionAddress(URL url) { private static boolean isOnionAddress(URL url) {
return url.getHost().endsWith(".onion"); return url.getHost().endsWith(".onion");
} }

View File

@ -81,7 +81,7 @@ public class HttpDownloader extends Downloader {
} }
} }
boolean isSwapUrl() { private boolean isSwapUrl() {
String host = sourceUrl.getHost(); String host = sourceUrl.getHost();
return sourceUrl.getPort() > 1023 // only root can use <= 1023, so never a swap repo return sourceUrl.getPort() > 1023 // only root can use <= 1023, so never a swap repo
&& host.matches("[0-9.]+") // host must be an IP address && host.matches("[0-9.]+") // host must be an IP address

View File

@ -18,7 +18,7 @@ public class BluetoothConnection {
private InputStream input; private InputStream input;
private OutputStream output; private OutputStream output;
protected final BluetoothSocket socket; private final BluetoothSocket socket;
public BluetoothConnection(BluetoothSocket socket) throws IOException { public BluetoothConnection(BluetoothSocket socket) throws IOException {
this.socket = socket; this.socket = socket;

View File

@ -1,12 +1,12 @@
package org.fdroid.fdroid.net.bluetooth; package org.fdroid.fdroid.net.bluetooth;
public class UnexpectedResponseException extends Exception { class UnexpectedResponseException extends Exception {
public UnexpectedResponseException(String message) { UnexpectedResponseException(String message) {
super(message); super(message);
} }
public UnexpectedResponseException(String message, Throwable cause) { UnexpectedResponseException(String message, Throwable cause) {
super("Unexpected response from Bluetooth server: '" + message + "'", cause); super("Unexpected response from Bluetooth server: '" + message + "'", cause);
} }
} }

View File

@ -47,16 +47,16 @@ public class InstallConfirmActivity extends Activity implements OnCancelListener
private Intent intent; private Intent intent;
PackageManager mPm; private PackageManager mPm;
AppDiff mAppDiff; private AppDiff mAppDiff;
// View for install progress // View for install progress
View mInstallConfirm; private View mInstallConfirm;
// Buttons to indicate user acceptance // Buttons to indicate user acceptance
private Button mOk; private Button mOk;
private Button mCancel; private Button mCancel;
CaffeinatedScrollView mScrollView; private CaffeinatedScrollView mScrollView;
private boolean mOkCanInstall; private boolean mOkCanInstall;
private static final String TAB_ID_ALL = "all"; private static final String TAB_ID_ALL = "all";

View File

@ -41,7 +41,7 @@ import java.util.List;
* care of switch to the correct paged in the ViewPager whenever the selected * care of switch to the correct paged in the ViewPager whenever the selected
* tab changes. * tab changes.
*/ */
public class TabsAdapter extends PagerAdapter class TabsAdapter extends PagerAdapter
implements TabHost.OnTabChangeListener, ViewPager.OnPageChangeListener { implements TabHost.OnTabChangeListener, ViewPager.OnPageChangeListener {
private final Context mContext; private final Context mContext;
private final TabHost mTabHost; private final TabHost mTabHost;
@ -66,7 +66,7 @@ public class TabsAdapter extends PagerAdapter
} }
} }
public TabsAdapter(Activity activity, TabHost tabHost, ViewPager pager) { TabsAdapter(Activity activity, TabHost tabHost, ViewPager pager) {
mContext = activity; mContext = activity;
mTabHost = tabHost; mTabHost = tabHost;
mViewPager = pager; mViewPager = pager;

View File

@ -135,7 +135,7 @@ public abstract class AppListFragment extends ListFragment implements
* it automatically again, because the repos or internet connection may * it automatically again, because the repos or internet connection may
* be bad. * be bad.
*/ */
public boolean updateEmptyRepos() { private boolean updateEmptyRepos() {
final String triedEmptyUpdate = "triedEmptyUpdate"; final String triedEmptyUpdate = "triedEmptyUpdate";
SharedPreferences prefs = getActivity().getPreferences(Context.MODE_PRIVATE); SharedPreferences prefs = getActivity().getPreferences(Context.MODE_PRIVATE);
boolean hasTriedEmptyUpdate = prefs.getBoolean(triedEmptyUpdate, false); boolean hasTriedEmptyUpdate = prefs.getBoolean(triedEmptyUpdate, false);

View File

@ -49,22 +49,22 @@ public class PreferencesFragment extends PreferenceFragment
addPreferencesFromResource(R.xml.preferences); addPreferencesFromResource(R.xml.preferences);
} }
protected void checkSummary(String key, int resId) { private void checkSummary(String key, int resId) {
CheckBoxPreference pref = (CheckBoxPreference) findPreference(key); CheckBoxPreference pref = (CheckBoxPreference) findPreference(key);
pref.setSummary(resId); pref.setSummary(resId);
} }
protected void entrySummary(String key) { private void entrySummary(String key) {
ListPreference pref = (ListPreference) findPreference(key); ListPreference pref = (ListPreference) findPreference(key);
pref.setSummary(pref.getEntry()); pref.setSummary(pref.getEntry());
} }
protected void textSummary(String key, int resId) { private void textSummary(String key, int resId) {
EditTextPreference pref = (EditTextPreference) findPreference(key); EditTextPreference pref = (EditTextPreference) findPreference(key);
pref.setSummary(getString(resId, pref.getText())); pref.setSummary(getString(resId, pref.getText()));
} }
protected void updateSummary(String key, boolean changing) { private void updateSummary(String key, boolean changing) {
int result = 0; int result = 0;
@ -174,7 +174,7 @@ public class PreferencesFragment extends PreferenceFragment
/** /**
* Initializes SystemInstaller preference, which can only be enabled when F-Droid is installed as a system-app * Initializes SystemInstaller preference, which can only be enabled when F-Droid is installed as a system-app
*/ */
protected void initPrivilegedInstallerPreference() { private void initPrivilegedInstallerPreference() {
CheckBoxPreference pref = (CheckBoxPreference) findPreference(Preferences.PREF_PRIVILEGED_INSTALLER); CheckBoxPreference pref = (CheckBoxPreference) findPreference(Preferences.PREF_PRIVILEGED_INSTALLER);
// we are handling persistence ourself! // we are handling persistence ourself!
@ -246,7 +246,7 @@ public class PreferencesFragment extends PreferenceFragment
}); });
} }
protected void initManagePrivilegedAppPreference() { private void initManagePrivilegedAppPreference() {
Preference pref = findPreference(Preferences.PREF_UNINSTALL_PRIVILEGED_APP); Preference pref = findPreference(Preferences.PREF_UNINSTALL_PRIVILEGED_APP);
pref.setPersistent(false); pref.setPersistent(false);