ATV: Disable custom SUW if GMS SetupWraith is available

This sets the partner customization flag to allow adding hooks
later if necessary.

Change-Id: Ie8dcb0f2eae8916ef00f812ea85661c020dce53b
(cherry picked from commit 68b11675e1)
This commit is contained in:
Aaron Kling
2020-07-23 12:53:03 -05:00
parent 0523274cc8
commit 5d1780f595
2 changed files with 8 additions and 3 deletions

View File

@@ -292,6 +292,8 @@
<receiver android:name=".PartnerReceiver">
<intent-filter>
<action android:name="com.android.setupwizard.action.PARTNER_CUSTOMIZATION" />
<action android:name="com.google.android.tvsetup.action.PARTNER_CUSTOMIZATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>

View File

@@ -73,6 +73,7 @@ public class SetupWizardUtils {
private static final String GMS_PACKAGE = "com.google.android.gms";
private static final String GMS_SUW_PACKAGE = "com.google.android.setupwizard";
private static final String GMS_TV_SUW_PACKAGE = "com.google.android.tungsten.setupwraith";
private static final String PROP_BUILD_DATE = "ro.build.date.utc";
@@ -169,14 +170,16 @@ public class SetupWizardUtils {
}
public static boolean hasGMS(Context context) {
String gmsSuwPackage = hasLeanback(context) ? GMS_TV_SUW_PACKAGE : GMS_SUW_PACKAGE;
if (PackageManagerUtils.isAppInstalled(context, GMS_PACKAGE) &&
PackageManagerUtils.isAppInstalled(context, GMS_SUW_PACKAGE)) {
PackageManagerUtils.isAppInstalled(context, gmsSuwPackage)) {
PackageManager packageManager = context.getPackageManager();
if (LOGV) {
Log.v(TAG, GMS_SUW_PACKAGE + " state = " +
packageManager.getApplicationEnabledSetting(GMS_SUW_PACKAGE));
packageManager.getApplicationEnabledSetting(gmsSuwPackage));
}
return packageManager.getApplicationEnabledSetting(GMS_SUW_PACKAGE) !=
return packageManager.getApplicationEnabledSetting(gmsSuwPackage) !=
COMPONENT_ENABLED_STATE_DISABLED;
}
return false;