diff options
author | Arne Schwabe <arne@rfc2549.org> | 2013-04-07 14:05:05 +0200 |
---|---|---|
committer | Arne Schwabe <arne@rfc2549.org> | 2013-04-07 14:05:05 +0200 |
commit | 195b0a10d96ad358d956381d8a0e423a8dd913c7 (patch) | |
tree | 5f62da8410bc08b50e8784ff94231cccbfcb8fb1 /src/de/blinkt/openvpn/api | |
parent | 3b68ac89cd679f134681204e0d1bb40d6dbf7879 (diff) |
Allow clearing of external apps
Diffstat (limited to 'src/de/blinkt/openvpn/api')
-rw-r--r-- | src/de/blinkt/openvpn/api/ConfirmDialog.java | 1 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/api/ExternalAppDatabase.java | 6 | ||||
-rw-r--r-- | src/de/blinkt/openvpn/api/ExternalOpenVPNService.java | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/src/de/blinkt/openvpn/api/ConfirmDialog.java b/src/de/blinkt/openvpn/api/ConfirmDialog.java index f72f4921..dfd01884 100644 --- a/src/de/blinkt/openvpn/api/ConfirmDialog.java +++ b/src/de/blinkt/openvpn/api/ConfirmDialog.java @@ -73,6 +73,7 @@ CompoundButton.OnCheckedChangeListener, DialogInterface.OnClickListener { builder.setNegativeButton(android.R.string.cancel,this); mAlert = builder.create(); + mAlert.setCanceledOnTouchOutside(false); mAlert.setOnShowListener (new OnShowListener() { diff --git a/src/de/blinkt/openvpn/api/ExternalAppDatabase.java b/src/de/blinkt/openvpn/api/ExternalAppDatabase.java index ca348152..e640a13a 100644 --- a/src/de/blinkt/openvpn/api/ExternalAppDatabase.java +++ b/src/de/blinkt/openvpn/api/ExternalAppDatabase.java @@ -25,12 +25,12 @@ public class ExternalAppDatabase { } - Set<String> getExtAppList() { + public Set<String> getExtAppList() { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(mContext); Set<String> allowedapps = prefs.getStringSet(PREFERENCES_KEY, new HashSet<String>()); return allowedapps; } - + void addApp(String packagename) { Set<String> allowedapps = getExtAppList(); @@ -45,7 +45,7 @@ public class ExternalAppDatabase { prefedit.apply(); } - void clearAllApiApps() { + public void clearAllApiApps() { saveExtAppList(new HashSet<String>()); } diff --git a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java index fff6c34f..9e6ac9f3 100644 --- a/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java +++ b/src/de/blinkt/openvpn/api/ExternalOpenVPNService.java @@ -244,7 +244,9 @@ public class ExternalOpenVPNService extends Service implements StateListener { @Override
public void updateState (String state, String logmessage, int resid, ConnectionStatus level) {
mMostRecentState = new UpdateMessage(state, logmessage, level);
- mHandler.obtainMessage(SEND_TOALL, mMostRecentState);
+ Message msg = mHandler.obtainMessage(SEND_TOALL, mMostRecentState);
+ msg.sendToTarget();
+
}
private static final Handler mHandler = new Handler() {
|