Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge branch 'master' of github.com:audaciouscode/PassiveDataKit-Android
  • Loading branch information
audaciouscode committed May 29, 2017
2 parents 892127f + 25433c2 commit 652cf66
Show file tree
Hide file tree
Showing 12 changed files with 36 additions and 8 deletions.
@@ -1,5 +1,6 @@
package com.audacious_software.passive_data_kit;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
Expand Down Expand Up @@ -59,6 +60,7 @@ else if (netInfo.getState() != NetworkInfo.State.CONNECTED
return DeviceInformation.sWifiAvailable;
}

@SuppressLint("InlinedApi")
@SuppressWarnings("ConstantConditions")
public static boolean isPluggedIn(Context context) {
Intent intent = context.registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED));
Expand Down
1 change: 1 addition & 0 deletions src/com/audacious_software/passive_data_kit/Logger.java
Expand Up @@ -11,6 +11,7 @@
public class Logger {
private Context mContext = null;

@SuppressWarnings("SameParameterValue")
public void log(String event, Map<String, ?> details) {
if (details == null) {
details = new HashMap<>();
Expand Down
Expand Up @@ -20,6 +20,7 @@

import java.util.ArrayList;

@SuppressWarnings("unused")
public class DiagnosticsActivity extends AppCompatActivity {
@SuppressWarnings("SameParameterValue")
@SuppressLint("AlwaysShowAction")
Expand Down
Expand Up @@ -24,6 +24,7 @@
import java.util.HashSet;
import java.util.List;

@SuppressWarnings("unused")
public class Generators {
private Context mContext = null;
private boolean mStarted = false;
Expand Down
Expand Up @@ -120,9 +120,12 @@ public class Location extends Generator implements GoogleApiClient.ConnectionCal
private static final int DATABASE_VERSION = 1;

private static final String TABLE_HISTORY = "history";
private static final String HISTORY_OBSERVED = "observed";
private static final String HISTORY_LATITUDE = "latitude";
private static final String HISTORY_LONGITUDE = "longitude";
@SuppressWarnings("WeakerAccess")
public static final String HISTORY_OBSERVED = "observed";
@SuppressWarnings("WeakerAccess")
public static final String HISTORY_LATITUDE = "latitude";
@SuppressWarnings("WeakerAccess")
public static final String HISTORY_LONGITUDE = "longitude";
private static final String HISTORY_ALTITUDE = "altitude";
private static final String HISTORY_BEARING = "bearing";
private static final String HISTORY_SPEED = "speed";
Expand Down Expand Up @@ -1005,7 +1008,7 @@ public android.location.Location getLastKnownLocation() {
return last;
}

@SuppressWarnings("SameParameterValue")
@SuppressWarnings({"SameParameterValue", "unused"})
public void setUpdateInterval(long interval) {
this.mUpdateInterval = interval;

Expand Down
Expand Up @@ -57,8 +57,10 @@ public class ScreenState extends Generator{
private static final String DATABASE_PATH = "pdk-screen-state.sqlite";
private static final int DATABASE_VERSION = 2;

private static final String HISTORY_OBSERVED = "observed";
private static final String HISTORY_STATE = "state";
@SuppressWarnings("WeakerAccess")
public static final String HISTORY_OBSERVED = "observed";
@SuppressWarnings("WeakerAccess")
public static final String HISTORY_STATE = "state";
private static final String TABLE_HISTORY = "history";

private static ScreenState sInstance = null;
Expand Down
@@ -1,5 +1,6 @@
package com.audacious_software.passive_data_kit.generators.diagnostics;

import android.annotation.SuppressLint;
import android.app.AlarmManager;
import android.app.PendingIntent;
import android.content.BroadcastReceiver;
Expand Down Expand Up @@ -43,6 +44,7 @@
import java.util.List;

@SuppressWarnings("SimplifiableIfStatement")
@SuppressLint("NewApi")
public class SystemStatus extends Generator {
private static final String GENERATOR_IDENTIFIER = "pdk-system-status";

Expand Down
Expand Up @@ -111,6 +111,7 @@ public static String generatorIdentifier() {
return Accelerometer.GENERATOR_IDENTIFIER;
}

@SuppressWarnings("WeakerAccess")
public static Accelerometer getInstance(Context context) {
if (Accelerometer.sInstance == null) {
Accelerometer.sInstance = new Accelerometer(context.getApplicationContext());
Expand Down Expand Up @@ -140,6 +141,7 @@ public void setIgnorePowerManagement(boolean ignore) {
this.startGenerator();
}

@SuppressWarnings("unused")
public void setRefreshInterval(long interval) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -151,6 +153,7 @@ public void setRefreshInterval(long interval) {
this.startGenerator();
}

@SuppressWarnings("unused")
public void setRefreshDuration(long duration) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand Down
Expand Up @@ -211,8 +211,11 @@ public class WithingsDevice extends Generator {
private static final String SERVER_FETCH_ENABLED = "com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice.SERVER_FETCH_ENABLED";
private static final boolean SERVER_FETCH_ENABLED_DEFAULT = false;

@SuppressWarnings("WeakerAccess")
public static final String OPTION_OAUTH_CALLBACK_URL = "com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice.OPTION_CALLBACK_URL";
@SuppressWarnings("WeakerAccess")
public static final String OPTION_OAUTH_CONSUMER_KEY = "com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice.OPTION_OAUTH_CONSUMER_KEY";
@SuppressWarnings("WeakerAccess")
public static final String OPTION_OAUTH_CONSUMER_SECRET = "com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice.OPTION_OAUTH_CONSUMER_SECRET";
private static final String OPTION_OAUTH_ACCESS_TOKEN = "com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice.OPTION_OAUTH_ACCESS_TOKEN";
private static final String OPTION_OAUTH_ACCESS_TOKEN_SECRET = "com.audacious_software.passive_data_kit.generators.wearables.WithingsDevice.OPTION_OAUTH_ACCESS_TOKEN_SECRET";
Expand Down Expand Up @@ -1501,6 +1504,7 @@ public static long latestPointGenerated(Context context) {
return timestamp;
}

@SuppressWarnings("WeakerAccess")
public void setProperty(String key, String value) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);

Expand Down Expand Up @@ -1793,6 +1797,7 @@ private static String bindWorkoutsPage(ViewGroup container, DataPointViewHolder
return "" + card.getTag();
}

@SuppressWarnings("unused")
public void enableActivityMeasures(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -1802,6 +1807,7 @@ public void enableActivityMeasures(boolean enable) {
e.apply();
}

@SuppressWarnings("unused")
public void enableBodyMeasures(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -1811,6 +1817,7 @@ public void enableBodyMeasures(boolean enable) {
e.apply();
}

@SuppressWarnings("unused")
public void enableIntradayActivity(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -1820,6 +1827,7 @@ public void enableIntradayActivity(boolean enable) {
e.apply();
}

@SuppressWarnings("unused")
public void enableSleepMeasures(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -1829,6 +1837,7 @@ public void enableSleepMeasures(boolean enable) {
e.apply();
}

@SuppressWarnings("unused")
public void enableSleepSummary(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -1838,6 +1847,7 @@ public void enableSleepSummary(boolean enable) {
e.apply();
}

@SuppressWarnings("unused")
public void enableWorkouts(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand All @@ -1847,6 +1857,7 @@ public void enableWorkouts(boolean enable) {
e.apply();
}

@SuppressWarnings("unused")
public void enableServerFetch(boolean enable) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this.mContext);
SharedPreferences.Editor e = prefs.edit();
Expand Down
Expand Up @@ -51,7 +51,7 @@
import okhttp3.RequestBody;
import okhttp3.Response;

@SuppressWarnings("PointlessBooleanExpression")
@SuppressWarnings({"PointlessBooleanExpression", "unused"})
public class HttpTransmitter extends Transmitter implements Generators.GeneratorUpdatedListener {
public static final String UPLOAD_URI = "com.audacious_software.passive_data_kit.transmitters.HttpTransmitter.UPLOAD_URI";
public static final String USER_ID = "com.audacious_software.passive_data_kit.transmitters.HttpTransmitter.USER_ID";
Expand Down Expand Up @@ -690,6 +690,7 @@ public void setUserId(String userId) {
this.mUserId = userId;
}

@SuppressWarnings("unused")
public static class IncompleteConfigurationException extends RuntimeException {
public IncompleteConfigurationException(String message) {
super(message);
Expand Down
Expand Up @@ -4,7 +4,7 @@

import java.util.HashMap;

@SuppressWarnings("WeakerAccess")
@SuppressWarnings({"WeakerAccess", "unused"})
public abstract class Transmitter {
@SuppressWarnings("unused")
public abstract void initialize(Context context, HashMap<String, String> options);
Expand Down
Expand Up @@ -17,6 +17,7 @@
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

@SuppressWarnings("unused")
public class LiberalSSLSocketFactory extends SSLSocketFactory
{
private final SSLContext sslContext = SSLContext.getInstance("TLS");
Expand Down

0 comments on commit 652cf66

Please sign in to comment.