mirror of
https://github.com/M66B/NetGuard.git
synced 2025-02-25 07:32:46 +00:00
Fixed lint warnings
This commit is contained in:
parent
e43c76b264
commit
d6e9f711f4
6 changed files with 21 additions and 47 deletions
|
@ -20,7 +20,6 @@ package eu.faircode.netguard;
|
|||
*/
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Bundle;
|
||||
|
|
|
@ -53,21 +53,21 @@ public class DatabaseHelper extends SQLiteOpenHelper {
|
|||
private final static int MSG_LOG = 1;
|
||||
private final static int MSG_ACCESS = 2;
|
||||
|
||||
static {
|
||||
hthread = new HandlerThread("DatabaseHelper");
|
||||
hthread.start();
|
||||
handler = new Handler(hthread.getLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
handleChangedNotification(msg);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public DatabaseHelper(Context context) {
|
||||
super(context, DB_NAME, null, DB_VERSION);
|
||||
this.context = context;
|
||||
|
||||
if (hthread == null) {
|
||||
hthread = new HandlerThread(getClass().getName());
|
||||
hthread.start();
|
||||
handler = new Handler(hthread.getLooper()) {
|
||||
@Override
|
||||
public void handleMessage(Message msg) {
|
||||
handleChangedNotification(msg);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
if (!once) {
|
||||
once = true;
|
||||
|
||||
|
|
|
@ -20,36 +20,17 @@ package eu.faircode.netguard;
|
|||
*/
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.net.Uri;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.support.v4.graphics.drawable.DrawableCompat;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.CursorAdapter;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.squareup.picasso.Picasso;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.net.UnknownHostException;
|
||||
import java.text.SimpleDateFormat;
|
||||
|
||||
public class ForwardingAdapter extends CursorAdapter {
|
||||
private static String TAG = "NetGuard.Forward";
|
||||
|
||||
private boolean resolve;
|
||||
private int colProtocol;
|
||||
private int colDPort;
|
||||
private int colRAddr;
|
||||
|
|
|
@ -634,13 +634,7 @@ public class SinkholeService extends VpnService implements SharedPreferences.OnS
|
|||
|
||||
if (filter && loglevel <= Log.WARN) {
|
||||
int[] count = jni_get_session_count();
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append(count[0]);
|
||||
sb.append('/');
|
||||
sb.append(count[1]);
|
||||
sb.append('/');
|
||||
sb.append(count[2]);
|
||||
remoteViews.setTextViewText(R.id.tvSessions, sb.toString());
|
||||
remoteViews.setTextViewText(R.id.tvSessions, count[0] + "/" + count[1] + "/" + count[2]);
|
||||
} else
|
||||
remoteViews.setTextViewText(R.id.tvSessions, "");
|
||||
|
||||
|
|
|
@ -427,7 +427,7 @@ public class Util {
|
|||
}
|
||||
|
||||
public interface DoubtListener {
|
||||
public void onSure();
|
||||
void onSure();
|
||||
}
|
||||
|
||||
public static void areYouSure(Context context, int explanation, final DoubtListener listener) {
|
||||
|
|
|
@ -40,14 +40,6 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="32dp">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@android:string/ok" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnCancel"
|
||||
android:layout_width="wrap_content"
|
||||
|
@ -55,6 +47,14 @@
|
|||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:text="@android:string/cancel" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnOk"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentLeft="true"
|
||||
android:layout_alignParentStart="true"
|
||||
android:text="@android:string/ok" />
|
||||
</RelativeLayout>
|
||||
|
||||
</LinearLayout>
|
Loading…
Reference in a new issue