diff options
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; } |