aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bugs175
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bugs175')
-rw-r--r--tests/bugs175/pr430243/PackageManagerAspect.java32
-rw-r--r--tests/bugs175/pr430243/PolicyManager.java20
-rw-r--r--tests/bugs175/pr430243/PolicyProviderConstants.java38
-rw-r--r--tests/bugs175/pr430243/PolicyProviderInterface.java32
4 files changed, 122 insertions, 0 deletions
diff --git a/tests/bugs175/pr430243/PackageManagerAspect.java b/tests/bugs175/pr430243/PackageManagerAspect.java
new file mode 100644
index 000000000..56c609e5f
--- /dev/null
+++ b/tests/bugs175/pr430243/PackageManagerAspect.java
@@ -0,0 +1,32 @@
+package com.test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.test2.PolicyManager;
+
+public aspect PackageManagerAspect {
+ pointcut intentquery () : execution(* foo(..));
+ private static final String TAG = "PackageManagerAspect";
+
+ Object around(): intentquery() {
+// return compute();
+ switch (PolicyManager.getOpenInPolicy(false)) {
+ case UNRESTRICTED: break;
+ case RESTRICTED: break;
+ case BLOCKED:
+ default: break;
+ }
+ return "";
+ }
+
+ public Object compute() {
+ switch (PolicyManager.getOpenInPolicy(false)) {
+ case UNRESTRICTED: break;
+ case RESTRICTED: break;
+ case BLOCKED:
+ default: break;
+ }
+ return "";
+ }
+}
diff --git a/tests/bugs175/pr430243/PolicyManager.java b/tests/bugs175/pr430243/PolicyManager.java
new file mode 100644
index 000000000..f6e508f33
--- /dev/null
+++ b/tests/bugs175/pr430243/PolicyManager.java
@@ -0,0 +1,20 @@
+package com.test2;
+
+import com.test2.PolicyProviderConstants.OpenInPolicyValues;
+
+public class PolicyManager {
+ public static OpenInPolicyValues getOpenInPolicy (boolean showDialog)
+ {
+ OpenInPolicyValues value = PolicyProviderInterface.getOpenInPolicy();
+
+ return value;
+ }
+
+ public static void main(String[] args) {
+ new PolicyManager().foo();
+ }
+
+ public String foo() {
+ return "";
+ }
+} \ No newline at end of file
diff --git a/tests/bugs175/pr430243/PolicyProviderConstants.java b/tests/bugs175/pr430243/PolicyProviderConstants.java
new file mode 100644
index 000000000..9a56fe1e6
--- /dev/null
+++ b/tests/bugs175/pr430243/PolicyProviderConstants.java
@@ -0,0 +1,38 @@
+package com.test2;
+
+public interface PolicyProviderConstants
+{
+ public static final String featureSMS = "Sms";
+ public static final String featureCamera = "Camera";
+ public static final String featureAudio = "Microphone";
+ public static final String featureLocation = "Location";
+ public static final String featureSensor = "Sensor";
+ public static final String featureSnapshot = "ScreenCapture";
+ public static final String featureNFC = "nfc";
+
+ public static final String featureClipboard = "CutAndCopy";
+ public static final String featureOpenIn = "DocumentExchange";
+
+ public static final String policySecurityGroup = "SecurityGroup";
+
+ public static final String featureNetworkAccess = "NetworkAccess";
+
+ public static final String featureAuthSupport = "AuthSupport";
+ public static final String featureNETWORKACCESSMODE = "PreferredVpnMode";
+ public static final String policyOpenInExclusionList = "OpenInExclusionList";
+
+ public enum CutCopyPolicyValues
+ {
+ BLOCKED,
+ RESTRICTED,
+ UNRESTRICTED,
+ };
+
+ public enum OpenInPolicyValues
+ {
+ BLOCKED,
+ RESTRICTED,
+ UNRESTRICTED,
+ };
+
+}
diff --git a/tests/bugs175/pr430243/PolicyProviderInterface.java b/tests/bugs175/pr430243/PolicyProviderInterface.java
new file mode 100644
index 000000000..5b14b85d5
--- /dev/null
+++ b/tests/bugs175/pr430243/PolicyProviderInterface.java
@@ -0,0 +1,32 @@
+package com.test2;
+
+import com.test2.PolicyProviderConstants.OpenInPolicyValues;
+
+//import android.content.ContentResolver;
+//import android.database.Cursor;
+//import android.net.Uri;
+//import android.os.Binder;
+//import android.text.TextUtils;
+//import android.util.Log;
+
+
+// Interface to calls to ManagedAppInfoProvider. this queries the policies and exposes interfaces for checks
+public class PolicyProviderInterface
+{
+ private static final String TAG = "PolicyProviderInterface";
+
+ private static final String STR_SECURITY_GROUP = "SecurityGroup";
+ private static final String STR_BLOCKED = "blocked";
+ private static final String VALUE_SECUREBROWSE = "SecureBrowse";
+
+// private static final String STR_PROVIDER_URI = PolicyProviderColumns.AUTHORITY + "." + PolicyManager.getPackageName() + "/" + PolicyProviderColumns.POLICY_INFO;
+// private static final Uri providerURI = Uri.parse("content://"+ STR_PROVIDER_URI);
+
+
+
+ public static OpenInPolicyValues getOpenInPolicy()
+ {
+ return OpenInPolicyValues.RESTRICTED;
+ }
+
+}