[Verizon Samsung Galaxy S 4] Didact74:
AOSP Lockscreen vibration toggle​

This will allow you to toggle on/off the vibration you feel when you touch the glow ring on the AOSP lockscreen.

We will work with two files:

SecSettings

framework2

Lets begin with SecSettings.

I use Rom Control for settings but you may not...you will need to use your own toggle code if you are not using Rom Control....

Navigate to res/values/strings and add the following

<string name="enable_aosp_vibrate">AOSP lockscreen vibration</string>
<string name="enable_aosp_vibrate_text">Vibrate selection on lockscreen</string>

Navigate to res/xnl/rom_settings and add the following:

<CheckBoxPreference android:title="@string/enable_aosp_vibrate" android:key="aosp_vibrate" android:summary="@string/enable_aosp_vibrate_text" />

Navigate to smali/com/android/settings/didact/RomSettings.smali

Add the following

.field mAospLockVibration:Landroid/preference/CheckBoxPreference;

The first line in the next two examples identifies the method to paste in, it will be in bold...dont copy that line in to your method

[B].method public onCreate(Landroid/os/Bundle;)V[/B]

:goto_0
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

const-string v1, "aosp_vibrate"

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

move-result-object v1

check-cast v1, Landroid/preference/CheckBoxPreference;

iput-object v1, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;

iget-object v4, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;

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

move-result-object v1

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

move-result-object v1

const-string v5, "aosp_vibrate"

invoke-static {v1, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v1

if-ne v1, v2, :cond_1

move v1, v2

:goto_1
invoke-virtual {v4, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V

[B].method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/Preference;)Z[/B]

:cond_2
iget-object v2, p0, Lcom/android/settings/didact/RomSettings;->mAospLockVibration:Landroid/preference/CheckBoxPreference;

if-ne p2, v2, :cond_4

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

move-result-object v2

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

move-result-object v2

const-string v3, "aosp_vibrate"

check-cast p2, Landroid/preference/CheckBoxPreference;

invoke-virtual {p2}, Landroid/preference/CheckBoxPreference;->isChecked()Z

move-result v4

if-eqz v4, :cond_3

move v0, v1

:cond_3
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z

goto :goto_0

Thats it for SecSettings. Next section will cover changes in framework2.jar.....

AOSP lockscreen vibration toggle part 2, framework2​

Navigate to smali/com/android/internal/widget/multiwaveview/GlowPadView.smali. .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V. Replace the code from :cond_8 to :goto_2 with the following

:cond_8
const/4 v7, 0x0

const/16 v8, 0x30

invoke-virtual {v0, v7, v8}, Landroid/content/res/TypedArray;->getInt(II)I

move-result v7

iput v7, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mGravity:I

invoke-virtual {v0}, Landroid/content/res/TypedArray;->recycle()V

iget-object v7, p0, Lcom/android/internal/widget/multiwaveview/GlowPadView;->mContext:Landroid/content/Context;

invoke-virtual {v7}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;

move-result-object v7

const-string v8, "aosp_vibrate"

const/4 v9, 0x0

invoke-static {v7, v8, v9}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I

move-result v8

if-eqz v8, :cond_9

const/4 v7, 0x1

:goto_2

Thats it. Recompile and push to your phone.

Thanks Button!!