(Context context, Cursor cursor, boolean resolve, boolean organization)
| 75 | private InetAddress vpn6 = null; |
| 76 | |
| 77 | public AdapterLog(Context context, Cursor cursor, boolean resolve, boolean organization) { |
| 78 | super(context, cursor, 0); |
| 79 | this.resolve = resolve; |
| 80 | this.organization = organization; |
| 81 | colTime = cursor.getColumnIndex("time"); |
| 82 | colVersion = cursor.getColumnIndex("version"); |
| 83 | colProtocol = cursor.getColumnIndex("protocol"); |
| 84 | colFlags = cursor.getColumnIndex("flags"); |
| 85 | colSAddr = cursor.getColumnIndex("saddr"); |
| 86 | colSPort = cursor.getColumnIndex("sport"); |
| 87 | colDAddr = cursor.getColumnIndex("daddr"); |
| 88 | colDPort = cursor.getColumnIndex("dport"); |
| 89 | colDName = cursor.getColumnIndex("dname"); |
| 90 | colUid = cursor.getColumnIndex("uid"); |
| 91 | colData = cursor.getColumnIndex("data"); |
| 92 | colAllowed = cursor.getColumnIndex("allowed"); |
| 93 | colConnection = cursor.getColumnIndex("connection"); |
| 94 | colInteractive = cursor.getColumnIndex("interactive"); |
| 95 | |
| 96 | TypedValue tv = new TypedValue(); |
| 97 | context.getTheme().resolveAttribute(R.attr.colorOn, tv, true); |
| 98 | colorOn = tv.data; |
| 99 | context.getTheme().resolveAttribute(R.attr.colorOff, tv, true); |
| 100 | colorOff = tv.data; |
| 101 | |
| 102 | iconSize = Util.dips2pixels(24, context); |
| 103 | |
| 104 | try { |
| 105 | List<InetAddress> lstDns = ServiceSinkhole.getDns(context); |
| 106 | dns1 = (lstDns.size() > 0 ? lstDns.get(0) : null); |
| 107 | dns2 = (lstDns.size() > 1 ? lstDns.get(1) : null); |
| 108 | SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); |
| 109 | vpn4 = InetAddress.getByName(prefs.getString("vpn4", "10.1.10.1")); |
| 110 | vpn6 = InetAddress.getByName(prefs.getString("vpn6", "fd00:1:fd00:1:fd00:1:fd00:1")); |
| 111 | } catch (UnknownHostException ex) { |
| 112 | Log.e(TAG, ex.toString() + "\n" + Log.getStackTraceString(ex)); |
| 113 | } |
| 114 | } |
| 115 | |
| 116 | public void setResolve(boolean resolve) { |
| 117 | this.resolve = resolve; |
nothing calls this directly
no test coverage detected