summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup
diff options
context:
space:
mode:
authorRoman Birg <roman@cyngn.com>2015-05-13 17:12:13 -0700
committerRoman Birg <roman@cyngn.com>2015-05-13 19:33:58 -0700
commitbfd3abd0c7ca81b5d4925356d353bf5b5cbfe408 (patch)
tree0cb9e078a845b8f1c6095ccb65d0fa35c872592e /src/com/cyanogenmod/setupwizard/setup
parent7710855b726a921d7fd1e85aeeb4b20fee998923 (diff)
downloadpackages_apps_SetupWizard-bfd3abd0c7ca81b5d4925356d353bf5b5cbfe408.zip
packages_apps_SetupWizard-bfd3abd0c7ca81b5d4925356d353bf5b5cbfe408.tar.gz
packages_apps_SetupWizard-bfd3abd0c7ca81b5d4925356d353bf5b5cbfe408.tar.bz2
SetupWizard: hide WhisperPush if it's not installed
Change-Id: I7576a2ee0f851e1222b6ed4d53188950b20b6a16 Signed-off-by: Roman Birg <roman@cyngn.com>
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
index 86906da..d751461 100644
--- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
+++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
@@ -22,6 +22,8 @@ import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
import android.content.pm.ThemeUtils;
import android.content.res.ThemeConfig;
import android.content.res.ThemeManager;
@@ -68,6 +70,8 @@ public class CyanogenSettingsPage extends SetupPage {
public static final String SETTING_METRICS = "settings.cyanogen.allow_metrics";
public static final String PRIVACY_POLICY_URI = "https://cyngn.com/oobe-legal?hideHeader=1";
+ private static final String WHISPERPUSH_PACKAGE = "org.whispersystems.whisperpush";
+
public CyanogenSettingsPage(Context context, SetupDataCallbacks callbacks) {
super(context, callbacks);
}
@@ -202,6 +206,14 @@ public class CyanogenSettingsPage extends SetupPage {
private static boolean hideWhisperPush(Context context) {
final int playServicesAvailable = GooglePlayServicesUtil
.isGooglePlayServicesAvailable(context);
+ try {
+ PackageInfo pi = context.getPackageManager().getPackageInfo(WHISPERPUSH_PACKAGE, 0);
+ if (pi == null) {
+ return true;
+ }
+ } catch (PackageManager.NameNotFoundException e) {
+ return true;
+ }
return playServicesAvailable != ConnectionResult.SUCCESS
|| !SetupWizardUtils.hasTelephony(context)
|| (SetupWizardUtils.hasTelephony(context) &&