Use AOSP intent for Work Policy Info

Bug: 134391103
Test: make, GTS, robotest
Change-Id: I8870621538aa7d2d4a5313efdf41119fd36daee5
This commit is contained in:
Ivan Podogov
2019-08-02 13:34:33 +01:00
parent 7d744c8f18
commit 2c3ba517fe
4 changed files with 3 additions and 10 deletions

View File

@@ -415,9 +415,6 @@
<!-- List containing the injected tile keys which are suppressed. --> <!-- List containing the injected tile keys which are suppressed. -->
<string-array name="config_suppress_injected_tile_keys" translatable="false"/> <string-array name="config_suppress_injected_tile_keys" translatable="false"/>
<!-- "Show work policy info" intent action. TODO(b/134391103): Replace with final SystemAPI intent when it's available. -->
<string name="config_work_policy_info_intent_action" translatable="false"/>
<!-- Reset application package name --> <!-- Reset application package name -->
<string-array name="config_reset_app_package_name" translatable="false"> <string-array name="config_reset_app_package_name" translatable="false">
<item>com.android.systemui</item> <item>com.android.systemui</item>

View File

@@ -278,7 +278,7 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
// Only search for the required action in the Device Owner's package // Only search for the required action in the Device Owner's package
final Intent intent = final Intent intent =
new Intent(mResources.getString(R.string.config_work_policy_info_intent_action)) new Intent(Settings.ACTION_SHOW_WORK_POLICY_INFO)
.setPackage(ownerComponent.getPackageName()) .setPackage(ownerComponent.getPackageName())
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
final List<ResolveInfo> activities = mPm.queryIntentActivities(intent, 0); final List<ResolveInfo> activities = mPm.queryIntentActivities(intent, 0);
@@ -302,7 +302,7 @@ public class EnterprisePrivacyFeatureProviderImpl implements EnterprisePrivacyFe
// Only search for the required action in the Profile Owner's package // Only search for the required action in the Profile Owner's package
final Intent intent = final Intent intent =
new Intent(mResources.getString(R.string.config_work_policy_info_intent_action)) new Intent(Settings.ACTION_SHOW_WORK_POLICY_INFO)
.setPackage(ownerComponent.getPackageName()) .setPackage(ownerComponent.getPackageName())
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); .addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
final List<ResolveInfo> activities = mPm.queryIntentActivitiesAsUser(intent, 0, userId); final List<ResolveInfo> activities = mPm.queryIntentActivitiesAsUser(intent, 0, userId);

View File

@@ -24,7 +24,4 @@
<!-- Fake dimen value for restricted icon size - needed to get around Robolectric <!-- Fake dimen value for restricted icon size - needed to get around Robolectric
issue loading framework hidden resources --> issue loading framework hidden resources -->
<dimen name="restricted_icon_size">24dp</dimen> <dimen name="restricted_icon_size">24dp</dimen>
<!-- Fake string to avoid empty intent action -->
<string name="config_work_policy_info_intent_action" translatable="false">ACTION_SHOW_WORK_POLICY_INFO</string>
</resources> </resources>

View File

@@ -422,8 +422,7 @@ public class EnterprisePrivacyFeatureProviderImplTest {
private Intent addWorkPolicyInfoIntent( private Intent addWorkPolicyInfoIntent(
String packageName, boolean deviceOwner, boolean profileOwner) { String packageName, boolean deviceOwner, boolean profileOwner) {
Intent intent = Intent intent = new Intent(Settings.ACTION_SHOW_WORK_POLICY_INFO);
new Intent(mResources.getString(R.string.config_work_policy_info_intent_action));
intent.setPackage(packageName); intent.setPackage(packageName);
ResolveInfo resolveInfo = new ResolveInfo(); ResolveInfo resolveInfo = new ResolveInfo();
resolveInfo.resolvePackageName = packageName; resolveInfo.resolvePackageName = packageName;