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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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