[Huawei P9 Lite Guides, News, & Discussion] millo1978:
Navbar - hide virtual key

Tested on Android 6.0 (L21C432B170)

Settings

smali\com\android\settings\VirtualKeySettings.smali

.method private initVirtualKeyStatus()V
.locals 5

const/4 v1, 0x1

const/4 v2, 0x0

const-class v0, Lcom/android/settings/HwCustVirtualKeySettings;

new-array v3, v1, [Ljava/lang/Object;

aput-object p0, v3, v2

invoke-static {v0, v3}, Lcom/huawei/cust/HwCustUtils;->createObj(Ljava/lang/Class;[Ljava/lang/Object;)Ljava/lang/Object;

move-result-object v0

check-cast v0, Lcom/android/settings/HwCustVirtualKeySettings;

iput-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;

invoke-static {}, Lcom/android/settings/Utils;->isChinaArea()Z

move-result v0

if-eqz v0, :cond_22

iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;

if-eqz v0, :cond_2e

iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;

invoke-virtual {v0}, Lcom/android/settings/HwCustVirtualKeySettings;->isFrontFingerPrint()Z

move-result v0

if-eqz v0, :cond_2e

:cond_22
iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;

if-eqz v0, :cond_58

iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mHwCustVirtualKeySettings:Lcom/android/settings/HwCustVirtualKeySettings;

invoke-virtual {v0}, Lcom/android/settings/HwCustVirtualKeySettings;->isShowNavigationBarSwitch()Z

move-result v0

if-eqz v0, [B][COLOR="Red"]:cond_58[/COLOR][/B]

:cond_2e
const-string v0, "virtual_key"

invoke-virtual {p0, v0}, Lcom/android/settings/VirtualKeySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;

move-result-object v0

check-cast v0, Landroid/preference/SwitchPreference;

iput-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;

iget-object v3, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;

invoke-virtual {p0}, Lcom/android/settings/VirtualKeySettings;->getActivity()Landroid/app/Activity;

move-result-object v0

invoke-virtual {v0}, Landroid/app/Activity;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v0

const-string v4, "hide_virtual_key"

invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v0

if-lez v0, :cond_56

move v0, v1

:goto_4b
invoke-virtual {v3, v0}, Landroid/preference/SwitchPreference;->setChecked(Z)V

iget-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;

iget-object v1, p0, Lcom/android/settings/VirtualKeySettings;->mPreferenceChangedListener:Landroid/preference/Preference$OnPreferenceChangeListener;

invoke-virtual {v0, v1}, Landroid/preference/SwitchPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V

:goto_55
return-void

:cond_56
move v0, v2

goto :goto_4b

[B]:cond_58[/B]
const-string v0, "virtual_key"

invoke-virtual {p0, v0}, Lcom/android/settings/VirtualKeySettings;->[B]removePreference[/B](Ljava/lang/String;)V

const/4 v0, 0x0

iput-object v0, p0, Lcom/android/settings/VirtualKeySettings;->mSwitchPreference:Landroid/preference/SwitchPreference;

goto :goto_55
.end method

change :cond_58 with

if-eqz v0, [B][COLOR="DarkGreen"]:cond_2e[/COLOR][/B]

cond_2e show the toggle...

cond_58 remove the toggle.