Merge branch 'great-package-reorg' into 'master'

move classes into packages for "nearby" and "panic"

See merge request fdroid/fdroidclient!829
This commit is contained in:
Hans-Christoph Steiner 2019-06-17 11:59:22 +00:00
commit 474073b48c
80 changed files with 160 additions and 194 deletions

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.support.test.InstrumentationRegistry;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.BroadcastReceiver;
import android.content.Context;

View File

@ -23,10 +23,10 @@ import org.fdroid.fdroid.data.AppProvider;
import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.data.RepoProvider;
import org.fdroid.fdroid.data.Schema;
import org.fdroid.fdroid.localrepo.LocalRepoKeyStore;
import org.fdroid.fdroid.localrepo.LocalRepoManager;
import org.fdroid.fdroid.localrepo.LocalRepoService;
import org.fdroid.fdroid.net.LocalHTTPD;
import org.fdroid.fdroid.nearby.LocalHTTPD;
import org.fdroid.fdroid.nearby.LocalRepoKeyStore;
import org.fdroid.fdroid.nearby.LocalRepoManager;
import org.fdroid.fdroid.nearby.LocalRepoService;
import org.junit.Test;
import java.io.File;
@ -52,7 +52,7 @@ public class SwapRepoEmulatorTest {
public static final String TAG = "SwapRepoEmulatorTest";
/**
* @see org.fdroid.fdroid.net.WifiStateChangeService.WifiInfoThread#run()
* @see org.fdroid.fdroid.nearby.WifiStateChangeService.WifiInfoThread#run()
*/
@Test
public void testSwap()

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.net.bluetooth;
package org.fdroid.fdroid.nearby;
/**
* Dummy version for basic app flavor.

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.views.swap;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.net.Uri;
@ -26,8 +26,9 @@ import android.net.Uri;
* Dummy version for basic app flavor.
*/
public class SwapWorkflowActivity {
public static final String EXTRA_PREVENT_FURTHER_SWAP_REQUESTS = "preventFurtherSwap";
public static final String EXTRA_CONFIRM = "EXTRA_CONFIRM";
public static void requestSwap(Context context, Uri uri) {
};
}
}

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.net;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.content.Intent;

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.localrepo.peers;
package org.fdroid.fdroid.nearby.peers;
import org.fdroid.fdroid.data.NewRepoConfig;

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.views.hiding;
package org.fdroid.fdroid.panic;
import android.content.Context;

View File

