summaryrefslogtreecommitdiffstats
path: root/src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java')
-rw-r--r--src/com/cyanogenmod/setupwizard/setup/CyanogenSettingsPage.java23
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();
+ }
+
}
}