summaryrefslogtreecommitdiff
path: root/src/de
diff options
context:
space:
mode:
authorArne Schwabe <arne@rfc2549.org>2013-08-02 11:38:34 +0200
committerArne Schwabe <arne@rfc2549.org>2013-08-02 11:38:34 +0200
commit2ccc4039958abb90bf6f1cfc9c3d2de480abbecb (patch)
treed8890a268f08ec2ecf82d989c314210056fb0550 /src/de
parent7a6a6c894d5318b66efbe7289d12c9d33278c750 (diff)
Welcome Android 4.3
Also add prototypish restricted profile support
Diffstat (limited to 'src/de')
-rw-r--r--src/de/blinkt/openvpn/core/GetRestrictionReceiver.java44
1 files changed, 44 insertions, 0 deletions
diff --git a/src/de/blinkt/openvpn/core/GetRestrictionReceiver.java b/src/de/blinkt/openvpn/core/GetRestrictionReceiver.java
new file mode 100644
index 00000000..14134148
--- /dev/null
+++ b/src/de/blinkt/openvpn/core/GetRestrictionReceiver.java
@@ -0,0 +1,44 @@
+package de.blinkt.openvpn.core;
+
+import android.app.Activity;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.RestrictionEntry;
+import android.os.Bundle;
+
+import java.util.ArrayList;
+
+import de.blinkt.openvpn.R;
+
+/**
+ * Created by arne on 25.07.13.
+ */
+public class GetRestrictionReceiver extends BroadcastReceiver {
+ @Override
+ public void onReceive(final Context context, Intent intent) {
+ final PendingResult result = goAsync();
+
+ new Thread() {
+ @Override
+ public void run() {
+ final Bundle extras = new Bundle();
+
+ ArrayList<RestrictionEntry> restrictionEntries = initRestrictions(context);
+
+ extras.putParcelableArrayList(Intent.EXTRA_RESTRICTIONS_LIST, restrictionEntries);
+ result.setResult(Activity.RESULT_OK,null,extras);
+ result.finish();
+ }
+ }.run();
+ }
+
+ private ArrayList<RestrictionEntry> initRestrictions(Context context) {
+ ArrayList<RestrictionEntry> restrictions = new ArrayList<RestrictionEntry>();
+ RestrictionEntry allowChanges = new RestrictionEntry("allow_changes",false);
+ allowChanges.setTitle(context.getString(R.string.allow_vpn_changes));
+ restrictions.add(allowChanges);
+
+ return restrictions;
+ }
+}