Loading app/src/main/java/net/fabiszewski/ulogger/LoggerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,9 @@ public class LoggerService extends Service { if (Logger.DEBUG) { Log.d(TAG, "[onCreate]"); } mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (mNotificationManager != null) { mNotificationManager.cancelAll(); } locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locListener = new mLocationListener(); Loading app/src/main/java/net/fabiszewski/ulogger/ProviderPreference.java +3 −3 Original line number Diff line number Diff line Loading @@ -65,9 +65,9 @@ class ProviderPreference extends ListPreference { LocationManager locManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); missingProviders = new ArrayList<>(); final boolean existsGPS = locManager.getAllProviders().contains(LocationManager.GPS_PROVIDER); final boolean existsNet = locManager.getAllProviders().contains(LocationManager.NETWORK_PROVIDER); if (Logger.DEBUG) { Log.d(TAG, "[Providers available: " + locManager.getAllProviders()); } final boolean existsGPS = locManager != null && locManager.getAllProviders().contains(LocationManager.GPS_PROVIDER); final boolean existsNet = locManager != null && locManager.getAllProviders().contains(LocationManager.NETWORK_PROVIDER); if (Logger.DEBUG) { Log.d(TAG, "[Providers available: " + (locManager != null ? locManager.getAllProviders() : null)); } defaultValue = VALUE_ALL; if (!existsGPS) { missingProviders.add(VALUE_GPS); Loading app/src/main/java/net/fabiszewski/ulogger/WebHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ class WebHelper { private String postWithParams(Map<String, String> params) throws IOException, WebAuthException { URL url = new URL(host + "/" + CLIENT_SCRIPT); if (Logger.DEBUG) { Log.d(TAG, "[postWithParams: " + url + " : " + params + "]"); } String response = null; String response; String dataString = ""; for (Map.Entry<String, String> p : params.entrySet()) { Loading app/src/main/java/net/fabiszewski/ulogger/WebSyncService.java +6 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,9 @@ public class WebSyncService extends IntentService { // cancel pending alarm if (Logger.DEBUG) { Log.d(TAG, "[websync cancel alarm]"); } AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); if (am != null) { am.cancel(pi); } pi = null; } Loading Loading @@ -206,9 +208,11 @@ public class WebSyncService extends IntentService { AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent syncIntent = new Intent(getApplicationContext(), WebSyncService.class); pi = PendingIntent.getService(this, 0, syncIntent, FLAG_ONE_SHOT); if (am != null) { am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + FIVE_MINUTES, pi); } } } /** * Convert cursor to map of request parameters Loading Loading
app/src/main/java/net/fabiszewski/ulogger/LoggerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -86,7 +86,9 @@ public class LoggerService extends Service { if (Logger.DEBUG) { Log.d(TAG, "[onCreate]"); } mNotificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE); if (mNotificationManager != null) { mNotificationManager.cancelAll(); } locManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); locListener = new mLocationListener(); Loading
app/src/main/java/net/fabiszewski/ulogger/ProviderPreference.java +3 −3 Original line number Diff line number Diff line Loading @@ -65,9 +65,9 @@ class ProviderPreference extends ListPreference { LocationManager locManager = (LocationManager) context.getSystemService(Context.LOCATION_SERVICE); missingProviders = new ArrayList<>(); final boolean existsGPS = locManager.getAllProviders().contains(LocationManager.GPS_PROVIDER); final boolean existsNet = locManager.getAllProviders().contains(LocationManager.NETWORK_PROVIDER); if (Logger.DEBUG) { Log.d(TAG, "[Providers available: " + locManager.getAllProviders()); } final boolean existsGPS = locManager != null && locManager.getAllProviders().contains(LocationManager.GPS_PROVIDER); final boolean existsNet = locManager != null && locManager.getAllProviders().contains(LocationManager.NETWORK_PROVIDER); if (Logger.DEBUG) { Log.d(TAG, "[Providers available: " + (locManager != null ? locManager.getAllProviders() : null)); } defaultValue = VALUE_ALL; if (!existsGPS) { missingProviders.add(VALUE_GPS); Loading
app/src/main/java/net/fabiszewski/ulogger/WebHelper.java +1 −1 Original line number Diff line number Diff line Loading @@ -129,7 +129,7 @@ class WebHelper { private String postWithParams(Map<String, String> params) throws IOException, WebAuthException { URL url = new URL(host + "/" + CLIENT_SCRIPT); if (Logger.DEBUG) { Log.d(TAG, "[postWithParams: " + url + " : " + params + "]"); } String response = null; String response; String dataString = ""; for (Map.Entry<String, String> p : params.entrySet()) { Loading
app/src/main/java/net/fabiszewski/ulogger/WebSyncService.java +6 −2 Original line number Diff line number Diff line Loading @@ -78,7 +78,9 @@ public class WebSyncService extends IntentService { // cancel pending alarm if (Logger.DEBUG) { Log.d(TAG, "[websync cancel alarm]"); } AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); if (am != null) { am.cancel(pi); } pi = null; } Loading Loading @@ -206,9 +208,11 @@ public class WebSyncService extends IntentService { AlarmManager am = (AlarmManager) getSystemService(Context.ALARM_SERVICE); Intent syncIntent = new Intent(getApplicationContext(), WebSyncService.class); pi = PendingIntent.getService(this, 0, syncIntent, FLAG_ONE_SHOT); if (am != null) { am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis() + FIVE_MINUTES, pi); } } } /** * Convert cursor to map of request parameters Loading