diff options
author | dhacker29 <dhackerdvm@gmail.com> | 2015-04-23 01:30:19 -0400 |
---|---|---|
committer | dhacker29 <dhackerdvm@gmail.com> | 2015-04-23 02:31:51 -0400 |
commit | de06181c7e22364656fa5373afb1234c419c1b6b (patch) | |
tree | c03063ec9f48029fdd348228f30ee17aa8f2764b /src/com | |
parent | cfc4a0db6455d8d9429962b10de00ee02efacaee (diff) | |
download | packages_apps_SetupWizard-de06181c7e22364656fa5373afb1234c419c1b6b.zip packages_apps_SetupWizard-de06181c7e22364656fa5373afb1234c419c1b6b.tar.gz packages_apps_SetupWizard-de06181c7e22364656fa5373afb1234c419c1b6b.tar.bz2 |
WifiSetup: If device has Leanback feature specify tv.settings
Fugu has both com.android.settings and com.android.tv.settings so
currently it brings up a selector dialog for how to handle the wifi
intent, which leads to "Activity is launching as a new task, so
cancelling activity result." Fix this by passing the component name
in the intent if FEATURE_LEANBACK is present
Change-Id: I470590315d3f95a32b7796dd4a916a543392fcd6
Diffstat (limited to 'src/com')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java | 3 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java b/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java index a9574fd..63a9a0e 100644 --- a/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/WifiSetupPage.java @@ -222,6 +222,9 @@ public class WifiSetupPage extends SetupPage { private void launchWifiSetup() { SetupWizardUtils.tryEnablingWifi(mContext); Intent intent = new Intent(SetupWizardApp.ACTION_SETUP_WIFI); + if (SetupWizardUtils.hasLeanback(mContext)) { + intent.setComponent(SetupWizardUtils.mTvwifisettingsActivity); + } intent.putExtra(SetupWizardApp.EXTRA_FIRST_RUN, true); intent.putExtra(SetupWizardApp.EXTRA_ALLOW_SKIP, true); intent.putExtra(SetupWizardApp.EXTRA_USE_IMMERSIVE, true); diff --git a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java index d201080..5c4c981 100644 --- a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java +++ b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java @@ -225,4 +225,13 @@ public class SetupWizardUtils { context.getPackageManager().setComponentEnabledSetting(component, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP); } + + public static boolean hasLeanback(Context context) { + PackageManager packageManager = context.getPackageManager(); + return packageManager.hasSystemFeature(PackageManager.FEATURE_LEANBACK); + } + + public static final ComponentName mTvwifisettingsActivity = + new ComponentName("com.android.tv.settings", + "com.android.tv.settings.connectivity.setup.WifiSetupActivity"); } |