@ -50,7 +50,7 @@
<activity
android:label="@string/swap"
android:name=".views.swap.SwapWorkflowActivity"
android:name=".nearby.SwapWorkflowActivity"
android:parentActivityName=".views.main.MainActivity"
android:launchMode="singleTask"
android:theme="@style/SwapTheme.Wizard"
@ -61,7 +61,7 @@
android:value=".views.main.MainActivity"/>
</activity>
<receiver android:name=".receiver.WifiStateChangeReceiver">
<receiver android:name=".nearby.WifiStateChangeReceiver">
<intent-filter>
<action android:name="android.net.wifi.STATE_CHANGE"/>
</intent-filter>
@ -74,23 +74,23 @@
</receiver>
<service
android:name=".net.WifiStateChangeService"
android:name=".nearby.WifiStateChangeService"
android:exported="false"/>
<service android:name=".localrepo.SwapService"/>
<service android:name=".nearby.SwapService"/>
<service android:name=".localrepo.LocalHTTPDManager"/>
<service android:name=".nearby.LocalHTTPDManager"/>
<service
android:name=".localrepo.LocalRepoService"
android:name=".nearby.LocalRepoService"
android:exported="false"/>
<service
android:name=".localrepo.TreeUriScannerIntentService"
android:name=".nearby.TreeUriScannerIntentService"
android:exported="false"/>
<service
android:name=".localrepo.SDCardScannerService"
android:name=".nearby.SDCardScannerService"
android:exported="false"/>
<activity
android:name=".views.panic.PanicPreferencesActivity"
android:name=".panic.PanicPreferencesActivity"
android:label="@string/panic_settings"
android:parentActivityName=".views.main.MainActivity">
<meta-data
@ -105,11 +105,11 @@
</intent-filter>
</activity>
<activity
android:name=".views.panic.SelectInstalledAppsActivity"
android:parentActivityName=".views.panic.PanicPreferencesActivity"/>
android:name=".panic.SelectInstalledAppsActivity"
android:parentActivityName=".panic.PanicPreferencesActivity"/>
<activity
android:name=".views.panic.PanicResponderActivity"
android:name=".panic.PanicResponderActivity"
android:noHistory="true"
android:theme="@android:style/Theme.NoDisplay">
@ -121,10 +121,10 @@
</intent-filter>
</activity>
<activity
android:name=".views.panic.ExitActivity"
android:name=".panic.ExitActivity"
android:theme="@android:style/Theme.NoDisplay"/>
<activity
android:name=".views.hiding.CalculatorActivity"
android:name=".panic.CalculatorActivity"
android:enabled="false"
android:icon="@mipmap/ic_calculator_launcher"
android:label="@string/hiding_calculator"

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net.bluetooth;
package org.fdroid.fdroid.nearby;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
@ -15,8 +15,7 @@ import android.text.TextUtils;
import android.util.Log;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.localrepo.peers.BluetoothPeer;
import org.fdroid.fdroid.net.bluetooth.BluetoothServer;
import org.fdroid.fdroid.nearby.peers.BluetoothPeer;
import java.lang.ref.WeakReference;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net.bluetooth;
package org.fdroid.fdroid.nearby;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothServerSocket;
@ -7,8 +7,8 @@ import android.util.Log;
import android.webkit.MimeTypeMap;
import fi.iki.elonen.NanoHTTPD;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.net.bluetooth.httpish.Request;
import org.fdroid.fdroid.net.bluetooth.httpish.Response;
import org.fdroid.fdroid.nearby.httpish.Request;
import org.fdroid.fdroid.nearby.httpish.Response;
import java.io.File;
import java.io.FileInputStream;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.content.Intent;
@ -13,7 +13,7 @@ import android.util.Log;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.localrepo.peers.BonjourPeer;
import org.fdroid.fdroid.nearby.peers.BonjourPeer;
import javax.jmdns.JmDNS;
import javax.jmdns.ServiceEvent;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net;
package org.fdroid.fdroid.nearby;
/*
* #%L
@ -38,8 +38,6 @@ import android.net.Uri;
import fi.iki.elonen.NanoHTTPD;
import fi.iki.elonen.NanoHTTPD.Response.IStatus;
import org.fdroid.fdroid.BuildConfig;
import org.fdroid.fdroid.localrepo.LocalRepoKeyStore;
import org.fdroid.fdroid.views.swap.SwapWorkflowActivity;
import javax.net.ssl.SSLServerSocketFactory;
import java.io.File;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.content.Intent;
@ -10,8 +10,6 @@ import android.support.v4.content.LocalBroadcastManager;
import android.util.Log;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.net.LocalHTTPD;
import org.fdroid.fdroid.net.WifiStateChangeService;
import java.io.IOException;
import java.net.BindException;

View File

@ -1,10 +1,8 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.util.Log;
import kellinwood.security.zipsigner.ZipSigner;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Utils;
import org.bouncycastle.asn1.ASN1Sequence;
import org.bouncycastle.asn1.x500.X500Name;
import org.bouncycastle.asn1.x509.GeneralName;
@ -18,6 +16,8 @@ import org.bouncycastle.cert.jcajce.JcaX509CertificateConverter;
import org.bouncycastle.operator.ContentSigner;
import org.bouncycastle.operator.OperatorCreationException;
import org.bouncycastle.operator.jcajce.JcaContentSignerBuilder;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.Utils;
import javax.net.ssl.KeyManager;
import javax.net.ssl.KeyManagerFactory;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.content.pm.ApplicationInfo;
@ -386,7 +386,7 @@ public final class LocalRepoManager {
}
/**
* Alias for {@link org.fdroid.fdroid.localrepo.LocalRepoManager.IndexXmlBuilder#tag(String, String)}
* Alias for {@link org.fdroid.fdroid.nearby.LocalRepoManager.IndexXmlBuilder#tag(String, String)}
* That accepts a number instead of string.
*
* @see IndexXmlBuilder#tag(String, String)
@ -396,7 +396,7 @@ public final class LocalRepoManager {
}
/**
* Alias for {@link org.fdroid.fdroid.localrepo.LocalRepoManager.IndexXmlBuilder#tag(String, String)}
* Alias for {@link org.fdroid.fdroid.nearby.LocalRepoManager.IndexXmlBuilder#tag(String, String)}
* that accepts a date instead of a string.
*
* @see IndexXmlBuilder#tag(String, String)

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.app.IntentService;
import android.content.Context;
@ -29,8 +29,8 @@ import java.util.Set;
public class LocalRepoService extends IntentService {
public static final String TAG = "LocalRepoService";
public static final String ACTION_CREATE = "org.fdroid.fdroid.localrepo.action.CREATE";
public static final String EXTRA_PACKAGE_NAMES = "org.fdroid.fdroid.localrepo.extra.PACKAGE_NAMES";
public static final String ACTION_CREATE = "org.fdroid.fdroid.nearby.action.CREATE";
public static final String EXTRA_PACKAGE_NAMES = "org.fdroid.fdroid.nearby.extra.PACKAGE_NAMES";
public static final String ACTION_STATUS = "localRepoStatusAction";
public static final String EXTRA_STATUS = "localRepoStatusExtra";

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.Manifest;
import android.app.IntentService;
@ -66,7 +66,7 @@ import java.util.List;
public class SDCardScannerService extends IntentService {
public static final String TAG = "SDCardScannerService";
private static final String ACTION_SCAN = "org.fdroid.fdroid.localrepo.SCAN";
private static final String ACTION_SCAN = "org.fdroid.fdroid.nearby.SCAN";
private static final List<String> SKIP_DIRS = Arrays.asList(".android_secure", "LOST.DIR");

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.swap;
package org.fdroid.fdroid.nearby;
import android.annotation.TargetApi;
import android.content.Context;
@ -29,8 +29,6 @@ import android.widget.TextView;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.data.InstalledAppProvider;
import org.fdroid.fdroid.data.Schema.InstalledAppTable;
import org.fdroid.fdroid.localrepo.LocalRepoService;
import org.fdroid.fdroid.localrepo.SwapView;
public class SelectAppsView extends SwapView implements LoaderManager.LoaderCallbacks<Cursor> {

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.swap;
package org.fdroid.fdroid.nearby;
import android.annotation.TargetApi;
import android.bluetooth.BluetoothAdapter;
@ -26,11 +26,7 @@ import cc.mvdan.accesspoint.WifiApControl;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.localrepo.BluetoothManager;
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.localrepo.SwapView;
import org.fdroid.fdroid.localrepo.peers.Peer;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.nearby.peers.Peer;
import java.util.ArrayList;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.annotation.SuppressLint;
import android.app.Notification;
@ -31,10 +31,8 @@ import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.data.RepoProvider;
import org.fdroid.fdroid.data.Schema;
import org.fdroid.fdroid.localrepo.peers.Peer;
import org.fdroid.fdroid.nearby.peers.Peer;
import org.fdroid.fdroid.net.Downloader;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.views.swap.SwapWorkflowActivity;
import java.io.IOException;
import java.io.OutputStream;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.swap;
package org.fdroid.fdroid.nearby;
import android.annotation.TargetApi;
import android.app.Activity;
@ -43,7 +43,6 @@ import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.data.Schema.AppMetadataTable;
import org.fdroid.fdroid.installer.InstallManagerService;
import org.fdroid.fdroid.installer.Installer;
import org.fdroid.fdroid.localrepo.SwapView;
import org.fdroid.fdroid.net.Downloader;
import org.fdroid.fdroid.net.DownloaderService;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.annotation.TargetApi;
import android.content.Context;
@ -8,7 +8,6 @@ import android.support.annotation.LayoutRes;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.views.swap.SwapWorkflowActivity;
/**
* A {@link android.view.View} that registers to handle the swap events from

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.swap;
package org.fdroid.fdroid.nearby;
import android.annotation.TargetApi;
import android.app.Activity;
@ -58,18 +58,11 @@ import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.NewRepoConfig;
import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.data.RepoProvider;
import org.fdroid.fdroid.localrepo.BluetoothManager;
import org.fdroid.fdroid.localrepo.BonjourManager;
import org.fdroid.fdroid.localrepo.LocalHTTPDManager;
import org.fdroid.fdroid.localrepo.LocalRepoService;
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.localrepo.SwapView;
import org.fdroid.fdroid.localrepo.peers.BluetoothPeer;
import org.fdroid.fdroid.localrepo.peers.Peer;
import org.fdroid.fdroid.nearby.peers.BluetoothPeer;
import org.fdroid.fdroid.nearby.peers.Peer;
import org.fdroid.fdroid.net.BluetoothDownloader;
import org.fdroid.fdroid.net.Downloader;
import org.fdroid.fdroid.net.HttpDownloader;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.qr.CameraCharacteristicsChecker;
import org.fdroid.fdroid.qr.QrGenAsyncTask;
import org.fdroid.fdroid.views.main.MainActivity;

View File

@ -17,7 +17,7 @@
* MA 02110-1301, USA.
*/
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.annotation.TargetApi;
import android.app.IntentService;
@ -66,7 +66,7 @@ import java.util.jar.JarInputStream;
public class TreeUriScannerIntentService extends IntentService {
public static final String TAG = "TreeUriScannerIntentSer";
private static final String ACTION_SCAN_TREE_URI = "org.fdroid.fdroid.localrepo.action.SCAN_TREE_URI";
private static final String ACTION_SCAN_TREE_URI = "org.fdroid.fdroid.nearby.action.SCAN_TREE_URI";
public TreeUriScannerIntentService() {
super("TreeUriScannerIntentService");

View File

@ -1,11 +1,10 @@
package org.fdroid.fdroid.receiver;
package org.fdroid.fdroid.nearby;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.wifi.WifiManager;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.net.WifiStateChangeService;
public class WifiStateChangeReceiver extends BroadcastReceiver {
private static final String TAG = "WifiStateChangeReceiver";

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net;
package org.fdroid.fdroid.nearby;
import android.app.IntentService;
import android.content.ComponentName;
@ -23,8 +23,6 @@ import org.fdroid.fdroid.R;
import org.fdroid.fdroid.UpdateService;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.localrepo.LocalRepoKeyStore;
import org.fdroid.fdroid.localrepo.LocalRepoManager;
import java.net.Inet6Address;
import java.net.InetAddress;
@ -39,7 +37,7 @@ import java.util.Locale;
* Handle state changes to the device's wifi, storing the required bits.
* The {@link Intent} that starts it either has no extras included,
* which is how it can be triggered by code, or it came in from the system
* via {@link org.fdroid.fdroid.receiver.WifiStateChangeReceiver}, in
* via {@link WifiStateChangeReceiver}, in
* which case an instance of {@link NetworkInfo} is included.
* <p>
* The work is done in a {@link Thread} so that new incoming {@code Intents}
@ -280,7 +278,7 @@ public class WifiStateChangeService extends IntentService {
while (networkInterfaces.hasMoreElements()) {
NetworkInterface netIf = networkInterfaces.nextElement();
for (Enumeration<InetAddress> inetAddresses = netIf.getInetAddresses(); inetAddresses.hasMoreElements();) {
for (Enumeration<InetAddress> inetAddresses = netIf.getInetAddresses(); inetAddresses.hasMoreElements(); ) {
InetAddress inetAddress = inetAddresses.nextElement();
if (inetAddress.isLoopbackAddress() || inetAddress instanceof Inet6Address) {
continue;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo.peers;
package org.fdroid.fdroid.nearby.peers;
import android.bluetooth.BluetoothClass.Device;
import android.bluetooth.BluetoothDevice;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo.peers;
package org.fdroid.fdroid.nearby.peers;
import android.net.Uri;
import android.os.Parcel;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo.peers;
package org.fdroid.fdroid.nearby.peers;
import android.os.Parcelable;
import android.support.annotation.DrawableRes;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo.peers;
package org.fdroid.fdroid.nearby.peers;
import android.net.Uri;
import android.os.Parcel;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.hiding;
package org.fdroid.fdroid.panic;
import android.os.Bundle;
import android.support.annotation.Nullable;
@ -8,7 +8,6 @@ import android.view.View;
import android.widget.Button;
import android.widget.TextView;
import android.widget.Toast;
import org.fdroid.fdroid.R;
import java.util.regex.Pattern;
@ -28,7 +27,8 @@ public class CalculatorActivity extends AppCompatActivity {
// unary operators
private static final String PERCENT = "%";
private @Nullable String lastOp;
@Nullable
private String lastOp;
// views
private TextView textView;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.content.Context;
import android.content.res.Resources;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.content.Context;
import android.support.v7.preference.Preference;

View File

@ -1,10 +1,9 @@
package org.fdroid.fdroid.views.panic;
import android.support.v7.app.AppCompatActivity;
package org.fdroid.fdroid.panic;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
public class ExitActivity extends AppCompatActivity {

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.hiding;
package org.fdroid.fdroid.panic;
import android.content.ComponentName;
import android.content.Context;

View File

@ -1,11 +1,10 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import org.fdroid.fdroid.FDroidApp;
import org.fdroid.fdroid.R;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.app.Activity;
import android.content.ComponentName;
@ -29,7 +29,6 @@ import info.guardianproject.panic.PanicResponder;
import org.fdroid.fdroid.Preferences;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.installer.PrivilegedInstaller;
import org.fdroid.fdroid.views.hiding.HidingManager;
import java.util.ArrayList;
import java.util.Set;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.app.Activity;
import android.content.BroadcastReceiver;
@ -23,7 +23,6 @@ import org.fdroid.fdroid.data.Schema;
import org.fdroid.fdroid.installer.Installer;
import org.fdroid.fdroid.installer.InstallerService;
import org.fdroid.fdroid.installer.PrivilegedInstaller;
import org.fdroid.fdroid.views.hiding.HidingManager;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.app.Activity;
import android.support.annotation.NonNull;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.app.Activity;
import android.support.annotation.NonNull;

View File

@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import android.annotation.SuppressLint;
import android.content.res.Resources;

View File

@ -24,7 +24,7 @@ import org.fdroid.fdroid.data.Schema;
import org.fdroid.fdroid.views.apps.AppListActivity;
import org.fdroid.fdroid.views.categories.CategoryAdapter;
import org.fdroid.fdroid.views.categories.CategoryController;
import org.fdroid.fdroid.views.hiding.HidingManager;
import org.fdroid.fdroid.panic.HidingManager;
import java.util.ArrayList;
import java.util.Collections;

View File

@ -17,9 +17,9 @@ import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.localrepo.SDCardScannerService;
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.localrepo.TreeUriScannerIntentService;
import org.fdroid.fdroid.nearby.SDCardScannerService;
import org.fdroid.fdroid.nearby.SwapService;
import org.fdroid.fdroid.nearby.TreeUriScannerIntentService;
import java.io.File;
@ -48,7 +48,7 @@ import java.io.File;
* write access to the the removable storage.
*
* @see TreeUriScannerIntentService
* @see org.fdroid.fdroid.localrepo.SDCardScannerService
* @see org.fdroid.fdroid.nearby.SDCardScannerService
*/
class NearbyViewBinder {
public static final String TAG = "NearbyViewBinder";

View File

@ -4,7 +4,7 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".views.hiding.CalculatorActivity">
tools:context=".panic.CalculatorActivity">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"

View File

@ -14,7 +14,7 @@
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/fragment_container"
class="org.fdroid.fdroid.views.panic.PanicPreferencesFragment"
class="org.fdroid.fdroid.panic.PanicPreferencesFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.localrepo.SwapView
<org.fdroid.fdroid.nearby.SwapView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:swap="http://schemas.android.com/apk/res-auto"
@ -74,4 +74,4 @@
</LinearLayout>
</org.fdroid.fdroid.localrepo.SwapView>
</org.fdroid.fdroid.nearby.SwapView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.localrepo.SwapView
<org.fdroid.fdroid.nearby.SwapView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swap="http://schemas.android.com/apk/res-auto"
swap:toolbarColor="@color/swap_bright_blue"
@ -38,4 +38,4 @@
android:visibility="gone"
android:text="@string/try_again"/>
</org.fdroid.fdroid.localrepo.SwapView>
</org.fdroid.fdroid.nearby.SwapView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.localrepo.SwapView
<org.fdroid.fdroid.nearby.SwapView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:swap="http://schemas.android.com/apk/res-auto"
@ -9,7 +9,7 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/swap_blue"
tools:context=".views.swap.SwapWorkflowActivity">
tools:context=".nearby.SwapWorkflowActivity">
<TextView
android:layout_width="wrap_content"
@ -57,4 +57,4 @@
android:paddingBottom="20dp"/>
<!-- android:layout_above="@id/btn_learn_more_about_wifi" -->
</org.fdroid.fdroid.localrepo.SwapView>
</org.fdroid.fdroid.nearby.SwapView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.localrepo.SwapView
<org.fdroid.fdroid.nearby.SwapView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swap="http://schemas.android.com/apk/res-auto"
swap:toolbarTitle="@string/swap_nfc_title"
@ -35,4 +35,4 @@
android:layout_below="@+id/text_description"
android:layout_centerHorizontal="true"/>
</org.fdroid.fdroid.localrepo.SwapView>
</org.fdroid.fdroid.nearby.SwapView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.views.swap.SelectAppsView
<org.fdroid.fdroid.nearby.SelectAppsView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swap="http://schemas.android.com/apk/res-auto"
swap:toolbarColor="@color/swap_bright_blue"
@ -15,4 +15,4 @@
android:layout_height="match_parent"
android:orientation="vertical"/>
</org.fdroid.fdroid.views.swap.SelectAppsView>
</org.fdroid.fdroid.nearby.SelectAppsView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.localrepo.SwapView
<org.fdroid.fdroid.nearby.SwapView
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swap="http://schemas.android.com/apk/res-auto"
@ -50,4 +50,4 @@
</LinearLayout>
</ScrollView>
</org.fdroid.fdroid.localrepo.SwapView>
</org.fdroid.fdroid.nearby.SwapView>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.views.swap.StartSwapView
<org.fdroid.fdroid.nearby.StartSwapView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:swap="http://schemas.android.com/apk/res-auto"
@ -8,7 +8,7 @@
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".views.swap.SwapWorkflowActivity">
tools:context=".nearby.SwapWorkflowActivity">
<!-- Misc header -->
<include layout="@layout/start_swap_header"/>
@ -209,4 +209,4 @@
</ListView>
</org.fdroid.fdroid.views.swap.StartSwapView>
</org.fdroid.fdroid.nearby.StartSwapView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.views.swap.SwapSuccessView
<org.fdroid.fdroid.nearby.SwapSuccessView
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swap="http://schemas.android.com/apk/res-auto"
swap:toolbarColor="@color/swap_bright_blue"
@ -15,4 +15,4 @@
android:layout_height="match_parent"
android:orientation="vertical"/>
</org.fdroid.fdroid.views.swap.SwapSuccessView>
</org.fdroid.fdroid.nearby.SwapSuccessView>

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<org.fdroid.fdroid.localrepo.SwapView
<org.fdroid.fdroid.nearby.SwapView
xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:swap="http://schemas.android.com/apk/res-auto"
@ -57,4 +57,4 @@
</LinearLayout>
</ScrollView>
</org.fdroid.fdroid.localrepo.SwapView>
</org.fdroid.fdroid.nearby.SwapView>

View File

@ -21,8 +21,8 @@ import java.util.Locale;
/**
* Handles requests to add new repos via URLs. This is an {@code IntentService}
* so that requests are queued, which is necessary when either
* {@link org.fdroid.fdroid.localrepo.TreeUriScannerIntentService} or
* {@link org.fdroid.fdroid.localrepo.SDCardScannerService} finds multiple
* {@link org.fdroid.fdroid.nearby.TreeUriScannerIntentService} or
* {@link org.fdroid.fdroid.nearby.SDCardScannerService} finds multiple
* repos on a disk. This should hopefully also serve as the beginnings of
* a new architecture for handling these requests. This does all the
* processing first, up front, then only launches UI as needed.

View File

@ -70,13 +70,13 @@ import org.fdroid.fdroid.data.InstalledAppProviderService;
import org.fdroid.fdroid.data.Repo;
import org.fdroid.fdroid.installer.ApkFileProvider;
import org.fdroid.fdroid.installer.InstallHistoryService;
import org.fdroid.fdroid.localrepo.SDCardScannerService;
import org.fdroid.fdroid.nearby.SDCardScannerService;
import org.fdroid.fdroid.net.ConnectivityMonitorService;
import org.fdroid.fdroid.net.Downloader;
import org.fdroid.fdroid.net.HttpDownloader;
import org.fdroid.fdroid.net.ImageLoaderForUIL;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.views.hiding.HidingManager;
import org.fdroid.fdroid.nearby.WifiStateChangeService;
import org.fdroid.fdroid.panic.HidingManager;
import javax.microedition.khronos.opengles.GL10;
import java.io.IOException;
@ -234,7 +234,7 @@ public class FDroidApp extends Application {
/**
* Initialize the settings needed to run a local swap repo. This should
* only ever be called in {@link org.fdroid.fdroid.net.WifiStateChangeService.WifiInfoThread},
* only ever be called in {@link WifiStateChangeService.WifiInfoThread},
* after the single init call in {@link FDroidApp#onCreate()}.
*/
public static void initWifiSettings() {

View File

@ -7,8 +7,8 @@ import android.text.TextUtils;
import android.util.Log;
import org.fdroid.fdroid.R;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.localrepo.peers.WifiPeer;
import org.fdroid.fdroid.views.swap.SwapWorkflowActivity;
import org.fdroid.fdroid.nearby.peers.WifiPeer;
import org.fdroid.fdroid.nearby.SwapWorkflowActivity;
import java.util.Arrays;
import java.util.Locale;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net.bluetooth;
package org.fdroid.fdroid.nearby;
import android.bluetooth.BluetoothSocket;
import org.fdroid.fdroid.Utils;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net.bluetooth;
package org.fdroid.fdroid.nearby;
import java.util.UUID;

View File

@ -1,6 +1,4 @@
package org.fdroid.fdroid.net.bluetooth.httpish.headers;
import org.fdroid.fdroid.net.bluetooth.FileDetails;
package org.fdroid.fdroid.nearby.httpish;
public class ContentLengthHeader extends Header {

View File

@ -1,6 +1,4 @@
package org.fdroid.fdroid.net.bluetooth.httpish.headers;
import org.fdroid.fdroid.net.bluetooth.FileDetails;
package org.fdroid.fdroid.nearby.httpish;
public class ETagHeader extends Header {

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net.bluetooth;
package org.fdroid.fdroid.nearby.httpish;
public class FileDetails {
@ -13,11 +13,11 @@ public class FileDetails {
return fileSize;
}
public void setFileSize(int fileSize) {
void setFileSize(int fileSize) {
this.fileSize = fileSize;
}
public void setCacheTag(String cacheTag) {
void setCacheTag(String cacheTag) {
this.cacheTag = cacheTag;
}
}

View File

@ -1,14 +1,12 @@
package org.fdroid.fdroid.net.bluetooth.httpish.headers;
import org.fdroid.fdroid.net.bluetooth.FileDetails;
package org.fdroid.fdroid.nearby.httpish;
import java.util.Locale;
public abstract class Header {
private static final Header[] VALID_HEADERS = {
new ContentLengthHeader(),
new ETagHeader(),
new ContentLengthHeader(),
new ETagHeader(),
};
protected abstract String getName();

View File

@ -1,7 +1,7 @@
package org.fdroid.fdroid.net.bluetooth.httpish;
package org.fdroid.fdroid.nearby.httpish;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection;
import org.fdroid.fdroid.nearby.BluetoothConnection;
import java.io.ByteArrayOutputStream;
import java.io.IOException;

View File

@ -1,10 +1,8 @@
package org.fdroid.fdroid.net.bluetooth.httpish;
package org.fdroid.fdroid.nearby.httpish;
import android.util.Log;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection;
import org.fdroid.fdroid.net.bluetooth.FileDetails;
import org.fdroid.fdroid.net.bluetooth.httpish.headers.Header;
import org.fdroid.fdroid.nearby.BluetoothConnection;
import java.io.ByteArrayInputStream;
import java.io.IOException;
@ -87,7 +85,7 @@ public class Response {
/**
* Extracts meaningful headers from the response into a more useful and safe
* {@link org.fdroid.fdroid.net.bluetooth.FileDetails} object.
* {@link FileDetails} object.
*/
public FileDetails toFileDetails() {
FileDetails details = new FileDetails();

View File

@ -5,11 +5,11 @@ import android.support.annotation.Nullable;
import android.util.Log;
import org.apache.commons.io.input.BoundedInputStream;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.net.bluetooth.BluetoothClient;
import org.fdroid.fdroid.net.bluetooth.BluetoothConnection;
import org.fdroid.fdroid.net.bluetooth.FileDetails;
import org.fdroid.fdroid.net.bluetooth.httpish.Request;
import org.fdroid.fdroid.net.bluetooth.httpish.Response;
import org.fdroid.fdroid.nearby.BluetoothClient;
import org.fdroid.fdroid.nearby.BluetoothConnection;
import org.fdroid.fdroid.nearby.httpish.FileDetails;
import org.fdroid.fdroid.nearby.httpish.Request;
import org.fdroid.fdroid.nearby.httpish.Response;
import java.io.File;
import java.io.IOException;

View File

@ -52,7 +52,7 @@ import java.net.URL;
public class HttpDownloader extends Downloader {
private static final String TAG = "HttpDownloader";
static final String HEADER_FIELD_ETAG = "ETag";
public static final String HEADER_FIELD_ETAG = "ETag";
private final String username;
private final String password;

View File

@ -56,13 +56,13 @@ import org.fdroid.fdroid.R;
import org.fdroid.fdroid.UpdateService;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.data.NewRepoConfig;
import org.fdroid.fdroid.localrepo.SDCardScannerService;
import org.fdroid.fdroid.localrepo.SwapService;
import org.fdroid.fdroid.net.WifiStateChangeService;
import org.fdroid.fdroid.nearby.SDCardScannerService;
import org.fdroid.fdroid.nearby.SwapService;
import org.fdroid.fdroid.nearby.WifiStateChangeService;
import org.fdroid.fdroid.views.AppDetailsActivity;
import org.fdroid.fdroid.views.ManageReposActivity;
import org.fdroid.fdroid.views.apps.AppListActivity;
import org.fdroid.fdroid.views.swap.SwapWorkflowActivity;
import org.fdroid.fdroid.nearby.SwapWorkflowActivity;
import java.lang.reflect.Field;

View File

@ -25,7 +25,7 @@ import org.fdroid.fdroid.data.AppProvider;
import org.fdroid.fdroid.data.RepoProvider;
import org.fdroid.fdroid.data.Schema.AppMetadataTable;
import org.fdroid.fdroid.views.apps.AppListActivity;
import org.fdroid.fdroid.views.hiding.HidingManager;
import org.fdroid.fdroid.panic.HidingManager;
import org.fdroid.fdroid.views.whatsnew.WhatsNewAdapter;
import java.util.Date;

View File

@ -149,7 +149,7 @@
android:title="@string/panic_settings">
<intent
android:action="android.intent.action.MAIN"
android:targetClass="org.fdroid.fdroid.views.panic.PanicPreferencesActivity"
android:targetClass="org.fdroid.fdroid.panic.PanicPreferencesActivity"
android:targetPackage="@string/applicationId"/>
</android.support.v7.preference.PreferenceScreen>
</android.support.v7.preference.PreferenceCategory>

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import org.fdroid.fdroid.FDroidApp;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net;
package org.fdroid.fdroid.nearby;
/*
* #%L
@ -38,6 +38,7 @@ import android.text.TextUtils;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.fdroid.fdroid.Utils;
import org.fdroid.fdroid.net.HttpDownloader;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.localrepo;
package org.fdroid.fdroid.nearby;
import android.content.Context;
import android.text.TextUtils;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.net;
package org.fdroid.fdroid.nearby;
import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.fdroid.fdroid.views.panic;
package org.fdroid.fdroid.panic;
import org.fdroid.fdroid.data.DBHelper;
import org.fdroid.fdroid.data.FDroidProviderTest;

View File

@ -23,10 +23,11 @@ import org.fdroid.fdroid.data.RepoProvider;
import org.fdroid.fdroid.data.Schema;
import org.fdroid.fdroid.data.ShadowApp;
import org.fdroid.fdroid.data.TempAppProvider;
import org.fdroid.fdroid.localrepo.LocalRepoKeyStore;
import org.fdroid.fdroid.localrepo.LocalRepoManager;
import org.fdroid.fdroid.localrepo.LocalRepoService;
import org.fdroid.fdroid.net.LocalHTTPD;
import org.fdroid.fdroid.nearby.LocalRepoKeyStore;
import org.fdroid.fdroid.nearby.LocalRepoManager;
import org.fdroid.fdroid.nearby.LocalRepoService;
import org.fdroid.fdroid.nearby.WifiStateChangeService;
import org.fdroid.fdroid.nearby.LocalHTTPD;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
@ -94,7 +95,7 @@ public class SwapRepoTest {
}
/**
* @see org.fdroid.fdroid.net.WifiStateChangeService.WifiInfoThread#run()
* @see WifiStateChangeService.WifiInfoThread#run()
*/
@Test
public void testSwap()