reformat localrepo code in using Android Studio Ctrl-Alt-L

This commit is contained in:
Hans-Christoph Steiner 2018-04-11 11:24:11 +02:00
parent 00cfaa572f
commit af509e431e
4 changed files with 34 additions and 37 deletions

View File

@ -5,7 +5,6 @@ import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.content.pm.ApplicationInfo; import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import org.apache.commons.io.FileUtils; import org.apache.commons.io.FileUtils;
import org.fdroid.fdroid.FDroidApp; import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;

View File

@ -2,7 +2,7 @@ package org.fdroid.fdroid.localrepo;
import android.content.Context; import android.content.Context;
import android.util.Log; import android.util.Log;
import kellinwood.security.zipsigner.ZipSigner;
import org.fdroid.fdroid.FDroidApp; import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Utils; import org.fdroid.fdroid.Utils;
import org.spongycastle.asn1.ASN1Sequence; import org.spongycastle.asn1.ASN1Sequence;
@ -19,6 +19,9 @@ import org.spongycastle.operator.ContentSigner;
import org.spongycastle.operator.OperatorCreationException; import org.spongycastle.operator.OperatorCreationException;
import org.spongycastle.operator.jcajce.JcaContentSignerBuilder; import org.spongycastle.operator.jcajce.JcaContentSignerBuilder;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.X509KeyManager;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileOutputStream; import java.io.FileOutputStream;
@ -46,12 +49,6 @@ import java.util.Date;
import java.util.GregorianCalendar; import java.util.GregorianCalendar;
import java.util.Locale; import java.util.Locale;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;
import javax.net.ssl.X509KeyManager;
import kellinwood.security.zipsigner.ZipSigner;
// TODO Address exception handling in a uniform way throughout // TODO Address exception handling in a uniform way throughout
@SuppressWarnings("LineLength") @SuppressWarnings("LineLength")

View File

@ -14,7 +14,6 @@ import android.support.annotation.NonNull;
import android.support.annotation.Nullable; import android.support.annotation.Nullable;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import org.fdroid.fdroid.FDroidApp; import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Hasher; import org.fdroid.fdroid.Hasher;
import org.fdroid.fdroid.Preferences; import org.fdroid.fdroid.Preferences;

View File

@ -20,7 +20,6 @@ import android.support.v4.app.NotificationCompat;
import android.support.v4.content.LocalBroadcastManager; import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import org.apache.http.HttpHost; import org.apache.http.HttpHost;
import org.apache.http.NameValuePair; import org.apache.http.NameValuePair;
import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.entity.UrlEncodedFormEntity;
@ -42,6 +41,10 @@ import org.fdroid.fdroid.localrepo.type.SwapType;
import org.fdroid.fdroid.localrepo.type.WifiSwap; import org.fdroid.fdroid.localrepo.type.WifiSwap;
import org.fdroid.fdroid.net.WifiStateChangeService; import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.views.swap.SwapWorkflowActivity; import org.fdroid.fdroid.views.swap.SwapWorkflowActivity;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
import java.io.IOException; import java.io.IOException;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
@ -56,11 +59,6 @@ import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentHashMap;
import rx.Observable;
import rx.Subscription;
import rx.android.schedulers.AndroidSchedulers;
import rx.schedulers.Schedulers;
/** /**
* Central service which manages all of the different moving parts of swap which are required * Central service which manages all of the different moving parts of swap which are required
* to enable p2p swapping of apps. * to enable p2p swapping of apps.
@ -115,10 +113,10 @@ public class SwapService extends Service {
* Call {@link Observable#subscribe()} on this in order to be notified of peers * Call {@link Observable#subscribe()} on this in order to be notified of peers
* which are found. Call {@link Subscription#unsubscribe()} on the resulting * which are found. Call {@link Subscription#unsubscribe()} on the resulting
* subscription when finished and you no longer want to scan for peers. * subscription when finished and you no longer want to scan for peers.
* * <p>
* The returned object will scan for peers on a background thread, and emit * The returned object will scan for peers on a background thread, and emit
* found peers on the mian thread. * found peers on the mian thread.
* * <p>
* Invoking this in multiple places will return the same, cached, peer finder. * Invoking this in multiple places will return the same, cached, peer finder.
* That is, if in the past it already found some peers, then you subscribe * That is, if in the past it already found some peers, then you subscribe
* to it in the future, the future subscriber will still receive the peers * to it in the future, the future subscriber will still receive the peers
@ -158,7 +156,8 @@ public class SwapService extends Service {
*/ */
public static final int STEP_INITIAL_LOADING = 9; public static final int STEP_INITIAL_LOADING = 9;
@SwapStep private int step = STEP_INTRO; @SwapStep
private int step = STEP_INTRO;
/** /**
* Current screen that the swap process is up to. * Current screen that the swap process is up to.
@ -174,7 +173,8 @@ public class SwapService extends Service {
return this; return this;
} }
@NonNull public Set<String> getAppsToSwap() { @NonNull
public Set<String> getAppsToSwap() {
return appsToSwap; return appsToSwap;
} }
@ -301,7 +301,8 @@ public class SwapService extends Service {
@IntDef({STEP_INTRO, STEP_SELECT_APPS, STEP_JOIN_WIFI, STEP_SHOW_NFC, STEP_WIFI_QR, @IntDef({STEP_INTRO, STEP_SELECT_APPS, STEP_JOIN_WIFI, STEP_SHOW_NFC, STEP_WIFI_QR,
STEP_CONNECTING, STEP_SUCCESS, STEP_CONFIRM_SWAP, STEP_INITIAL_LOADING}) STEP_CONNECTING, STEP_SUCCESS, STEP_CONFIRM_SWAP, STEP_INITIAL_LOADING})
@Retention(RetentionPolicy.SOURCE) @Retention(RetentionPolicy.SOURCE)
public @interface SwapStep { } public @interface SwapStep {
}
// ================================================= // =================================================
// Have selected a specific peer to swap with // Have selected a specific peer to swap with
@ -340,6 +341,7 @@ public class SwapService extends Service {
* which is only available in API >= 11. * which is only available in API >= 11.
* Package names are reverse-DNS-style, so they should only have alpha numeric values. Thus, * Package names are reverse-DNS-style, so they should only have alpha numeric values. Thus,
* this uses a comma as the separator. * this uses a comma as the separator.
*
* @see SwapService#deserializePackages(String) * @see SwapService#deserializePackages(String)
*/ */
private static String serializePackages(Set<String> packages) { private static String serializePackages(Set<String> packages) {