diff options
author | cretin45 <cretin45@gmail.com> | 2015-05-07 16:21:10 -0700 |
---|---|---|
committer | cretin45 <cretin45@gmail.com> | 2015-05-08 11:44:34 -0700 |
commit | 7710855b726a921d7fd1e85aeeb4b20fee998923 (patch) | |
tree | a7203ba380b5189a47ae6cf25be9ffe3c46294d3 /src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java | |
parent | 4d08b90df38a90a0ec077412f92b0dabb594e056 (diff) | |
download | packages_apps_SetupWizard-7710855b726a921d7fd1e85aeeb4b20fee998923.zip packages_apps_SetupWizard-7710855b726a921d7fd1e85aeeb4b20fee998923.tar.gz packages_apps_SetupWizard-7710855b726a921d7fd1e85aeeb4b20fee998923.tar.bz2 |
SetupWizard: Add kill switch implementation
Change-Id: I1335cddf0dcc94eb8d2defeebdc47cb61abffd06
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java')
-rw-r--r-- | src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java index bdc3076..86906da 100644 --- a/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java +++ b/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java @@ -42,6 +42,7 @@ import android.view.IWindowManager; import android.view.View; import android.view.WindowManagerGlobal; import android.widget.CheckBox; +import android.widget.ImageView; import android.widget.TextView; import com.cyanogenmod.setupwizard.R; @@ -213,6 +214,9 @@ public class CyanogenSettingsPage extends SetupPage { public static class CyanogenSettingsFragment extends SetupPageFragment { + private View mKillSwitchView; + private TextView mKillSwitchTitle; + private ImageView mKillSwitchStatus; private View mMetricsRow; private View mDefaultThemeRow; private View mNavKeysRow; @@ -287,6 +291,21 @@ public class CyanogenSettingsPage extends SetupPage { privacyPolicy.setMovementMethod(LinkMovementMethod.getInstance()); privacyPolicy.setText(ss); + mKillSwitchView = mRootView.findViewById(R.id.killswitch); + mKillSwitchTitle = (TextView)mRootView.findViewById(R.id.killswitch_title); + mKillSwitchStatus = (ImageView)mRootView.findViewById(R.id.killswitch_check); + if (hideKillSwitch()) { + mKillSwitchView.setVisibility(View.GONE); + } else { + if (SetupWizardUtils.isDeviceLocked()) { + mKillSwitchTitle.setEnabled(true); + mKillSwitchStatus.setImageResource(R.drawable.tick); + } else { + mKillSwitchTitle.setEnabled(false); + mKillSwitchStatus.setImageResource(R.drawable.cross); + } + } + mMetricsRow = mRootView.findViewById(R.id.metrics); mMetricsRow.setOnClickListener(mMetricsClickListener); String metricsHelpImproveCM = @@ -414,5 +433,9 @@ public class CyanogenSettingsPage extends SetupPage { } } + private static boolean hideKillSwitch() { + return !SetupWizardUtils.hasKillSwitch(); + } + } } |