Commit a8e278d0 authored by Bruno Martins's avatar Bruno Martins
Browse files

SetupWizard: Update for moved force show navbar setting

Change-Id: I8b883dcc078b314bc209cb5186a49c0e762a47dd
parent 33636d14
Pipeline #40163128 failed with stages
in 1 minute and 21 seconds
/*
* Copyright (C) 2016 The CyanogenMod Project
* Copyright (C) 2017 The LineageOS Project
* Copyright (C) 2017-2018 The LineageOS Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
......@@ -34,6 +34,7 @@ import android.graphics.Bitmap;
import android.graphics.Point;
import android.os.Bundle;
import android.os.Handler;
import android.os.UserHandle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.ViewAnimationUtils;
......@@ -210,8 +211,8 @@ public class FinishActivity extends BaseSetupWizardActivity {
private static void writeDisableNavkeysOption(Context context, boolean enabled) {
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
LineageSettings.Global.putInt(context.getContentResolver(),
LineageSettings.Global.DEV_FORCE_SHOW_NAVBAR, enabled ? 1 : 0);
LineageSettings.System.putIntForUser(context.getContentResolver(),
LineageSettings.System.FORCE_SHOW_NAVBAR, enabled ? 1 : 0, UserHandle.USER_CURRENT);
LineageHardwareManager hardware = LineageHardwareManager.getInstance(context);
hardware.set(LineageHardwareManager.FEATURE_KEY_DISABLE, enabled);
......
......@@ -27,6 +27,7 @@ import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.os.RemoteException;
import android.os.UserHandle;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.SpannableStringBuilder;
......@@ -190,8 +191,8 @@ public class LineageSettingsActivity extends BaseSetupWizardActivity {
private void updateDisableNavkeysOption() {
if (mSupportsKeyDisabler) {
final Bundle myPageBundle = mSetupWizardApp.getSettingsBundle();
boolean enabled = LineageSettings.Global.getInt(getContentResolver(),
LineageSettings.Global.DEV_FORCE_SHOW_NAVBAR, 0) != 0;
boolean enabled = LineageSettings.System.getIntForUser(getContentResolver(),
LineageSettings.System.FORCE_SHOW_NAVBAR, 0, UserHandle.USER_CURRENT) != 0;
boolean checked = myPageBundle.containsKey(DISABLE_NAV_KEYS) ?
myPageBundle.getBoolean(DISABLE_NAV_KEYS) :
enabled;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment