Refactored TrustAgentUtils to allow agent check injection.

Notes:
- TrustAgentUtils defined a method that allowed callers to determine if a Trust Agent package is allowed to provide trust. If it is, it adds it to the list of available trust agents that can be displayed in the Settings->Security screen.
- The logic used to define what agents are permitted on the device can now be injected.

Test: Ran 'm RunSettingsRoboTest' and added a new test for the TrustAgentFeatureProviderImpl.
Bug: 34354635
Change-Id: I24c54c14bde26073ce6fa907379b86aae2841600
This commit is contained in:
Zachary Iqbal
2017-01-17 14:55:49 -08:00
parent 964bcccd62
commit ccae73f228
8 changed files with 205 additions and 25 deletions

View File

@@ -19,6 +19,7 @@ package com.android.settings.security;
import android.content.Context;
import android.support.v7.preference.PreferenceScreen;
import com.android.settings.trustagent.TrustAgentManager;
import com.android.settingslib.drawer.DashboardCategory;
@@ -28,4 +29,7 @@ public interface SecurityFeatureProvider {
/** Update preferences with data from associated tiles. */
void updatePreferences(Context context, PreferenceScreen preferenceScreen,
DashboardCategory dashboardCategory);
/** Returns the {@link TrustAgentManager} bound to this {@link SecurityFeatureProvider}. */
TrustAgentManager getTrustAgentManager();
}