Disable SetupWraith, the ATV SUW.

SetupWraith currently crashes after the finshed screen, causing
devices to remain unprovisioned.

Change-Id: I9f494158ea11210014eaec9faa48fddcedd968d4
This commit is contained in:
Aaron Kling
2017-06-21 18:11:58 -05:00
committed by Dan Pasanen
parent 33b449123d
commit 092d0fa892

View File

@@ -75,6 +75,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 SetupWizardUtils(){}
@@ -251,6 +252,13 @@ public class SetupWizardUtils {
if (!SetupWizardUtils.hasWifi(context)) {
disableComponent(context, WifiSetupActivity.class);
}
// Googles ATV SUW crashes before finishing, leaving devices
// unprovisioned. Disable it for now.
if (hasLeanback(context) &&
PackageManagerUtils.isAppInstalled(context, GMS_TV_SUW_PACKAGE)) {
disableApplication(context, GMS_TV_SUW_PACKAGE);
}
}
public static void disableComponentsForGMS(Context context) {
@@ -278,6 +286,11 @@ public class SetupWizardUtils {
return comp;
}
public static void disableApplication(Context context, String appname) {
context.getPackageManager().setApplicationEnabledSetting(appname,
COMPONENT_ENABLED_STATE_DISABLED, 0);
}
public static void disableComponentSets(Context context, int flags) {
setComponentListEnabledState(context, getComponentSets(context, flags),
COMPONENT_ENABLED_STATE_DISABLED);