From a3dafcfb26117e3a2efa3983bd7ba79ae6831680 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 27 Mar 2014 14:58:41 +0100 Subject: [PATCH] Add a SampleTrustAgent Adds a simple app that shows how to build a trust agent. For lack of a better place to put this, this stays in Keyguard's tests for now. Bug: 13723878 Change-Id: I9ebad253d3d89c846fe8afaad6babce9e7b80b5e --- .../Keyguard/test/SampleTrustAgent/Android.mk | 33 ++++++ .../test/SampleTrustAgent/AndroidManifest.xml | 41 +++++++ .../layout/sample_trust_agent_settings.xml | 35 ++++++ .../SampleTrustAgent/res/values/strings.xml | 20 ++++ .../res/xml/sample_trust_agent.xml | 18 +++ .../trustagent/test/SampleTrustAgent.java | 107 ++++++++++++++++++ .../test/SampleTrustAgentSettings.java | 69 +++++++++++ 7 files changed, 323 insertions(+) create mode 100644 packages/Keyguard/test/SampleTrustAgent/Android.mk create mode 100644 packages/Keyguard/test/SampleTrustAgent/AndroidManifest.xml create mode 100644 packages/Keyguard/test/SampleTrustAgent/res/layout/sample_trust_agent_settings.xml create mode 100644 packages/Keyguard/test/SampleTrustAgent/res/values/strings.xml create mode 100644 packages/Keyguard/test/SampleTrustAgent/res/xml/sample_trust_agent.xml create mode 100644 packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgent.java create mode 100644 packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgentSettings.java diff --git a/packages/Keyguard/test/SampleTrustAgent/Android.mk b/packages/Keyguard/test/SampleTrustAgent/Android.mk new file mode 100644 index 0000000000000..7551fdf8a47fb --- /dev/null +++ b/packages/Keyguard/test/SampleTrustAgent/Android.mk @@ -0,0 +1,33 @@ +# Copyright (C) 2014 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := SampleTrustAgent + +# Remove these to verify permission checks are working correctly +#LOCAL_CERTIFICATE := platform +#LOCAL_PRIVILEGED_MODULE := true + +LOCAL_MODULE_TAGS := tests + +# LOCAL_PROGUARD_FLAG_FILES := proguard.flags + +LOCAL_STATIC_JAVA_LIBRARIES := android-support-v4 + +include $(BUILD_PACKAGE) diff --git a/packages/Keyguard/test/SampleTrustAgent/AndroidManifest.xml b/packages/Keyguard/test/SampleTrustAgent/AndroidManifest.xml new file mode 100644 index 0000000000000..15119110bb5d1 --- /dev/null +++ b/packages/Keyguard/test/SampleTrustAgent/AndroidManifest.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + diff --git a/packages/Keyguard/test/SampleTrustAgent/res/layout/sample_trust_agent_settings.xml b/packages/Keyguard/test/SampleTrustAgent/res/layout/sample_trust_agent_settings.xml new file mode 100644 index 0000000000000..01b107bb4172e --- /dev/null +++ b/packages/Keyguard/test/SampleTrustAgent/res/layout/sample_trust_agent_settings.xml @@ -0,0 +1,35 @@ + + + + + +