api: now min sdk is 21, remove all TargetApi annotation

This commit is contained in:
PeratX 2019-07-16 19:30:24 +08:00
parent 9fcb707061
commit 4e0ee9a966
7 changed files with 1 additions and 23 deletions

View File

@ -1,11 +1,9 @@
package org.itxtech.daedalus.fragment; package org.itxtech.daedalus.fragment;
import android.annotation.TargetApi;
import android.app.Activity; import android.app.Activity;
import android.app.AlertDialog; import android.app.AlertDialog;
import android.content.Intent; import android.content.Intent;
import android.net.Uri; import android.net.Uri;
import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
import android.os.Message; import android.os.Message;
@ -224,7 +222,6 @@ public class RuleConfigFragment extends ConfigFragment {
return view; return view;
} }
@TargetApi(Build.VERSION_CODES.KITKAT)
private void performFileSearch() { private void performFileSearch() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT); Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);
@ -237,7 +234,6 @@ public class RuleConfigFragment extends ConfigFragment {
} }
@Override @Override
@TargetApi(Build.VERSION_CODES.KITKAT)
public void onActivityResult(int requestCode, int resultCode, Intent resultData) { public void onActivityResult(int requestCode, int resultCode, Intent resultData) {
if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) { if (requestCode == READ_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
if (resultData != null) { if (resultData != null) {

View File

@ -1,7 +1,5 @@
package org.itxtech.daedalus.provider; package org.itxtech.daedalus.provider;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.ParcelFileDescriptor; import android.os.ParcelFileDescriptor;
import android.system.Os; import android.system.Os;
import android.system.OsConstants; import android.system.OsConstants;
@ -68,7 +66,6 @@ abstract public class HttpsProvider extends Provider {
.build(); .build();
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void process() { public void process() {
try { try {
FileDescriptor[] pipes = Os.pipe(); FileDescriptor[] pipes = Os.pipe();

View File

@ -1,7 +1,5 @@
package org.itxtech.daedalus.provider; package org.itxtech.daedalus.provider;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.ParcelFileDescriptor; import android.os.ParcelFileDescriptor;
import android.system.Os; import android.system.Os;
import org.itxtech.daedalus.Daedalus; import org.itxtech.daedalus.Daedalus;
@ -65,7 +63,6 @@ public abstract class Provider {
running = false; running = false;
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void stop() { public void stop() {
try { try {
if (mInterruptFd != null) { if (mInterruptFd != null) {
@ -189,4 +186,4 @@ public abstract class Provider {
} }
protected abstract void handleDnsRequest(byte[] packetData) throws DaedalusVpnService.VpnNetworkException; protected abstract void handleDnsRequest(byte[] packetData) throws DaedalusVpnService.VpnNetworkException;
} }

View File

@ -1,7 +1,5 @@
package org.itxtech.daedalus.provider; package org.itxtech.daedalus.provider;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.ParcelFileDescriptor; import android.os.ParcelFileDescriptor;
import android.system.ErrnoException; import android.system.ErrnoException;
import android.system.Os; import android.system.Os;
@ -44,7 +42,6 @@ public class TcpProvider extends UdpProvider {
super(descriptor, service); super(descriptor, service);
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void process() { public void process() {
try { try {
FileDescriptor[] pipes = Os.pipe(); FileDescriptor[] pipes = Os.pipe();

View File

@ -1,7 +1,5 @@
package org.itxtech.daedalus.provider; package org.itxtech.daedalus.provider;
import android.annotation.TargetApi;
import android.os.Build;
import android.os.ParcelFileDescriptor; import android.os.ParcelFileDescriptor;
import android.system.Os; import android.system.Os;
import android.system.OsConstants; import android.system.OsConstants;
@ -47,7 +45,6 @@ public class UdpProvider extends Provider {
super(descriptor, service); super(descriptor, service);
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void process() { public void process() {
try { try {
FileDescriptor[] pipes = Os.pipe(); FileDescriptor[] pipes = Os.pipe();

View File

@ -1,6 +1,5 @@
package org.itxtech.daedalus.service; package org.itxtech.daedalus.service;
import android.annotation.TargetApi;
import android.app.Notification; import android.app.Notification;
import android.app.NotificationChannel; import android.app.NotificationChannel;
import android.app.NotificationManager; import android.app.NotificationManager;
@ -153,7 +152,6 @@ public class DaedalusVpnService extends VpnService implements Runnable {
stopThread(); stopThread();
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void stopThread() { private void stopThread() {
Log.d(TAG, "stopThread"); Log.d(TAG, "stopThread");
activated = false; activated = false;
@ -231,7 +229,6 @@ public class DaedalusVpnService extends VpnService implements Runnable {
return null; return null;
} }
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override @Override
public void run() { public void run() {
try { try {

View File

@ -1,8 +1,6 @@
package org.itxtech.daedalus.widget; package org.itxtech.daedalus.widget;
import android.annotation.TargetApi;
import android.content.Context; import android.content.Context;
import android.os.Build;
import android.preference.ListPreference; import android.preference.ListPreference;
import android.util.AttributeSet; import android.util.AttributeSet;
@ -19,7 +17,6 @@ import android.util.AttributeSet;
*/ */
public class ClickPreference extends ListPreference { public class ClickPreference extends ListPreference {
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public ClickPreference(Context context, AttributeSet attrs, int defStyleAttr) { public ClickPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
} }