1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 04:41:16 +00:00

Remove TargetApi annotations

They are not used correctly and suppress important linter warnings. (e.g. ea8621cfc3)
This commit is contained in:
Unrud 2017-07-18 17:41:57 +02:00
parent d119517614
commit fd69477e6c
4 changed files with 2 additions and 10 deletions

View file

@ -1,7 +1,6 @@
package com.nutomic.syncthingandroid.activities;
import android.annotation.SuppressLint;
import android.annotation.TargetApi;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
@ -131,13 +130,13 @@ public class MainActivity extends SyncthingActivity
}
}
@TargetApi(23)
private void showBatteryOptimizationDialogIfNecessary() {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M)
return;
SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);
PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE);
boolean dontShowAgain = sp.getBoolean("battery_optimization_dont_show_again", false);
if (dontShowAgain || mBatteryOptimizationsDialog != null ||
Build.VERSION.SDK_INT < Build.VERSION_CODES.M ||
pm.isIgnoringBatteryOptimizations(getPackageName()) ||
mBatteryOptimizationDialogDismissed) {
return;

View file

@ -1,6 +1,5 @@
package com.nutomic.syncthingandroid.receiver;
import android.annotation.TargetApi;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
@ -35,7 +34,6 @@ public class AppConfigReceiver extends BroadcastReceiver {
public static final String ACTION_STOP = "com.nutomic.syncthingandroid.action.STOP";
@Override
@TargetApi(21)
public void onReceive(Context context, Intent intent) {
switch (intent.getAction()) {
case ACTION_START:

View file

@ -1,6 +1,5 @@
package com.nutomic.syncthingandroid.service;
import android.annotation.TargetApi;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
@ -49,7 +48,6 @@ public class DeviceStateHolder extends BroadcastReceiver {
private boolean mIsCharging = false;
@TargetApi(16)
public DeviceStateHolder(Context context) {
mContext = context;
ConnectivityManager cm = (ConnectivityManager)
@ -111,7 +109,6 @@ public class DeviceStateHolder extends BroadcastReceiver {
/**
* Determines if Syncthing should currently run.
*/
@TargetApi(21)
public boolean shouldRun() {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext);
PowerManager pm = (PowerManager) mContext.getSystemService(Context.POWER_SERVICE);

View file

@ -1,6 +1,5 @@
package com.nutomic.syncthingandroid.service;
import android.annotation.TargetApi;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
@ -305,7 +304,6 @@ public class SyncthingService extends Service implements
* Starts the native binary.
*/
@Override
@TargetApi(21)
public void onCreate() {
super.onCreate();
PRNGFixes.apply();