PMD: Enable java-android, fix issues

This commit is contained in:
Daniel Martí 2016-03-01 17:31:41 +00:00
parent 78d15dd4a8
commit fbeb6d140f
3 changed files with 3 additions and 2 deletions

View File

@ -217,6 +217,7 @@ task pmd(type: Pmd, dependsOn: assembleDebug) {
ruleSets = [
//'java-basic',
//'java-unusedcode',
'java-android',
]
source 'src'
include '**/org/fdroid/**/*.java'

View File

@ -176,6 +176,7 @@ public class FDroidApp extends Application {
@TargetApi(9)
@Override
public void onCreate() {
super.onCreate();
if (Build.VERSION.SDK_INT >= 9 && BuildConfig.DEBUG) {
StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder()
.detectAll()
@ -187,7 +188,6 @@ public class FDroidApp extends Application {
.build());
}
updateLanguage();
super.onCreate();
ACRA.init(this);
// Needs to be setup before anything else tries to access it.

View File

@ -595,12 +595,12 @@ public class SwapService extends Service {
@Override
public void onDestroy() {
super.onDestroy();
Utils.debugLog(TAG, "Destroying service, will disable swapping if required, and unregister listeners.");
disableAllSwapping();
Preferences.get().unregisterLocalRepoHttpsListeners(httpsEnabledListener);
LocalBroadcastManager.getInstance(this).unregisterReceiver(onWifiChange);
LocalBroadcastManager.getInstance(this).unregisterReceiver(receiveSwapStatusChanged);
super.onDestroy();
}
private Notification createNotification() {