From e303bf443532c2ad756260133f00747bcff11e69 Mon Sep 17 00:00:00 2001 From: Jim Miller Date: Tue, 26 Aug 2014 17:12:29 -0700 Subject: Update TrustAgentService API after review This change incorporates API council feedback and enables the TrustAgent whitelisting API. It also contains a minor cleanup of DPM's use of UserHandle to eliminate unnecessary object creation. Fixes bug 17008504 Change-Id: I63cc50169fde54b34406845818bcaf6aadc1a3db --- .../src/com/android/trustagent/test/SampleTrustAgent.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'packages/Keyguard') diff --git a/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgent.java b/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgent.java index c650a0f..09c7165 100644 --- a/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgent.java +++ b/packages/Keyguard/test/SampleTrustAgent/src/com/android/trustagent/test/SampleTrustAgent.java @@ -21,7 +21,7 @@ import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.content.SharedPreferences; -import android.os.Bundle; +import android.os.PersistableBundle; import android.preference.PreferenceManager; import android.service.trust.TrustAgentService; import android.support.v4.content.LocalBroadcastManager; @@ -90,8 +90,15 @@ public class SampleTrustAgent extends TrustAgentService } @Override - public boolean onSetTrustAgentFeaturesEnabled(Bundle options) { - Log.v(TAG, "Policy options received: " + options.getStringArrayList(KEY_FEATURES)); + public boolean onConfigure(Configuration config) { + if (config != null && config.options != null) { + for (int i = 0; i < config.options.size(); i++) { + PersistableBundle options = config.options.get(i); + Log.v(TAG, "Policy options received: " + options.toString()); + } + } else { + Log.w(TAG, "onConfigure() called with no options"); + } // TODO: Handle options return true; // inform DPM that we support it } -- cgit v1.1