diff options
author | cretin45 <cretin45@gmail.com> | 2016-04-27 12:38:53 -0700 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2016-04-27 12:39:52 -0700 |
commit | 635504813ac05e5b97e1dbbc14811b302baca32a (patch) | |
tree | 42b8a732d37b54e9f1e0ab3b2b37f2cb7b450f83 /src/com/cyanogenmod/setupwizard | |
parent | 81092777554443484cd871756ea22dfe2b841e82 (diff) | |
download | packages_apps_SetupWizard-635504813ac05e5b97e1dbbc14811b302baca32a.zip packages_apps_SetupWizard-635504813ac05e5b97e1dbbc14811b302baca32a.tar.gz packages_apps_SetupWizard-635504813ac05e5b97e1dbbc14811b302baca32a.tar.bz2 |
SetupWizard: Add Mod disovery language for mod ready devices
Issue-id: CYNGNOS-2566
Change-Id: If88d2d62b5d2175ffe857d45dd9f6ce132129f2a
Diffstat (limited to 'src/com/cyanogenmod/setupwizard')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/FinishPage.java | 14 | ||||
-rw-r--r-- | src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java | 11 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/FinishPage.java b/src/com/cyanogenmod/setupwizard/setup/FinishPage.java index fa25bd1..552403e 100644 --- a/src/com/cyanogenmod/setupwizard/setup/FinishPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/FinishPage.java @@ -16,13 +16,17 @@ package com.cyanogenmod.setupwizard.setup; +import android.app.Activity; import android.app.Fragment; import android.app.FragmentManager; import android.content.Context; import android.os.Bundle; +import android.view.View; +import android.widget.ImageView; import com.cyanogenmod.setupwizard.R; import com.cyanogenmod.setupwizard.ui.SetupPageFragment; +import com.cyanogenmod.setupwizard.util.SetupWizardUtils; public class FinishPage extends SetupPage { @@ -71,7 +75,15 @@ public class FinishPage extends SetupPage { public static class FinishFragment extends SetupPageFragment { @Override - protected void initializePage() {} + protected void initializePage() { + final Activity activity = getActivity(); + if (activity != null && SetupWizardUtils.canHasModMOD(activity)) { + ImageView imageView = (ImageView) mRootView.findViewById(R.id.brand_logo); + imageView.setImageResource(R.drawable.mod_ready); + mRootView.findViewById(R.id.mod_welcome).setVisibility(View.VISIBLE); + mRootView.findViewById(R.id.mod_desc).setVisibility(View.VISIBLE); + } + } @Override protected int getLayoutResource() { diff --git a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java index 119380b..b60449d 100644 --- a/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java +++ b/src/com/cyanogenmod/setupwizard/util/SetupWizardUtils.java @@ -27,8 +27,6 @@ import android.hardware.fingerprint.FingerprintManager; import android.net.ConnectivityManager; import android.net.NetworkInfo; import android.net.wifi.WifiManager; -import android.os.IBinder; -import android.os.ServiceManager; import android.os.UserHandle; import android.os.UserManager; import android.service.persistentdata.PersistentDataBlockManager; @@ -52,6 +50,7 @@ public class SetupWizardUtils { private static final String TAG = SetupWizardUtils.class.getSimpleName(); public static final String GOOGLE_SETUPWIZARD_PACKAGE = "com.google.android.setupwizard"; + private static final String MODMOD_PACKAGE = "com.cyanogen.ambient.core"; private SetupWizardUtils(){} @@ -199,6 +198,14 @@ public class SetupWizardUtils { ConnectionResult.SERVICE_MISSING; } + /** + * The assumption here is that if ambient core is present, we have MODs. + * In the future we will link against the SDK and use the util there. + */ + public static boolean canHasModMOD(Context context) { + return isPackageInstalled(context, MODMOD_PACKAGE); + } + public static boolean accountExists(Context context, String accountType) { return AccountManager.get(context).getAccountsByType(accountType).length > 0; } |