Skip to content

Commit

Permalink
api: now min sdk is 21, remove all TargetApi annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
PeratX committed Jul 16, 2019
1 parent 9fcb707 commit 4e0ee9a
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 23 deletions.
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -224,7 +222,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle sa
return view;
}

@TargetApi(Build.VERSION_CODES.KITKAT)
private void performFileSearch() {
Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT);

Expand All @@ -237,7 +234,6 @@ private void performFileSearch() {
}

@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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -68,7 +66,6 @@ OkHttpClient getHttpClient(String accept) {
.build();
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void process() {
try {
FileDescriptor[] pipes = Os.pipe();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -65,7 +63,6 @@ public final void shutdown() {
running = false;
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void stop() {
try {
if (mInterruptFd != null) {
Expand Down Expand Up @@ -189,4 +186,4 @@ protected void readPacketFromDevice(FileInputStream inputStream, byte[] packet)
}

protected abstract void handleDnsRequest(byte[] packetData) throws DaedalusVpnService.VpnNetworkException;
}
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -44,7 +42,6 @@ public TcpProvider(ParcelFileDescriptor descriptor, DaedalusVpnService service)
super(descriptor, service);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void process() {
try {
FileDescriptor[] pipes = Os.pipe();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -47,7 +45,6 @@ public UdpProvider(ParcelFileDescriptor descriptor, DaedalusVpnService service)
super(descriptor, service);
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public void process() {
try {
FileDescriptor[] pipes = Os.pipe();
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down Expand Up @@ -153,7 +152,6 @@ public void onDestroy() {
stopThread();
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
private void stopThread() {
Log.d(TAG, "stopThread");
activated = false;
Expand Down Expand Up @@ -231,7 +229,6 @@ private InetAddress addDnsServer(Builder builder, String format, byte[] ipv6Temp
return null;
}

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
@Override
public void run() {
try {
Expand Down
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -19,7 +17,6 @@
*/
public class ClickPreference extends ListPreference {

@TargetApi(Build.VERSION_CODES.LOLLIPOP)
public ClickPreference(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
Expand Down

0 comments on commit 4e0ee9a

Please sign in to comment.