[MOD][HOW-TO] User Selectable Long Press Menu or Back to Kill - AT&T, Rogers, Bell, Telus Samsung Galaxy S III

This will allow users to select menu or back to kill apps in real time. No flashing, rebooting, etc.
This will not work with multiwindow.
We're going to be working with the following two files:
SecSettings.apk
android.policy.jar
KEY
REMOVE what's in BLUE
ADD what's in RED
SecSettings.apk
Navigate to /res/values/arrays.xml
Add the following to the end of the file
Code:
<string-array name="long_press_kill_entries">
<item>Back</item>
<item>Menu</item>
</string-array>
<string-array name="long_press_kill_values">
<item>0</item>
<item>1</item>
</string-array>
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="long_press_kill_title">Long Press to Kill Button</string>
<string name="long_press_kill_summary">%s</string>
Navigate to /xml/display_settings.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/display_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<PreferenceCategory android:title="@string/tts_general_section_title" />
<PreferenceScreen android:title="@string/wallpaper" android:key="wallpaper" android:fragment="com.android.settings.WallpaperSettings" />
<PreferenceScreen android:title="@string/led_indicator_settings" android:key="led_indicator_settings" android:fragment="com.android.settings.LedIndicatorSettings" />
<SwitchPreferenceScreen android:title="@string/page_buddy" android:key="contextualpage_settings" android:summary="@string/page_buddy_summary" android:fragment="com.android.settings.ContextualPageSettings" />
<PreferenceCategory android:title="@string/display_label" android:key="screen_category" />
<PreferenceScreen android:title="@string/screen_mode_setting" android:key="mode" android:summary="@string/screen_mode_summary">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.ModePreview" />
</PreferenceScreen>
<com.android.settings.BrightnessPreference android:title="@string/brightness" android:key="brightness" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/brightness" />
<CheckBoxPreference android:title="@string/accelerometer_title_second" android:key="accelerometer_second" />
<CheckBoxPreference android:title="@string/accelerometer_title" android:key="accelerometer" />
<ListPreference android:persistent="false" android:entries="@array/screen_timeout_entries" android:title="@string/screen_timeout" android:key="screen_timeout" android:summary="@string/screen_timeout_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/screen_timeout_values" />
<PreferenceScreen android:title="@string/screensaver_settings_title" android:key="screensaver" android:fragment="com.android.settings.DreamSettings" />
<CheckBoxPreference android:title="@string/brightness_slider_title" android:key="display_brightness_slider" android:summary="@string/brightness_slider_summary" />
<PreferenceCategory android:title="@string/features_category_title" android:key="features_category" />
<CheckBoxPreference android:title="@string/intelligent_rotation_title" android:key="intelligent_rotation" android:summary="@string/intelligent_rotation_summary" />
<CheckBoxPreference android:title="@string/intelligent_sleep_title" android:key="intelligent_sleep" android:summary="@string/intelligent_sleep_summary" />
<PreferenceCategory android:title="@string/font" />
<com.android.settings.flipfont.FontListPreference android:title="@string/monotype_preference_title" android:key="MONOTYPE" android:summary="@string/monotype_preference_summary" android:widgetLayout="@layout/round_more_icon" />
<com.android.settings.FontSizeListPreference android:entries="@array/entries_font_size" android:title="@string/title_font_size" android:key="font_size" android:summary="@string/summary_font_size" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/dialog_title_font_size" android:entryValues="@array/entryvalues_font_size" />
<PreferenceCategory android:title="@string/more_settings" android:key="more_settings" />
<ListPreference android:persistent="false" android:entries="@array/quick_launch_entries" android:title="@string/quick_launch_title" android:key="quick_launch" android:summary="@string/screen_quick_launch_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/quick_launch_values" />
<CheckBoxPreference android:title="@string/sub_lcd_auto_lock" android:key="sub_lcd_auto_lock" android:summary="@string/sub_lcd_auto_lock_summary" />
<CheckBoxPreference android:title="@string/key_night_mode" android:key="key_night_mode" />
<ListPreference android:persistent="false" android:entries="@array/key_backlight_entries" android:title="@string/key_backlight" android:key="key_backlight" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/key_backlight_values" />
<ListPreference android:persistent="false" android:entries="@array/touch_key_light_entries" android:title="@string/touch_key_light" android:key="touch_key_light" android:summary="@string/touch_key_light_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/touch_key_light_values" />
<CheckBoxPreference android:persistent="false" android:title="@string/display_saving" android:key="power_saving_mode" android:summary="@string/display_saving_mode_summary" />
<CheckBoxPreference android:persistent="false" android:title="@string/notification_pulse_title" android:key="notification_pulse" />
<CheckBoxPreference android:title="@string/edgezoom_title" android:key="edgezoom_toggle" android:summary="@string/edgezoom_summary" />
<com.loser.colorpicker.ColorPickerPreference android:persistent="false" android:title="@string/statusbar_color_title" android:key="statusbar_color" android:summary="@string/statusbar_color_summary" android:defaultValue="0xff000000" alphaSlider="true" />
<CheckBoxPreference android:title="@string/enable_ime_icon" android:key="enable_ime_icon" android:summary="@string/enable_ime_icon_text" />
[COLOR="Red"]<ListPreference android:persistent="false" android:entries="@array/long_press_kill_entries" android:title="@string/long_press_kill_title" android:key="long_press_kill" android:summary="@string/long_press_kill_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/long_press_kill_values" />[/COLOR]
<PreferenceCategory android:title="@string/battery_icon_category" android:key="battery_icon_category">
<ListPreference android:entries="@array/battery_icon_entries" android:title="@string/battery_icon" android:key="battery_icon_list" android:entryValues="@array/battery_icon_values" />
<CheckBoxPreference android:persistent="false" android:title="@string/display_battery_percentage" android:key="display_battery_level" android:summary="@string/display_battery_percentage_summary" />
<CheckBoxPreference android:title="@string/battery_notif_title" android:key="battery_notif" android:summary="@string/battery_notif_summary" />
</PreferenceCategory>
</PreferenceScreen>
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field private final mIntentReceiver:Landroid/content/BroadcastReceiver;
.field private mKeyBacklightmode:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field mLongPressKill:Landroid/preference/ListPreference;[/COLOR]
.field private mNotificationPulse:Landroid/preference/CheckBoxPreference;
.field private mPowerSavingMode:Landroid/preference/CheckBoxPreference;
method private updateState()V
Code:
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mTouchKeyLight:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "button_key_light"
const/16 v5, 0x5dc
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "long_press_kill"
const/16 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
invoke-virtual {v3}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V[/COLOR]
.line 809
iget-boolean v0, p0, Lcom/android/settings/DisplaySettings;->mSupportFolderType:Z
if-eqz v0, :cond_0
.line 810
invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateAccelerometerRotationSecondCheckbox()V
.line 811
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mAutoLockmode:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "sub_lcd_auto_lock"
method public onCreate(Landroid/os/BundleV
Code:
const-string v11, "font_size"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 394
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="red"]const-string v11, "long_press_kill"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
.line 398
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
if-eqz v11, :cond_6
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ
Code:
:catch_2
move-exception v0
.line 991
const-string v1, "DisplaySettings"
const-string v2, "could not persist Touch key light setting"
invoke-static {v1, v2, v0}, Landroid/util/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto/16 :goto_4
.line 993
:cond_9
[COLOR="red"]const-string v2, "long_press_kill"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_next
.line 986
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "long_press_kill"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 989
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mLongPressKill:Landroid/preference/ListPreference;
invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
goto/16 :goto_4
.line 993
:cond_next[/COLOR]
const-string v2, "quick_launch"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_a
.line 994
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
Now compile and move on to android.policy.jar.

android.policy.jar
Navigate to /smali/com/android/internal/policy/impl/PhoneWindowManager$SettingsObserver.smali
.method observe()V
Code:
const-string v1, "incall_power_button_behavior"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="Red"]const-string v1, "long_press_kill"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
.line 878
const-string v1, "accelerometer_rotation"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
Navigate to /smali/com/android/internal/policy/impl/PhoneWindowManager.smali
Code:
.field mAssistKeyLongPressed:Z
.field mBackLongPress:Ljava/lang/Runnable;
[COLOR="Red"].field mBackLongPressKill:Ljava/lang/Runnable;[/COLOR]
.field mBlockCollapseStatusBar:Z
.field mBootCompleteReceiver:Landroid/content/BroadcastReceiver;
Code:
.field mLongPressOnPowerBehavior:I
.field mLongPressVibePattern:[J
[COLOR="red"].field mLongPressKill:I[/COLOR]
.field mMenuLongPress:Ljava/lang/Runnable;
[COLOR="red"].field mMenuLongPressKill:Ljava/lang/Runnable;[/COLOR]
.field mMirrorLinkDockEnablesAccelerometer:Z
.field mMirrorLinkDockIntent:Landroid/content/Intent;
.method public constructor <init>()V
Code:
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$8;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$8;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
[COLOR="red"]new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$LongPressKill;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$LongPressKill;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPressKill:Ljava/lang/Runnable;[/COLOR]
.line 1494
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$9;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$9;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
[COLOR="red"] new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$LongPressKill;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$LongPressKill;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPressKill:Ljava/lang/Runnable;[/COLOR]
.line 1505
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$10;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$10;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mCameraLongPress:Ljava/lang/Runnable;
Add the following methods after .method static getAudioService()Landroid/media/IAudioService;
Code:
.method private getBackKillRunnable()Ljava/lang/Runnable;
.locals 1
.prologue
.line 69
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressKill:I
if-eqz v0, :cond_0
.line 70
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
.line 72
:goto_0
return-object v0
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPressKill:Ljava/lang/Runnable;
goto :goto_0
.end method
.method private getMenuKillRunnable()Ljava/lang/Runnable;
.locals 1
.prologue
.line 69
iget v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressKill:I
if-nez v0, :cond_0
.line 70
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
.line 72
:goto_0
return-object v0
:cond_0
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPressKill:Ljava/lang/Runnable;
goto :goto_0
.end method
.method public interceptKeyBeforeDispatching(Landroid/view/WindowManagerPolicy$WindowState;Landroid/view/KeyEvent;I)J
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v40, v0
move-object/from16 v0, p0
[COLOR="Blue"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
move-object/from16 v41, v0[/COLOR]
[COLOR="RED"]invoke-direct {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getMenuKillRunnable()Ljava/lang/Runnable;
move-result-object v41[/COLOR]
invoke-static {}, Landroid/view/ViewConfiguration;->getGlobalActionKeyTimeout()J
move-result-wide v42
invoke-virtual/range {v40 .. v43}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v40, v0
move-object/from16 v0, p0
[COLOR="blue"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mMenuLongPress:Ljava/lang/Runnable;
move-object/from16 v41, v0[/COLOR]
[COLOR="Red"]invoke-direct {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getMenuKillRunnable()Ljava/lang/Runnable;
move-result-object v41[/COLOR]
invoke-virtual/range {v40 .. v41}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v40, v0
move-object/from16 v0, p0
[COLOR="Blue"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
move-object/from16 v41, v0[/COLOR]
[COLOR="red"]invoke-direct {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getBackKillRunnable()Ljava/lang/Runnable;
move-result-object v41[/COLOR]
invoke-static {}, Landroid/view/ViewConfiguration;->getGlobalActionKeyTimeout()J
move-result-wide v42
invoke-virtual/range {v40 .. v43}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
Code:
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
move-object/from16 v40, v0
move-object/from16 v0, p0
[COLOR="Blue"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
move-object/from16 v41, v0[/COLOR]
[COLOR="Red"]invoke-direct {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getBackKillRunnable()Ljava/lang/Runnable;
move-result-object v41[/COLOR]
invoke-virtual/range {v40 .. v41}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
.method public updateSettings()V
Code:
const-string v19, "incall_power_button_behavior"
const/16 v20, 0x1
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
[COLOR="red"]const-string v19, "long_press_kill"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mLongPressKill:I[/COLOR]
.line 2006
.local v9, incallPowerBehavior:I
const-string v19, "user_rotation"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v17
Now download the file attached to this post and extract to your android.policy.jar folder.
That's it. Compile and test!

Thanks! Going to try this one tonight.
I really hate to ask this here but I'm not sure where to ask. So I've implemented 2 of your walkthroughs Loser. Brightness slider and the aosp mms and had good success. I know little and follow the walkthroughs to the t and learn that way. I could find a lot of your mods to just flash but I can't learn that way so... if I have questions I'm not really sure who to ask or if anyone wants to be bothered at all.
Are didact's mods, being from Verizon, exactly the same or is it different enough it requires more knowledge on my part ?
I just don't want to fill up the forums with my inane questions lol.
Thanks !
Sent from my SAMSUNG-SGH-I747 using xda premium

hednik said:
Thanks! Going to try this one tonight.
I really hate to ask this here but I'm not sure where to ask. So I've implemented 2 of your walkthroughs Loser. Brightness slider and the aosp mms and had good success. I know little and follow the walkthroughs to the t and learn that way. I could find a lot of your mods to just flash but I can't learn that way so... if I have questions I'm not really sure who to ask or if anyone wants to be bothered at all.
Are didact's mods, being from Verizon, exactly the same or is it different enough it requires more knowledge on my part ?
I just don't want to fill up the forums with my inane questions lol.
Thanks !
Sent from my SAMSUNG-SGH-I747 using xda premium
Click to expand...
Click to collapse
The current Verizon build, or the one that Didact uses is very similar to the AT&T build I use. You very rarely have to change any variables, just the public ID's. If you were to port to another device/build then it get's a little tricky and you need to have a general idea of smali.

awesome job man!
working on this now, for VZW, SecSettings.apk so far is working great, policy is giving me some trouble, I think I found a few mistakes in the tut
Navigate to /smali/com/android/settings/SoundSettings.smali
I think should be
Navigate to /smali/com/android/settings/DisplaySettings.smali
and I got a lil confused in .method public constructor <init>()V
I wasn't sure if I was suppose to add that in or replace it, I think it's suppose to be replaced, testing that now
thank you so much again!
not sure what I'm doing wrong but here is my policy.jar if u have time

andybones said:
awesome job man!
working on this now, for VZW, SecSettings.apk so far is working great, policy is giving me some trouble, I think I found a few mistakes in the tut
Navigate to /smali/com/android/settings/SoundSettings.smali
I think should be
Navigate to /smali/com/android/settings/DisplaySettings.smali
and I got a lil confused in .method public constructor <init>()V
I wasn't sure if I was suppose to add that in or replace it, I think it's suppose to be replaced, testing that now
thank you so much again!
not sure what I'm doing wrong but here is my policy.jar if u have time
Click to expand...
Click to collapse
Haha, Updated the DisplaySettings.smali. Looking at you android.policy now.
You're supposed to just add those lines. Don't remove the mBackLongPress and mMenuLongPress because we want each button to have two options, the regular option which is there by default and the new LongPressKill option. Hope that makes sense.

loserskater said:
Haha, Updated the DisplaySettings.smali. Looking at you android.policy now.
You're supposed to just add those lines. Don't remove the mBackLongPress and mMenuLongPress because we want each button to have two options, the regular option which is there by default and the new LongPressKill option. Hope that makes sense.
Click to expand...
Click to collapse
makes perfect sense , thank you Sir. not sure what I'm missing :/

andybones said:
makes perfect sense , thank you Sir. not sure what I'm missing :/
Click to expand...
Click to collapse
You forgot to change one of the mMenuLongPress lines. And for yours you need to change v41 to v44
Code:
invoke-direct {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getMenuKillRunnable()Ljava/lang/Runnable;
move-result-object [COLOR="Red"]v44[/COLOR]
So that and then add those other lines back in and you should be good to go.

This... Is... AWESOME!
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
7000 lemons? wtf!?!

got a "missing EOF at 'registers"
1990,4. I know the 1990 is the line # because I had one other error when I forgot to put in end of method. Added that and it went away but the the one above it still there. Any idea what to do ? Save redoing it ?

loserskater said:
You forgot to change one of the mMenuLongPress lines. And for yours you need to change v41 to v44
Code:
invoke-direct {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getMenuKillRunnable()Ljava/lang/Runnable;
move-result-object [COLOR="Red"]v44[/COLOR]
So that and then add those other lines back in and you should be good to go.
Click to expand...
Click to collapse
thank you Sir!
menu worked, but back doesn't :/
can you think of something I may have missed or done wrong, I did find that one line that u said i forgot

andybones said:
thank you Sir!
menu worked, but back doesn't :/
can you think of something I may have missed or done wrong, I did find that one line that u said i forgot
Click to expand...
Click to collapse
Can you build a new android.policy for me to look at?

loserskater said:
Can you build a new android.policy for me to look at?
Click to expand...
Click to collapse
absolutely, thank you soo much man!!

andybones said:
absolutely, thank you soo much man!!
Click to expand...
Click to collapse
Thanks for posting in the thread and not pm'ing me!
I'll take a look tonight after work.
Sent from my SAMSUNG-SGH-I747

loserskater said:
Thanks for posting in the thread and not pm'ing me!
I'll take a look tonight after work.
Sent from my SAMSUNG-SGH-I747
Click to expand...
Click to collapse
Haha def apologize about that, I actually saw that yesterday and was going to say something,

Got this working yesterday, sort of .
When I hit the home button it pulls up recent apps overlay but does go to the home menu as well. I get the menu option to show up and the pop up menu as well yet long press to kill doesn't work. I would since the rom boots and nothing force closes I haven't messed up too bad. I think something is a miss in the android policy jar files because (I assume) that is where I am mapping the buttons actions ?
The last steps where to delete in blue and add in red were a bit confusing but I checked and all looked well. Any ideas on how home could have gotten mapped to recents and the other issue ? Anything I can post to maybe help decipher ?
Thanks !

hednik said:
Got this working yesterday, sort of .
When I hit the home button it pulls up recent apps overlay but does go to the home menu as well. I get the menu option to show up and the pop up menu as well yet long press to kill doesn't work. I would since the rom boots and nothing force closes I haven't messed up too bad. I think something is a miss in the android policy jar files because (I assume) that is where I am mapping the buttons actions ?
The last steps where to delete in blue and add in red were a bit confusing but I checked and all looked well. Any ideas on how home could have gotten mapped to recents and the other issue ? Anything I can post to maybe help decipher ?
Thanks !
Click to expand...
Click to collapse
I could prob take a look at your policy.jar if you want. don't wanna step on loseskaters toes here though.

Well I got it working but then his selectable brightness toggle mod was there but it didn't select anything so.... I ditched that build and started new. I tried 5 times and just kept messing it up somehow. Might post it later. Thanks for then offer bones !
Sent from my SAMSUNG-SGH-I747 using xda premium

For those of us not even close to being able to do this, any chance of a flashable zip so I can add this to my current rom? I'm on intergalactic, with the on the fly battery mod and brightness slider toggle added.
Sent from my SAMSUNG-SGH-I747 using xda app-developers app

mis3 said:
For those of us not even close to being able to do this, any chance of a flashable zip so I can add this to my current rom? I'm on intergalactic, with the on the fly battery mod and brightness slider toggle added.
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
Click to expand...
Click to collapse
I'm sorry but that is not the intention of this tread. But if you want a flashable zip with this feature, follow the fist link in my Sig.
Sent from my SAMSUNG-SGH-I747 using xda premium

Related

[MOD][HOW-TO][2.0] Long press volume to skip tracks (the right way!)

This has been updated. Check out the new thread: http://forum.xda-developers.com/showthread.php?t=2254022
Now includes checkbox in settings to enable and disable!
Thanks to jakubklos for his diff file and getting me in the right direction.
And a HUGE thanks to the CM team.
CODE IN RED IS NEW!
CODE IN BLUE IS MODIFIED!
Some of your lines/variables may be different.
I've attached the original and modified files so you can diff them yourself!
First, decompile SecSettings.apk. If you're unsure how to do that you're going to have some pretty big issues ahead.
Navigate to res/values/strings.xml
and add the following to the end:
Code:
<string name="volbtn_music_controls_title">Volume rocker music controls</string>
<string name="volbtn_music_controls_summary">When screen off, long-pressing the volume rockers will seek music tracks</string>
Next navigate to res/xml/sound_settings.xml
and add the section in red:
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen android:title="@string/sound_settings" android:key="sound_settings"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:settings="http://schemas.android.com/apk/res/com.android.settings">
<com.android.settings.RingerVolumePreference android:persistent="false" android:title="@string/all_volume_title" android:key="ring_volume" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/all_volume_title" android:streamType="ring" />
<com.android.settings.VibrationFeedbackPreference android:title="@string/vibration_intensity" android:key="vibration_feedback_intensity" android:summary="" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/vibration_intensity" />
<PreferenceScreen android:title="@string/phone_profile" android:key="phone_profile" android:summary="@string/normal" android:fragment="com.android.settings.phoneprofile.PhoneProfileSettings" />
<Preference android:title="@string/musicfx_title" android:key="musicfx">
<intent android:targetPackage="com.android.musicfx" android:targetClass="com.android.musicfx.ControlPanelPicker" />
</Preference>
<PreferenceCategory android:title="@string/sound_category_calls_and_notification_title" android:key="category_calls_and_notification" />
<PreferenceScreen android:title="@string/download_ringtones" android:key="download_ringtone" android:summary="">
<intent android:action="android.intent.action.VIEW" android:data="http://waprd.telstra.com/redirect?target=3glatesttones" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/ringtone_title" android:key="ringtone" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/ringtone_title" android:ringtoneType="ringtone" />
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/voice_call_ringtone2" android:key="ringtone2" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/voice_call_ringtone2" android:ringtoneType="ringtone2" />
<PreferenceScreen android:title="@string/phone_vibration_title" android:key="phone_vibration" android:summary="@string/phone_vibration_summary" android:widgetLayout="@layout/round_more_icon">
<intent android:targetPackage="com.android.settings" android:action="android.intent.action.MAIN" android:targetClass="com.android.settings.personalvibration.SelectPatternDialog" />
</PreferenceScreen>
<com.android.settings.DefaultRingtonePreference android:persistent="false" android:title="@string/notification_sound_title" android:key="notification_sound" android:widgetLayout="@layout/round_more_icon" android:dialogTitle="@string/notification_sound_dialog_title" android:ringtoneType="notification" />
<CheckBoxPreference android:persistent="false" android:title="@string/vibrate_on_ring_title" android:key="vibrate_when_ringing" />
<PreferenceCategory android:title="@string/sound_category_system_title" />
<CheckBoxPreference android:title="@string/dtmf_tone_enable_title" android:key="dtmf_tone" android:defaultValue="true" android:summaryOn="@string/dtmf_tone_enable_summary_on" android:summaryOff="@string/dtmf_tone_enable_summary_off" />
<CheckBoxPreference android:title="@string/sound_effects_enable_title" android:key="sound_effects" android:defaultValue="true" android:summaryOn="@string/sound_effects_enable_summary_on" android:summaryOff="@string/sound_effects_enable_summary_off" />
<CheckBoxPreference android:title="@string/lock_sounds_enable_title" android:key="lock_sounds" android:defaultValue="true" android:summaryOn="@string/lock_sounds_enable_summary_on" android:summaryOff="@string/lock_sounds_enable_summary_off" />
<CheckBoxPreference android:title="@string/gps_notification_sounds_title" android:key="gps_notification_sounds" />
<CheckBoxPreference android:title="@string/haptic_feedback_enable_title" android:key="haptic_feedback" android:defaultValue="true" android:summaryOn="@string/haptic_feedback_enable_summary_on" android:summaryOff="@string/haptic_feedback_enable_summary_off" />
<SwitchPreferenceScreen android:title="@string/auto_haptic" android:key="autohaptic_settings" android:fragment="com.android.settings.autohaptic.AutoHapticSettings" />
<ListPreference android:entries="@array/emergency_tone_entries" android:title="@string/emergency_tone_title" android:key="emergency_tone" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/emergency_tone_values" />
[COLOR="Red"]<CheckBoxPreference android:persistent="false" android:title="@string/volbtn_music_controls_title" android:key="volbtn_music_controls" android:summary="@string/volbtn_music_controls_summary" />[/COLOR]
</PreferenceScreen>
Now let's get into some smail.
Open up com/android/settings/SoundSettings.smali
Code:
.field private mSoundSettings:Landroid/preference/PreferenceGroup;
.field private mUnloadSoundEffectRunnable:Ljava/lang/Runnable;
.field private mVibrateWhenRinging:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field private mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mVolume:Lcom/android/settings/RingerVolumePreference;
method onCreate:
Code:
const-string v18, "lockscreen_sounds_enabled"
const/16 v20, 0x1
move-object/from16 v0, v18
move/from16 v1, v20
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v18
if-eqz v18, :cond_f
const/16 v18, 0x1
:goto_6
move-object/from16 v0, v19
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 291
[COLOR="red"]const-string v18, "volbtn_music_controls"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v18
check-cast v18, Landroid/preference/CheckBoxPreference;
move-object/from16 v0, v18
move-object/from16 v1, p0
iput-object v0, v1, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v18, v0
const/16 v19, 0x0
invoke-virtual/range {v18 .. v19}, Landroid/preference/CheckBoxPreference;->setPersistent(Z)V
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
move-object/from16 v19, v0
const-string v18, "volbtn_music_controls"
const/16 v20, 0x1
move-object/from16 v0, v18
move/from16 v1, v20
invoke-static {v15, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v18
if-eqz v18, :cond_long
const/16 v18, 0x1
:goto_long
move-object/from16 v0, v19
move/from16 v1, v18
invoke-virtual {v0, v1}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V[/COLOR]
const-string v18, "ringtone"
move-object/from16 v0, p0
move-object/from16 v1, v18
invoke-virtual {v0, v1}, Lcom/android/settings/SoundSettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
Code:
:cond_d
const/16 v18, 0x0
goto/16 :goto_4
.line 280
:cond_e
const/16 v18, 0x0
goto/16 :goto_5
.line 288
:cond_f
const/16 v18, 0x0
goto/16 :goto_6
[COLOR="red"]:cond_long
const/16 v18, 0x0
goto/16 :goto_long[/COLOR]
.line 315
.restart local v17 #vibrator:Landroid/os/Vibrator;
:cond_11
invoke-virtual/range {p0 .. p0}, Lcom/android/settings/SoundSettings;->getActivity()Landroid/app/Activity;
move-result-object v18
invoke-static/range {v18 .. v18}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
method onPreferenceTreeClick:
Code:
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mLockSounds:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_e
:goto_8
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_e
move v0, v1
goto :goto_8
.line 640
:cond_f
[COLOR="red"]iget-object v2, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
if-ne p2, v2, :cond_next
.line 637
invoke-virtual {p0}, Lcom/android/settings/SoundSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "volbtn_music_controls"
iget-object v4, p0, Lcom/android/settings/SoundSettings;->mVolBtnMusicCtrl:Landroid/preference/CheckBoxPreference;
invoke-virtual {v4}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v4
if-eqz v4, :cond_long
:goto_long
invoke-static {v2, v3, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_1
:cond_long
move v0, v1
goto :goto_long
:cond_next[/COLOR]
iget-object v0, p0, Lcom/android/settings/SoundSettings;->mMusicFx:Landroid/preference/Preference;
if-ne p2, v0, :cond_0
goto/16 :goto_2
.end method
Now recompile SecSettings and the setting should be there. It won't do anything though.
Next we need to decompile android.policy.jar.
First file is com\android\internal\policy\impl\PhoneWindowManager$PolicyHandler.smali
Add another switch statement:
Code:
:pswitch_4
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
#calls: Lcom/android/internal/policy/impl/PhoneWindowManager;->enableSPenGesture()V
invoke-static {v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->access$300(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
goto :goto_0
[COLOR="red"]:pswitch_5
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v0, p1, Landroid/os/Message;->obj:Ljava/lang/Object;
check-cast v0, Landroid/view/KeyEvent;
const/16 v3, 0x01
invoke-static {v0, v3}, Landroid/view/KeyEvent;->changeAction(Landroid/view/KeyEvent;I)Landroid/view/KeyEvent;
move-result-object v0
invoke-virtual {v1, v0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->dispatchMediaKeyWithWakeLockToAudioService(Landroid/view/KeyEvent;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$PolicyHandler;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
const/4 v2, 0x1
iput-boolean v2, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
goto :goto_0[/COLOR]
.line 828
:pswitch_data_0
.packed-switch 0x1
:pswitch_0
:pswitch_1
:pswitch_2
:pswitch_3
:pswitch_4
[COLOR="red"]:pswitch_5[/COLOR]
.end packed-switch
.end method
Next: com\android\internal\policy\impl\PhoneWindowManager$SettingsObserver.smali
method observe:
Code:
const-string v1, "incall_power_button_behavior"
invoke-static {v1}, Landroid/provider/Settings$Secure;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
[COLOR="red"]const-string v1, "volbtn_music_controls"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V[/COLOR]
.line 878
const-string v1, "accelerometer_rotation"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {v0, v1, v2, p0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
Next: com\android\internal\policy\impl\PhoneWindowManager.smali
Code:
.field static final LONG_PRESS_POWER_NOTHING:I = 0x0
.field static final LONG_PRESS_POWER_SHUT_OFF:I = 0x2
[COLOR="Red"].field private static final LONG_PRESS_TIMEOUT:I = 0x190[/COLOR]
.field static final MINI_APP_DIALOG_LAYER:I = 0x5
.field static final MINI_APP_LAYER:I = 0x3
Code:
.field private mIsSensorhubEnabled:Z
.field private mIsVisibleSPenGestureView:Z
[COLOR="red"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z[/COLOR]
.field mKeyboardTapVibePattern:[J
.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;
Code:
.field mVoiceTalkDefaultLaunch:Z
.field mVoiceTalkIntent:Landroid/content/Intent;
[COLOR="red"].field mVolBtnMusicControls:I[/COLOR]
.field private mVolumeDownKeyConsumedByScreenshotChord:Z
method handleVolumeKey:
Code:
.method handleVolumeKey(II)V
.locals 5
[COLOR="red"]move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
if-nez v0, :cond_0
.line 4898
[COLOR="Red"]:cond_vc[/COLOR]
:goto_0
return-void
.line 4875
:cond_0
Add the following after the above method handleVolumeKey
Code:
[COLOR="Red"].method handleVolumeLongPress(Landroid/view/KeyEvent;)V
.locals 11
.parameter "event"
.prologue
const/4 v7, 0x0
.line 26
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 27
iput-boolean v7, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
.line 28
invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I
move-result v0
const/16 v1, 0x18
if-ne v0, v1, :cond_0
.line 29
const/16 v6, 0x57
.line 30
.local v6, newKeyCode:I
:goto_0
iget-object v9, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v10, 0x6
.line 31
new-instance v0, Landroid/view/KeyEvent;
invoke-virtual {p1}, Landroid/view/KeyEvent;->getDownTime()J
move-result-wide v1
invoke-virtual {p1}, Landroid/view/KeyEvent;->getEventTime()J
move-result-wide v3
invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I
move-result v5
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;->(JJIII)V
.line 30
invoke-virtual {v9, v10, v0}, Landroid/os/Handler;->obtainMessage(ILjava/lang/Object;)Landroid/os/Message;
move-result-object v8
.line 32
.local v8, msg:Landroid/os/Message;
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
sget v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->LONG_PRESS_TIMEOUT:I
int-to-long v1, v1
invoke-virtual {v0, v8, v1, v2}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 33
return-void
.line 29
.end local v6 #newKeyCode:I
.end local v8 #msg:Landroid/os/Message;
:cond_0
const/16 v6, 0x58
goto :goto_0
.end method
.method handleVolumeLongPressAbort()V
.locals 2
.prologue
.line 36
const/4 v0, 0x0
iput-boolean v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
.line 37
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
const/4 v1, 0x6
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeMessages(I)V
.line 38
return-void
.end method[/COLOR]
method interceptKeyBeforeQueueing:
This one's kind of hard to find so here's some extra lines before and after:
Code:
.line 5201
const/16 v23, 0x0
move/from16 v0, v23
move-object/from16 v1, p0
iput-boolean v0, v1, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownKeyConsumedByScreenshotChord:Z
.line 5202
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingPowerKeyAction()V
.line 5203
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->cancelPendingScreenrecordChordAction()V
.line 5204
invoke-direct/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->interceptScreenshotChord()V
.line 5246
:cond_1a
:goto_8
if-eqz v5, [COLOR="Blue"]:cond_long[/COLOR]
.line 5247
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getTelephonyService()Lcom/android/internal/telephony/ITelephony;
move-result-object v22
.line 5248
.local v22, telephonyService:Lcom/android/internal/telephony/ITelephony;
if-eqz v22, :cond_20
.line 5250
:try_start_0
invoke-interface/range {v22 .. v22}, Lcom/android/internal/telephony/ITelephony;->isRinging()Z
Code:
const-string v23, "WindowManager"
const-string v24, "ITelephony threw RemoteException"
move-object/from16 v0, v23
move-object/from16 v1, v24
invoke-static {v0, v1, v6}, Landroid/util/Log;->w(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
.line 5333
.end local v6 #ex:Landroid/os/RemoteException;
:cond_20
move-object/from16 v0, p0
[COLOR="Red"]iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_reg
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v21
if-eqz v21, :cond_reg
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_reg
move-object/from16 v0, p0
move-object/from16 v1, p1
invoke-virtual {v0, v1}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(Landroid/view/KeyEvent;)V
:cond_reg
move-object/from16 v0, p0[/COLOR]
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-nez v23, :cond_1
and a couple lines down:
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
const/16 v1, 0x1
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I
if-ne v0, v1, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
method updateSettings:
Code:
const-string v19, "incall_power_button_behavior"
const/16 v20, 0x1
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
[COLOR="red"]const-string v19, "volbtn_music_controls"
const/16 v20, 0x0
move-object/from16 v0, v19
move/from16 v1, v20
invoke-static {v13, v0, v1}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3[/COLOR]
.line 2006
const-string v19, "user_rotation"
Code:
iput v6, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mEndcallBehavior:I
.line 2028
move-object/from16 v0, p0
iput v9, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIncallPowerBehavior:I
[COLOR="red"]move-object/from16 v0, p0
iput v3, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolBtnMusicControls:I[/COLOR]
.line 2030
move-object/from16 v0, p0
iget v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mUserRotation:I
Newer Firmwares:(Sprint 4.1.2 MR2, etc.)
com\android\internal\policy\impl\PhoneWindowManager.smali
We need to edit one of the sections in method interceptKeyBeforeQueueing.
Remove the code in purple and add the code in green.
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
[COLOR="Purple"]invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V[/COLOR]
[COLOR="Green"]iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, v3, v15}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->handleVolume(II)V[/COLOR]
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
com\android\internal\policy\impl\PhoneWindowManager$SamsungVolumeControlThread.smali
method handleVolume:
Code:
.method handleVolume(II)V
.locals 6
[COLOR="Red"]iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_vc[/COLOR]
iget-object v3, p0, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->this$0:Lcom/android/internal/policy/impl/PhoneWindowManager;
iget-object v3, v3, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const-string v4, "audio"
invoke-virtual {v3, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/media/AudioManager;
if-nez v0, :cond_0
[COLOR="red"]:cond_vc[/COLOR]
:goto_0
return-void
:cond_0
:try_start_0
invoke-virtual {v0}, Landroid/media/AudioManager;->dismissVolumePanel()V
sparse-switch p2, :sswitch_data_0
goto :goto_0
ISSUES:
Pressing volume up or down both turn the volume down(or up):
Looking at a little bit more from the last entry:
Code:
move-object/from16 v23, v0
invoke-virtual/range {v23 .. v23}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->start()V
goto/16 :goto_2
.line 5341
.end local v22 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Blue"]:cond_long[/COLOR]
[COLOR="Red"]if-nez v5, :cond_vc
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_vc
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPressAbort()V
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
if-nez v0, :cond_vc
move-object/from16 v0, p0
const/4 v3, 0x0
invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_vc[/COLOR]
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
if-eqz v23, :cond_1
.line 5342
move-object/from16 v0, p0
iget-object v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mSamsungVolumeControlThread:Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;
move-object/from16 v23, v0
move-object/from16 v0, v23
invoke-virtual {v0, [COLOR="Orange"]v15[/COLOR], v5, v4}, Lcom/android/internal/policy/impl/PhoneWindowManager$SamsungVolumeControlThread;->updateInfo(IZZ)V
Pull the variable in orange from the last line and replace the variable in line
Code:
invoke-virtual {v0, v3, [COLOR="orange"]v15[/COLOR]}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
Make sure you're not replacing the last line with anything, but using it as reference.
Cool
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
This is great! made the changes and everything is running great.
Sent you a donation, Cheers! have a beer on me *Happy New Year!*
Thanks for all your hard work it is much appreciated
enewman17 said:
This is great! made the changes and everything is running great.
Sent you a donation, Cheers! have a beer on me *Happy New Year!*
Thanks for all your hard work it is much appreciated
Click to expand...
Click to collapse
Did you use the cond's in green? Or did you just replace the file?
loserskater said:
Did you use the cond's in green? Or did you just replace the file?
Click to expand...
Click to collapse
I did not use the cond's in green, I manually made the changes excluding them.
I am curious now if it will work using those cond's I will try it later. I'm just so happy you were able to get it working! and well!
I had problems compiling it with apktool after I made the changes, but doing it manually worked and now apktool will compile and decompile without error. I don't get it.
I've only tested it with the stock player and google play music and it works perfectly. I don't use anything else so i didn't test.
enewman17 said:
I did not use the cond's in green, I manually made the changes excluding them.
I am curious now if it will work using those cond's I will try it later. I'm just so happy you were able to get it working! and well!
I had problems compiling it with apktool after I made the changes, but doing it manually worked and now apktool will compile and decompile without error. I don't get it.
I've only tested it with the stock player and google play music and it works perfectly. I don't use anything else so i didn't test.
Click to expand...
Click to collapse
What showed up with apktool? It's possible you missed a cond somewhere...
loserskater said:
What showed up with apktool? It's possible you missed a cond somewhere...
Click to expand...
Click to collapse
I don't remember, something like false value blah blah...
I diff'ed the the files using win merge and they are exactly the same. It's not the first time it's happened to me seem's like it's the way notepad++ saves the file... maybe.... I had more problems using getdiz as a text editor. I don't know maybe it's me. But I do know it works.
When I changed the sound file in the SecContacts to get rid of the water drop sound from the dial pad I could not get apktool to compile it for the life of me, If I put the original sound back, apktool worked. Used manual commands and poof it worked like some sort of fairy magic. It was really starting to annoy me, but persistence pays off. Now apktool will decompile and compile my modded SecContacts with no problem. Also had the same problem when editing the SecPhone to get rid of the increasing ringtone. Same false value error. did it manually and it worked but I kind of figured it would happen cause that mod is kind of hacky to begin with, I didn't delete the lines for that mod, but rather omitted those lines with a #
Thanks for sharing man. Works great with both att and tmo!:good:
Thanks! Will be trying this soon.
First of all, thank you for this Tutorial. I'll try it now since a few hours, but it won't recompile. I'll tried it with the green ones and without it. Apktool gives me this errors:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Drücken Sie eine beliebige Taste . . .
Maybe someone have an idea. Thank you (=
hells
hellsgod said:
First of all, thank you for this Tutorial. I'll try it now since a few hours, but it won't recompile. I'll tried it with the green ones and without it. Apktool gives me this errors:
I: Checking whether sources has changed...
I: Smaling...
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: [email protected]
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:64)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:48)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:35)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:243)
at brut.androlib.Androlib.buildSources(Androlib.java:200)
at brut.androlib.Androlib.build(Androlib.java:191)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Drücken Sie eine beliebige Taste . . .
Maybe someone have an idea. Thank you (=
hells
Click to expand...
Click to collapse
I had trouble too, if your sure the changes you made are right you'll have to take the android.policy and manually decompile the dex file make the changes and recompile it again using smali commands. It should work and not give you any errors just using smali and baksmali
noob question here, Will this be avaliable in a flashable form? Im not familiar with decompiling but would really love this feature on my current rom
best thing to do when working with smalis is to drag the classes.dex out of the apk file such as systemui.apk & secsettings.apk and so forth and use a baksmali/smali tool and it'll decompile just the smalis rather then the whole apk and then causing a fuss later when compiling it.. Once thats done compile the classes.dex with ur edits done and then drag it back to apk & push to system and profit ..
svfreddy said:
noob question here, Will this be avaliable in a flashable form? Im not familiar with decompiling but would really love this feature on my current rom
Click to expand...
Click to collapse
I'll make a couple flashable zips for lk4 and lk3
loserskater said:
I'll make a couple flashable zips for lk4 and lk3
Click to expand...
Click to collapse
Thanks!!
Sent from my SPH-L710 using xda app-developers app
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Unknownforce said:
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Click to expand...
Click to collapse
Here from the Sprint GS III forums as unknownforce was able to convert your work to function for us Sprint folks. Just wanted to say thank you loserskater for your hard work on this and for getting this working. I have been waiting for this forever since upgrading to 4.1
Thanks loserskater and also thanks unknownforce,
Whiteice
Unknownforce said:
Thanks, I fixed ours using this in the Sprint section (here).
But just an FYI, I used WinMerge to check diff's between your org and mod, and it looks like you changed a bunch of :cond's towards the end which was unnecessary.
Here is the last part that is needed to change:
http://i16.photobucket.com/albums/b38/Migs351/first_zps538afb44.jpg
And here is where some of the unnecessary changes are:
http://i16.photobucket.com/albums/b38/Migs351/second_zps05e5de7c.jpg
For some reason you increased all the :cond's by 2, which doesn't actually change anything, as this is just a "label" for the if statements to goto if the statement returns true.
Just thought I'd point that out.
But other than that, nice job! No more need for those extra files. Simple code modification.
I'm curious though, for my own sanity anyways, what's the main difference here between the this mod and the original mod. (which didn't work, properly, in JB) I know the original one sent the MEDIA_NEXT and MEDIA_PREVIOUS keys to the system, and this was getting interpreted incorrectly and being sent to the default Media Player, regardless of what currently had Audio Focus.
What does this one use as it's method of changing the tracks, something more direct, or does it tap into another type of Media key?
I could go through the code and figure it out, but I'm too lazy right now.
Click to expand...
Click to collapse
That's why I added the conds in green so you don't have to change all of the ones after. But if you add the 21 and 22 you'll have multiple instances which throws errors when trying to compile.
The difference between this and the previous mod is that sending the media button presses would send an ordered broadcast and the app with the highest priority would take the broadcast and see if it needed it and then pass it along if it didn't. Well must audio apps haven't been updated to use this method. And if you changed it to just broadcast instead of offered all media players would get the broadcast do you'd have a bunch of apps trying to all play music. This uses private apis that that only the system can use and it's the same method the lockscreen controls use which is controlled by the audio service instead of broadcasts. I hope that all makes sense
loserskater said:
That's why I added the conds in green so you don't have to change all of the ones after. But if you add the 21 and 22 you'll have multiple instances which throws errors when trying to compile.
The difference between this and the previous mod is that sending the media button presses would send an ordered broadcast and the app with the highest priority would take the broadcast and see if it needed it and then pass it along if it didn't. Well must audio apps haven't been updated to use this method. And if you changed it to just broadcast instead of offered all media players would get the broadcast do you'd have a bunch of apps trying to all play music. This uses private apis that that only the system can use and it's the same method the lockscreen controls use which is controlled by the audio service instead of broadcasts. I hope that all makes sense
Click to expand...
Click to collapse
Oh! Yeah, the "named" method should work for most compilers, I don't see why it wouldn't, but I got it now.
Makes perfect sense, thanks for explaining. This makes for a much cleaner and friendlier method of doing it too, nice.
Is this only for Touchwiz?

[MOD][HOW-TO]Real Time Clock and Statusbar Colors (Clock Statusbar Mod 3.0){06-01-13}

This is an expansion on Didact's mods, so if you haven't already, you MUST implement his clock mod found here:
[MOD][GUIDE] Clock Statusbar Mod v2.0
It would help, but is not necessary to implement Didact's statusbar transparency mod found here:
[MOD][GUIDE] Real Time Statusbar Transparency Settings
I used the open source ColorPickerPreference found HERE
Note:
While you're going through SecSettings, you can remove everything involving statusbar transparency as the new mod has a color picker with an alpha (transparency) bar.
I've added the necessary code if you haven't implemented the transparency setting. It's only code in SystemUI.apk, so you don't need to change anything in SecSettings.apk.
What do these mods cover?
Added Left Clock
Fixed overlapping notifications on Center Clock
Change the color of the clock no matter the location
Change the color of the statusbar (transparency still works!)
We're going to be working with the following two files:
SecSettings.apk
SystemUI.apk
KEY
REMOVE what's in BLUE
ADD what's in RED
MODIFY what's in GREEN
Updates:
6-01-13
Updated ColorPicker so it keeps your color instead of reverting it when you leave and come back to the menu.
Moved all clock stuff to Display Settings to make it easier to change clock and statusbar color together.
You can revert your date_time_prefs.xml and DateTimeSettings.smali
Fixed issues with center/left clock causing the device/SystemUI to freeze when screen is turned off.
4-15-13
I've now added a ColorPicker so you can set any color/transparency you want!
Added code if you haven't implemented Didact's transparency mod.
First up, SecSettings.apk
Navigate to /res/values/arrays.xml
Code:
<string-array name="clock_style_entries">
<item>Right clock</item>
<item>Center clock</item>[COLOR="Red"]
<item>Left clock</item>[/COLOR]
<item>No clock</item>
</string-array>
<string-array name="clock_style_values">
<item>1</item>
<item>2</item>[COLOR="red"]
<item>3</item>[/COLOR]
<item>0</item>
</string-array>
Navigate to /res/values/ids.xml
Code:
[COLOR="Red"]<item type="id" name="color_picker_view">false</item>
<item type="id" name="old_color_panel">false</item>
<item type="id" name="new_color_panel">false</item>[/COLOR]
Next navigate to /res/values/strings.xml
Code:
[COLOR="red"]<string name="clock_cat">Clock options</string>
<string name="clock_color_title">Clock Color</string>
<string name="clock_color_summary">Change the color of the clock</string>
<string name="statusbar_color_title">Statusbar Color</string>
<string name="statusbar_color_summary">Change the color of the statusbar</string>
<string name="dialog_color_picker">Color Picker</string>
<string name="press_color_to_apply">Press on Color to apply</string>[/COLOR]
Navigate to /res/xml/display_settings.xml
Add the following wherever you would like it to show up in the menu
Code:
<com.loser.colorpicker.ColorPickerPreference android:persistent="false" android:title="@string/statusbar_color_title" android:key="statusbar_color" android:summary="@string/statusbar_color_summary" android:defaultValue="0xff000000" alphaSlider="true" />
<PreferenceCategory android:title="@string/clock_cat" android:key="clock_category" />
<ListPreference android:entries="@array/clock_style_entries" android:title="@string/clock_title_enable" android:key="clock_style" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/clock_style_values" />
<ListPreference android:entries="@array/clock_ampm_entries" android:title="@string/title_clock_ampm_entries" android:key="clock_am_pm_style" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/clock_ampm_values" />
<ListPreference android:entries="@array/clock_weekday_entries" android:title="@string/enable_clock_weekday" android:key="clock_weekday" android:summary="@string/enable_clock_weekday_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/clock_weekday_values" />
<com.loser.colorpicker.ColorPickerPreference android:persistent="false" android:title="@string/clock_color_title" android:key="clock_color" android:summary="@string/clock_color_summary" android:defaultValue="0xffffffff" alphaSlider="true" />
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field private mBrightnessPreference:Lcom/android/settings/BrightnessPreference;
.field private mBrightnessSliderPreference:Landroid/preference/CheckBoxPreference;
[COLOR="Red"].field mClockAmPmstyle:Landroid/preference/ListPreference;
.field mClockColor:Lcom/loser/colorpicker/ColorPickerPreference;
.field mClockStyle:Landroid/preference/ListPreference;
.field mClockWeekday:Landroid/preference/ListPreference;[/COLOR]
.field private mContextualPage:Landroid/preference/SwitchPreferenceScreen;
.field protected mContextualPageUncheckerHandler:Landroid/os/Handler;
Code:
.field private mSmartRotationAnimationImage:[I
.field private mSmartStayAnimationImage:[I
[COLOR="red"].field mStatusbarColor:Lcom/loser/colorpicker/ColorPickerPreference;[/COLOR]
.field mSupportFolderType:Z
.field private mTouchKeyLight:Landroid/preference/ListPreference;
.method private updateState()V
There's two sections here, make sure you scroll to the bottom.
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "display_battery_percentage"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_4
move v0, v1
:goto_1
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mStatusbarColor:Lcom/loser/colorpicker/ColorPickerPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "statusbar_color"
const v5, -0xffffff
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
const/16 v5, 0x0
invoke-virtual {v0, v5, v3}, Lcom/loser/colorpicker/ColorPickerPreference;->onSetInitialValue(ZLjava/lang/Object;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockColor:Lcom/loser/colorpicker/ColorPickerPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "clock_color"
const v5, -0x000000
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v3
const/16 v5, 0x0
invoke-virtual {v0, v5, v3}, Lcom/loser/colorpicker/ColorPickerPreference;->onSetInitialValue(ZLjava/lang/Object;)V[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mTouchKeyLight:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "button_key_light"
const/16 v5, 0x5dc
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockStyle:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "clock_style"
const/16 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "clock_am_pm_style"
const/16 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockWeekday:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "clock_weekday"
const/16 v5, 0x0
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V[/COLOR]
.line 809
iget-boolean v0, p0, Lcom/android/settings/DisplaySettings;->mSupportFolderType:Z
if-eqz v0, :cond_0
.line 854
invoke-direct {p0}, Lcom/android/settings/DisplaySettings;->updateAccelerometerRotationSecondCheckbox()V
.method public onCreate(Landroid/os/BundleV
Code:
const-string v11, "font_size"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 409
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="red"]const-string v11, "statusbar_color"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Lcom/loser/colorpicker/ColorPickerPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mStatusbarColor:Lcom/loser/colorpicker/ColorPickerPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mStatusbarColor:Lcom/loser/colorpicker/ColorPickerPreference;
const-string v11, "clock_color"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Lcom/loser/colorpicker/ColorPickerPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockColor:Lcom/loser/colorpicker/ColorPickerPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockColor:Lcom/loser/colorpicker/ColorPickerPreference;
invoke-virtual {v11, p0}, Lcom/loser/colorpicker/ColorPickerPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
const-string v11, "clock_style"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockStyle:Landroid/preference/ListPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockStyle:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
const-string v11, "clock_am_pm_style"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
const-string v11, "clock_weekday"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockWeekday:Landroid/preference/ListPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mClockWeekday:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
.line 398
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ
Code:
:catch_2
move-exception v0
.line 1038
const-string v1, "DisplaySettings"
const-string v2, "could not persist Touch key light setting"
invoke-static {v1, v2, v0}, Landroid/util/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto/16 :goto_4
.line 1040
:cond_9
[COLOR="red"]const-string v2, "statusbar_color"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_stat
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
const-string v1, "^#"
const-string v3, ""
invoke-virtual {v2, v1, v3}, Ljava/lang/String;->replaceFirst(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v1
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "statusbar_color"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4
:cond_stat
const-string v2, "clock_am_pm_style"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_ampm
.line 986
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "clock_am_pm_style"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 989
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mClockAmPmstyle:Landroid/preference/ListPreference;
invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
goto/16 :goto_4
.line 993
:cond_ampm
const-string v2, "clock_style"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_style
.line 986
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "clock_style"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 989
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mClockStyle:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockStyle:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mClockStyle:Landroid/preference/ListPreference;
invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
goto/16 :goto_4
.line 993
:cond_style
const-string v2, "clock_weekday"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_week
.line 986
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "clock_weekday"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
.line 989
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mClockWeekday:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mClockWeekday:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mClockWeekday:Landroid/preference/ListPreference;
invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
goto/16 :goto_4
.line 993
:cond_week
const-string v2, "clock_color"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_color
invoke-static {p2}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;
move-result-object v2
const-string v1, "^#"
const-string v3, ""
invoke-virtual {v2, v1, v3}, Ljava/lang/String;->replaceFirst(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
move-result-object v3
invoke-static {v3}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v1
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v2
const-string v3, "clock_color"
invoke-static {v2, v3, v1}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4
:cond_color[/COLOR]
const-string v2, "quick_launch"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
Now download the zip attached to this post and copy the smali and res folders. It should merge but not overwrite anything.
Now you're going to need to get some ids!!! Compile and then decompile.
Open /smali/com/loser/colorpicker/ColorPickerDialog.smali
There should be a total of 6 id's you need to get. Make sure you're looking at the type as there's a layout and string with the same name.
Look for them in /res/values/public.xml. You should now be good to go.
Now for SystemUI.apk
Navigate to /res/layout/tw_status_bar.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.PhoneStatusBarView android:orientation="vertical" android:id="@id/status_bar" android:background="@drawable/status_bar_background" android:focusable="true" android:fitsSystemWindows="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<ImageView android:id="@id/notification_lights_out" android:paddingLeft="6.0dip" android:paddingBottom="2.0dip" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/ic_sysbar_lights_out_dot_small" android:scaleType="center" />
[COLOR="SeaGreen"]<RelativeLayout android:id="@id/icons" android:paddingLeft="0.0dip" android:paddingRight="2.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent">[/COLOR]
[COLOR="Red"]<com.android.systemui.statusbar.policy.ClockLeft android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff9a9a9a" android:ellipsize="none" android:gravity="left|center" android:id="@id/left_clock" android:paddingLeft="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" android:layout_alignParentLeft="true" />[/COLOR]
[COLOR="SeaGreen"]<LinearLayout android:orientation="horizontal" android:id="@id/left_icons" android:paddingLeft="4.0dip" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_toLeftOf="@id/center_clock" android:layout_toRightOf="@id/left_clock" android:layout_alignWithParentIfMissing="true">[/COLOR]
<TextView android:textSize="15.0dip" android:gravity="center_vertical" android:id="@id/carrierLabel" android:visibility="visible" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" />
<ImageView android:id="@id/operatorLogoIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/tw_stat_notify_operator_logo" />
<ImageView android:id="@id/doNotDisturbIcon" android:visibility="gone" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/tw_dnd" android:alpha="0.7" android:scaleX="0.85" android:scaleY="0.85" />
<com.android.systemui.statusbar.StatusBarIconView android:id="@id/moreIcon" android:visibility="gone" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="fill_parent" android:src="@drawable/stat_notify_more" />
<com.android.systemui.statusbar.phone.IconMerger android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/notificationIcons" android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_alignParentLeft="true" />
</LinearLayout>
[COLOR="Red"]<com.android.systemui.statusbar.policy.ClockCenter android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff9a9a9a" android:ellipsize="none" android:gravity="left|center" android:id="@id/center_clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_centerInParent="true" />[/COLOR]
<LinearLayout android:orientation="horizontal" android:id="@id/right_icons" android:paddingRight="4.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:layout_alignParentRight="true">
<LinearLayout android:gravity="center_vertical" android:orientation="horizontal" android:id="@id/statusIcons" android:layout_width="wrap_content" android:layout_height="fill_parent" />
<LinearLayout android:gravity="center" android:orientation="horizontal" android:id="@id/signal_battery_cluster" android:paddingLeft="2.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent">
<include android:id="@id/signal_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/tw_signal_cluster_view" />
<include android:id="@id/battery_cluster" android:layout_width="wrap_content" android:layout_height="wrap_content" layout="@layout/battery_cluster_view" />
<TextView android:textSize="18.0dip" android:textColor="#ff9a9a9a" android:layout_gravity="center" android:id="@id/battery_text" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/status_bar_network_name_separator" />
<ImageView android:gravity="center" android:id="@id/battery" android:layout_width="wrap_content" android:layout_height="wrap_content" />
</LinearLayout>
<com.android.systemui.statusbar.policy.Clock android:textSize="@dimen/status_bar_clock_text_size" android:textColor="#ff9a9a9a" android:ellipsize="none" android:gravity="left|center" android:id="@id/clock" android:paddingLeft="3.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:includeFontPadding="false" />
</LinearLayout>
[COLOR="SeaGreen"]</RelativeLayout>[/COLOR]
<LinearLayout android:orientation="horizontal" android:id="@id/ticker" android:paddingLeft="6.0dip" android:animationCache="false" android:layout_width="fill_parent" android:layout_height="fill_parent">
<ImageSwitcher android:id="@id/tickerIcon" android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:layout_marginRight="4.0dip">
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
<com.android.systemui.statusbar.AnimatedImageView android:layout_width="@dimen/status_bar_icon_size" android:layout_height="@dimen/status_bar_icon_size" android:scaleType="centerInside" />
</ImageSwitcher>
<com.android.systemui.statusbar.phone.TickerView android:id="@id/tickerText" android:paddingTop="2.0dip" android:paddingRight="10.0dip" android:layout_width="0.0dip" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_old" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
<TextView android:textAppearance="@style/TextAppearance.StatusBar.PhoneTicker" android:id="@id/ticker_text_view_new" android:layout_width="fill_parent" android:layout_height="wrap_content" android:singleLine="true" />
</com.android.systemui.statusbar.phone.TickerView>
</LinearLayout>
</com.android.systemui.statusbar.phone.PhoneStatusBarView>
Navigate to /red/values/ids.xml
Remove the line in blue and add the line in red:
Code:
[COLOR="Blue"]<item type="id" name="center_clock_layout">false</item>[/COLOR]
[COLOR="Red"]<item type="id" name="left_clock">false</item>[/COLOR]
STOP!!!!
STOP!!!!
We need to grab some IDs before we continue.
Try to compile. If it fails, try adding in the blue line from the step above (center_clock_layout).
Now decompile again and navigate to /res/values/public.xml.
Search for the following three ID's:
(Make sure you're getting the ones with type="id")
Code:
clock
center_clock
left_clock
Now copy the id's somewhere.
Ok, let's continue...
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
Code:
.field private mCarrierLabelHeight:I
.field private mCarrierLabelVisible:Z
[COLOR="Blue"]
.field mCenterClockLayout:Landroid/widget/LinearLayout;
[/COLOR]
.field mChoreographer:Landroid/view/Choreographer;
.field mClearButton:Landroid/view/View;
method makeStatusBarView:
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d0035
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Landroid/widget/LinearLayout;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIcons:Landroid/widget/LinearLayout;
[COLOR="blue"]iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d0121
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v9
check-cast v9, Landroid/widget/LinearLayout;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCenterClockLayout:Landroid/widget/LinearLayout;[/COLOR]
.line 622
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d003e
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v9
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerView:Landroid/view/View;
method showClock
REPLACE THE ENTIRE METHOD WITH THIS:
Code:
.method public showClock(Z)V
.locals 11
.parameter "show"
.prologue
const/16 v8, 0x8
const/4 v7, 0x0
const/4 v6, 0x1
.line 146
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
if-nez v9, :cond_1
.line 165
:cond_0
:goto_0
return-void
.line 147
:cond_1
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d003f # "clock"
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v2
.line 148
.local v2, clock:Landroid/view/View;
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d0124 # "center_clock"
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v0
.line 149
.local v0, cclock:Landroid/view/View;
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d0123 # "left_clock"
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v3
.line 150
.local v3, lclock:Landroid/view/View;
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v9}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v9
const-string v10, "clock_style"
invoke-static {v9, v10, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
if-ne v9, v6, :cond_4
move v5, v6
.line 152
.local v5, rightClock:Z
:goto_1
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v9}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v9
const-string v10, "clock_style"
invoke-static {v9, v10, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
.line 153
const/4 v10, 0x2
.line 152
if-ne v9, v10, :cond_5
move v1, v6
.line 154
.local v1, centerClock:Z
:goto_2
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v9}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v9
const-string v10, "clock_style"
invoke-static {v9, v10, v6}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v9
.line 155
const/4 v10, 0x3
.line 154
if-ne v9, v10, :cond_6
move v4, v6
.line 156
.local v4, leftClock:Z
:goto_3
if-eqz v5, :cond_2
if-eqz v2, :cond_2
.line 157
if-eqz p1, :cond_7
move v6, v7
:goto_4
invoke-virtual {v2, v6}, Landroid/view/View;->setVisibility(I)V
.line 159
:cond_2
if-eqz v1, :cond_3
if-eqz v0, :cond_3
.line 160
if-eqz p1, :cond_8
move v6, v7
:goto_5
invoke-virtual {v0, v6}, Landroid/view/View;->setVisibility(I)V
.line 162
:cond_3
if-eqz v4, :cond_0
if-eqz v3, :cond_0
.line 163
if-eqz p1, :cond_9
:goto_6
invoke-virtual {v3, v7}, Landroid/view/View;->setVisibility(I)V
goto :goto_0
.end local v1 #centerClock:Z
.end local v4 #leftClock:Z
.end local v5 #rightClock:Z
:cond_4
move v5, v7
.line 150
goto :goto_1
.restart local v5 #rightClock:Z
:cond_5
move v1, v7
.line 152
goto :goto_2
.restart local v1 #centerClock:Z
:cond_6
move v4, v7
.line 154
goto :goto_3
.restart local v4 #leftClock:Z
:cond_7
move v6, v8
.line 157
goto :goto_4
.line 160
:cond_8
const/4 v6, 0x4
goto :goto_5
:cond_9
move v7, v8
.line 163
goto :goto_6
.end method
WAIT!!!
WAIT!!!
Remeber those id's you grabbed earlier? Here's where we put them. Look through the method you just added and replace the id's with the ones you copied!
Now search for
Code:
mIcons:Landroid/widget/LinearLayout;
and replace every instance with
Code:
mIcons:Landroid/widget/RelativeLayout;
method makeStatusBarView
Code:
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationIcons:Lcom/android/systemui/statusbar/phone/IconMerger;
iget-object v10, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mMoreIcon:Landroid/view/View;
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/IconMerger;->setOverflowIndicator(Landroid/view/View;)V
.line 621
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d0035
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v9
[COLOR="red"]check-cast v9, Landroid/widget/RelativeLayout;[/COLOR]
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIcons:Landroid/widget/RelativeLayout;
.line 622
iget-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const v10, 0x7f0d003e
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->findViewById(I)Landroid/view/View;
move-result-object v9
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker.smali
Now search for
Code:
mIcons:Landroid/widget/LinearLayout;
and replace every instance with
Code:
mIcons:Landroid/widget/RelativeLayout;
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusBarView.smali
Search for
Code:
leftIconsControl:Landroid/widget/LinearLayout$LayoutParams;
and replace every instance with
Code:
leftIconsControl:Landroid/widget/RelativeLayout$LayoutParams;
Do the same thing and replace
Code:
rightIconsControl:Landroid/widget/LinearLayout$LayoutParams;
with
Code:
rightIconsControl:Landroid/widget/RelativeLayout$LayoutParams;
One last one. Replace
Code:
check-cast v0, Landroid/widget/LinearLayout$LayoutParams;
with
Code:
check-cast v0, Landroid/widget/RelativeLayout$LayoutParams;
Navigate to /smali/com/android/systemui/statusbar/BaseStatusBar.smali
If you haven't implemented the trancparency mod, place the following method after ".method public setMaxBrightness(I)V"
method setStatusBarParams
REPLACE THE ENTIRE METHOD WITH THIS:
Code:
.method protected setStatusBarParams(Landroid/view/View;)V
.locals 4
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "statusbar_color"
const/high16 v3, -0x100
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
invoke-virtual {p1, v0}, Landroid/view/View;->setBackgroundColor(I)V
return-void
.end method
Now download the zip attached to this post and copy the smali folder, overwriting if it asks.
If you haven't implemented the transparency mod, You only need to add a couple things.
Navigate to /smali/com/android/systemui/statusbar/phone/PhoneStatusbar.smali
Code:
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BrightnessEnableObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$BatteryTextObserver;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$MyTicker;,
[COLOR="Red"]Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;,[/COLOR]
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$NotificationClicker;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;,
Lcom/android/systemui/statusbar/phone/PhoneStatusBar$ExpandedDialog;
Code:
.method static synthetic access$3400(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
.locals 1
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadAnim(ILandroid/view/animation/Animation$AnimationListener;)Landroid/view/animation/Animation;
move-result-object v0
return-object v0
.end method
[COLOR="Red"].method static synthetic access$3401(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/view/View;)V
.locals 0
invoke-virtual {p0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setStatusBarParams(Landroid/view/View;)V
return-void
.end method[/COLOR]
.method static synthetic access$3500(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->playTraySound()V
return-void
.end method
method updateResources
Code:
invoke-virtual {v0, v3}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v3
invoke-virtual {v2, v3}, Landroid/view/View;->setContentDescription(Ljava/lang/CharSequence;)V
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadDimens()V
[COLOR="Red"]iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {p0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->setStatusBarParams(Landroid/view/View;)V[/COLOR]
return-void
.end method
method makeStatusBarView
Code:
invoke-virtual {v9, v10}, Lcom/android/systemui/statusbar/policy/NotificationRowLayout;->setLongPressListener(Landroid/view/View$OnLongClickListener;)V
iget-object v9, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mPile:Lcom/android/systemui/statusbar/policy/NotificationRowLayout;
iput-object v9, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedContents:Landroid/view/View;
[COLOR="Red"]new-instance v9, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
new-instance v10, Landroid/os/Handler;
invoke-direct {v10}, Landroid/os/Handler;-><init>()V
invoke-direct {v9, p0, v10}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v9}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V[/COLOR]
goto/16 :goto_5
:cond_f
const/16 v9, 0x8
goto/16 :goto_6
method public start()V
Code:
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mWindowManager:Landroid/view/IWindowManager;
invoke-super {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->start()V
invoke-direct {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->addNavigationBar()V
[COLOR="red"]new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/BaseStatusBar$H;
invoke-direct {v0, p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Landroid/os/Handler;)V
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$SettingsObserver;->observe()V[/COLOR]
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
iget-object v1, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;
invoke-direct {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconPolicy:Lcom/android/systemui/statusbar/phone/PhoneStatusBarPolicy;
return-void
.end method
Awesome. Thanks!
I assume this is for 4.1.1?
upndwn4par said:
Awesome. Thanks!
I assume this is for 4.1.1?
Click to expand...
Click to collapse
It's pretty involved, but let me know how it goes for you. I may have missed something. It should work for 4.1.2 but it's built from 4.1.1
loserskater said:
Now download the zip attached to this post and place the files in the following folders:
Code:
ClockLeft.smali /smali/com/android/systemui/statusbar/policy/
PhoneStatusBar$MyTicker.smali /smali/com/android/systemui/statusbar/phone/
[/hide]
Click to expand...
Click to collapse
I hated editing MyTicker.smali lol
Good work on these MODs dude. We should bounce ideas off each other from time to time. Hit me up on Gtalk...sent you a PM.
Didact74 said:
I hated editing MyTicker.smali lol
Good work on these MODs dude. We should bounce ideas off each other from time to time. Hit me up on Gtalk...sent you a PM.
Click to expand...
Click to collapse
That was a good idea though. Getting the center clock centered between the two sets of icons was a pain, so I can see just having it overlap being much easier.
I don't really get how I'm supposed to do this? I have the Intergalactic ROM and I go to download the Clock Statusbar Mod 2.0 and there is a "multimod" which has all the features. So I downloaded that and I go to SecSettings.apk and there is not even a /res/values folder? Can you make a flashable zip or something that works with your ROM?
geoldr said:
I don't really get how I'm supposed to do this? I have the Intergalactic ROM and I go to download the Clock Statusbar Mod 2.0 and there is a "multimod" which has all the features. So I downloaded that and I go to SecSettings.apk and there is not even a /res/values folder? Can you make a flashable zip or something that works with your ROM?
Click to expand...
Click to collapse
I'm working on something similar for the next version of Intergalactic. It's a different method of doing things than this, but you'll be able to change the status bar to any hex value or transparency that you want using a popup color changer apk.
Thanks for yours and Didact's work, loser.
Sent from my SAMSUNG-SGH-I747 using xda premium
Oh by the way, your code is a real jokester and a tease...but then it reassures me with a wink. Lol
Sent from my SAMSUNG-SGH-I747 using xda premium
I think I'm missing something... but where are the attached files?
Code:
ClockLeft.smali /smali/com/android/systemui/statusbar/policy/
PhoneStatusBar$MyTicker.smali /smali/com/android/systemui/statusbar/phone/
stratatak7 said:
I'm working on something similar for the next version of Intergalactic. It's a different method of doing things than this, but you'll be able to change the status bar to any hex value or transparency that you want using a popup color changer apk.
Thanks for yours and Didact's work, loser.
Sent from my SAMSUNG-SGH-I747 using xda premium
Click to expand...
Click to collapse
Sounds good. But can you also implement center clock? I think that and battery icons are essential.
Thanks man
geoldr said:
Sounds good. But can you also implement center clock? I think that and battery icons are essential.
Thanks man
Click to expand...
Click to collapse
Everything will be customizable. Don't worry.
Sent from my SAMSUNG-SGH-I747 using xda premium
Too much work involved
stratatak7 said:
I'm working on something similar for the next version of Intergalactic. It's a different method of doing things than this, but you'll be able to change the status bar to any hex value or transparency that you want using a popup color changer apk.
Thanks for yours and Didact's work, loser.
Sent from my SAMSUNG-SGH-I747 using xda premium
Click to expand...
Click to collapse
I was going to go that route, but wanted to get this done first. Sharing that color changer apk would be awesome!
Kryten2k35 said:
I think I'm missing something... but where are the attached files?
Code:
ClockLeft.smali /smali/com/android/systemui/statusbar/policy/
PhoneStatusBar$MyTicker.smali /smali/com/android/systemui/statusbar/phone/
Click to expand...
Click to collapse
Sorry about that. Files are up!
loserskater said:
I was going to go that route, but wanted to get this done first. Sharing that color changer apk would be awesome!
Sorry about that. Files are up!
Click to expand...
Click to collapse
Thanks mate!
---------- Post added at 11:25 PM ---------- Previous post was at 10:48 PM ----------
Well, this worked great
The only issue I can notice is that to set the statusbar colour, you must pick the colour, then pick the transparency.
Not a big deal though!
Thanks loserskater!
Kryten2k35 said:
Thanks mate!
---------- Post added at 11:25 PM ---------- Previous post was at 10:48 PM ----------
Well, this worked great
The only issue I can notice is that to set the statusbar colour, you must pick the colour, then pick the transparency.
Not a big deal though!
Thanks loserskater!
Click to expand...
Click to collapse
It works just fine for me. Post your BaseStatusBar
Sent from my SAMSUNG-SGH-I747
Ok
It's not a massive deal though.
loserskater said:
I was going to go that route, but wanted to get this done first. Sharing that color changer apk would be awesome!
Click to expand...
Click to collapse
I think you have to be part of The Family for that.
I also get this now:
Code:
W/BroadcastQueue( 2707): Failure sending broadcast Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 }
W/BroadcastQueue( 2707): android.os.DeadObjectException
W/BroadcastQueue( 2707): at android.os.BinderProxy.transact(Native Method)
W/BroadcastQueue( 2707): at android.content.IIntentReceiver$Stub$Proxy.performReceive(IIntentReceiver.java)
W/BroadcastQueue( 2707): at com.android.server.am.BroadcastQueue.performReceiveLocked(BroadcastQueue.java)
W/BroadcastQueue( 2707): at com.android.server.am.BroadcastQueue.deliverToRegisteredReceiverLocked(BroadcastQueue.java)
W/BroadcastQueue( 2707): at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java)
W/BroadcastQueue( 2707): at com.android.server.am.ActivityManagerService.finishReceiver(ActivityManagerService.java)
W/BroadcastQueue( 2707): at android.content.BroadcastReceiver$PendingResult.sendFinished(BroadcastReceiver.java)
W/BroadcastQueue( 2707): at android.content.BroadcastReceiver$PendingResult.finish(BroadcastReceiver.java)
W/BroadcastQueue( 2707): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java)
W/BroadcastQueue( 2707): at android.os.Handler.handleCallback(Handler.java)
W/BroadcastQueue( 2707): at android.os.Handler.dispatchMessage(Handler.java)
W/BroadcastQueue( 2707): at android.os.Looper.loop(Looper.java)
W/BroadcastQueue( 2707): at com.android.server.ServerThread.run(SystemServer.java)
W/BroadcastQueue( 2707): Failure sending broadcast Intent { act=android.intent.action.SCREEN_OFF flg=0x50000010 }
W/BroadcastQueue( 2707): android.os.DeadObjectException
W/BroadcastQueue( 2707): at android.os.BinderProxy.transact(Native Method)
W/BroadcastQueue( 2707): at android.content.IIntentReceiver$Stub$Proxy.performReceive(IIntentReceiver.java)
W/BroadcastQueue( 2707): at com.android.server.am.BroadcastQueue.performReceiveLocked(BroadcastQueue.java)
W/BroadcastQueue( 2707): at com.android.server.am.BroadcastQueue.deliverToRegisteredReceiverLocked(BroadcastQueue.java)
W/BroadcastQueue( 2707): at com.android.server.am.BroadcastQueue.processNextBroadcast(BroadcastQueue.java)
W/BroadcastQueue( 2707): at com.android.server.am.ActivityManagerService.finishReceiver(ActivityManagerService.java)
W/BroadcastQueue( 2707): at android.app.ActivityManagerNative.onTransact(ActivityManagerNative.java)
W/BroadcastQueue( 2707): at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java)
W/BroadcastQueue( 2707): at android.os.Binder.execTransact(Binder.java)
W/BroadcastQueue( 2707): at dalvik.system.NativeStart.run(Native Method)
W/AlarmManager( 2707): FACTORY_ON= 0
D/dalvikvm( 2707): GC_CONCURRENT freed 310K, 57% free 18664K/43015K, paused 13ms+13ms, total 164ms
E/Trace ( 8497): error opening trace file: No such file or directory (2)
E/JavaBinder( 8497): *** Uncaught remote exception! (Exceptions are not yet supported across processes.)
E/JavaBinder( 8497): java.lang.RuntimeException: android.os.DeadObjectException
E/JavaBinder( 8497): at android.os.Parcel.writeException(Parcel.java)
E/JavaBinder( 8497): at android.os.Binder.execTransact(Binder.java)
E/JavaBinder( 8497): at dalvik.system.NativeStart.run(Native Method)
E/JavaBinder( 8497): Caused by: android.os.DeadObjectException
E/JavaBinder( 8497): at android.os.BinderProxy.transact(Native Method)
E/JavaBinder( 8497): at android.content.IIntentReceiver$Stub$Proxy.performReceive(IIntentReceiver.java)
E/JavaBinder( 8497): at android.app.ActivityThread$ApplicationThread.scheduleRegisteredReceiver(ActivityThread.java)
E/JavaBinder( 8497): at android.app.ApplicationThreadNative.onTransact(ApplicationThreadNative.java)
E/JavaBinder( 8497): ... 2 more
Whenever the screen turns off, the wallpaper and statusbar die and then come back. It also happens sometimes when changing the clock, and sometimes the left and center clocks shot together :/
Very odd because it worked great last night!
i get this when trying to compile..can anyone help please
[2932,4] ALL REGISTER ARGS MUST FIT 4 BITS
[2938,4] THE REGISTER NUMBER MUST BE LESS THAN V16
[2940,4] MISMATCHED TREE NODE ....
[2942,4] MISMATCHED TREE NODE ....
Click to expand...
Click to collapse
THANKS

[MOD][HOW-TO] Quick Unlock on Pin/Password with toggle

This will allow the PIN and Password unlock screens to be unlock as soon as the correct pin/password is input without having to press the enter key to submit.
**UPDATE** Updated for Lollipop
Thanks to @tdunham for updating this guide for 4.4.2. See here: http://forum.xda-developers.com/showpost.php?p=54905593&postcount=54
We're going to be working with the following two files:
SecSettings.apk
android.policy.jar
KEY
REMOVE what's in BLUE
ADD what's in RED
SecSettings.apk
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="quick_unlock_title">Quick Unlock</string>
<string name="quick_unlock_summary">Unlock as soon as correct pin is entered</string>
Navigate to /xml/security_settings_password.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen android:persistent="false" android:title="@string/unlock_set_unlock_launch_picker_title" android:key="unlock_set_or_change" android:summary="@string/unlock_set_unlock_mode_password" />
<SwitchPreferenceScreen android:title="@string/dualclock_settings_title" android:key="dualclock_settings" android:summary="@string/dualclock_settings_summary" android:fragment="com.android.settings.dualclock.DualClockSetting" />
<CheckBoxPreference android:title="@string/with_cicle_title" android:key="with_circle" android:summary="@string/with_cicle_summary" android:defaultValue="false" />
<PreferenceScreen android:title="@string/lock_screen_options" android:key="lock_screen_options" android:summary="@string/lock_screen_options_summary" android:fragment="com.android.settings.LockScreenSettings" />
<CheckBoxPreference android:title="@string/quick_note_title" android:key="quick_note" android:summary="@string/quick_note_summary" android:defaultValue="false" />
<ListPreference android:persistent="false" android:entries="@array/lock_after_timeout_entries" android:title="@string/lock_after_timeout" android:key="lock_after_timeout" android:summary="@string/lock_after_timeout_summary" android:entryValues="@array/lock_after_timeout_values" />
<CheckBoxPreference android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" android:key="power_button_instantly_locks" />
[COLOR="Red"]<CheckBoxPreference android:title="@string/quick_unlock_title" android:key="quick_unlock" android:summary="@string/quick_unlock_summary" />[/COLOR]
<PreferenceScreen android:title="@string/owner_info_settings_title" android:key="owner_info_settings" android:summary="@string/owner_info_settings_summary" android:fragment="com.android.settings.OwnerInfoSettings" />
</PreferenceScreen>
Navigate to /xml/security_settings_pin.xml
Code:
<?xml version="1.0" encoding="utf-8"?>
<PreferenceScreen
xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen android:persistent="false" android:title="@string/unlock_set_unlock_launch_picker_title" android:key="unlock_set_or_change" android:summary="@string/unlock_set_unlock_mode_pin" />
<SwitchPreferenceScreen android:title="@string/dualclock_settings_title" android:key="dualclock_settings" android:summary="@string/dualclock_settings_summary" android:fragment="com.android.settings.dualclock.DualClockSetting" />
<CheckBoxPreference android:title="@string/with_cicle_title" android:key="with_circle" android:summary="@string/with_cicle_summary" android:defaultValue="false" />
<PreferenceScreen android:title="@string/lock_screen_options" android:key="lock_screen_options" android:summary="@string/lock_screen_options_summary" android:fragment="com.android.settings.LockScreenSettings" />
<CheckBoxPreference android:title="@string/quick_note_title" android:key="quick_note" android:summary="@string/quick_note_summary" android:defaultValue="false" />
<ListPreference android:persistent="false" android:entries="@array/lock_after_timeout_entries" android:title="@string/lock_after_timeout" android:key="lock_after_timeout" android:summary="@string/lock_after_timeout_summary" android:entryValues="@array/lock_after_timeout_values" />
<CheckBoxPreference android:title="@string/lockpattern_settings_enable_power_button_instantly_locks" android:key="power_button_instantly_locks" />
<CheckBoxPreference android:title="@string/lockpattern_settings_enable_tactile_feedback_title" android:key="unlock_tactile_feedback" />
[COLOR="red"]<CheckBoxPreference android:title="@string/quick_unlock_title" android:key="quick_unlock" android:summary="@string/quick_unlock_summary" />[/COLOR]
<PreferenceScreen android:title="@string/owner_info_settings_title" android:key="owner_info_settings" android:summary="@string/owner_info_settings_summary" android:fragment="com.android.settings.OwnerInfoSettings" />
</PreferenceScreen>
Navigate to /smali/com/android/settings/LockscreenMenuSettings.smali
Code:
.field private mPowerButtonInstantlyLocks:Landroid/preference/CheckBoxPreference;
.field private mQuicknote:Landroid/preference/CheckBoxPreference;
[COLOR="red"].field private mQuickUnlock:Landroid/preference/CheckBoxPreference;[/COLOR]
.field private mSignatureVerificationLevel:Landroid/preference/ListPreference;
.field private mTactileFeedback:Landroid/preference/CheckBoxPreference;
.method private createPreferenceHierarchy()Landroid/preference/PreferenceScreen;
WAIT!
WAIT!
You need to grab some ID's. Luckily they're already available so no need to compile, etc.!
There's only two.
Code:
:cond_5
const-string v4, "quick_note"
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
.line 203
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
if-eqz v4, :cond_6
const v4, 0x7f07004f
if-eq v2, v4, :cond_6
.line 205
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
.line 208
:cond_6
[COLOR="red"] const-string v4, "quick_unlock"
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
.line 203
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
if-eqz v4, :cond_next
const v4, 0x7f070051 # type="xml" name="security_settings_password"
if-eq v2, v4, :cond_next
const v4, 0x7f070054 # type="xml" name="security_settings_pin"
if-eq v2, v4, :cond_next
.line 205
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/Preference;)Z
:cond_next[/COLOR]
const-string v4, "visiblesignature"
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
WAIT!
WAIT!
Did you replace those two ID's in that last section? Good. Let's continue.
.method public onPreferenceTreeClick(Landroid/preference/PreferenceScreen;Landroid/preference/PreferenceZ
Code:
:cond_8
const-string v5, "quick_note"
invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v5
if-eqz v5, :cond_a
.line 503
invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "lock_screen_quick_note"
iget-object v7, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
invoke-virtual {v7}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v7
if-eqz v7, :cond_9
move v3, v4
:cond_9
invoke-static {v5, v6, v3}, Landroid/provider/Settings$Secure;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_0
.line 504
:cond_a
[COLOR="red"]const-string v5, "quick_unlock"
invoke-virtual {v5, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v5
if-eqz v5, :cond_next
.line 503
invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v5
const-string v6, "quick_unlock"
iget-object v7, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v7}, Landroid/preference/CheckBoxPreference;->isChecked()Z
move-result v7
if-eqz v7, :cond_quick
move v3, v4
:cond_quick
invoke-static {v5, v6, v3}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_0
.line 504
:cond_next[/COLOR]
const-string v3, "visiblesignature"
invoke-virtual {v3, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v3
if-eqz v3, :cond_b
.method public onResume()V
Code:
:cond_2
iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
if-eqz v1, :cond_3
.line 438
iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "lock_screen_quick_note"
invoke-static {v4, v5, v3}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_8
:goto_1
invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 440
:cond_3
[COLOR="red"]iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
if-eqz v1, :cond_next
.line 438
iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/LockscreenMenuSettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v4
const-string v5, "quick_unlock"
invoke-static {v4, v5, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v4
if-eqz v4, :cond_quick
:goto_quick
invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
.line 440
:cond_next[/COLOR]
iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
if-eqz v1, :cond_4
.line 441
iget-object v1, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
invoke-virtual {v0}, Lcom/android/internal/widget/LockPatternUtils;->isVisibleSignatureEnabled()Z
move-result v2
invoke-virtual {v1, v2}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
Code:
:cond_7
move v1, v3
.line 434
goto :goto_0
:cond_8
move v2, v3
.line 438
goto :goto_1
[COLOR="red"]:cond_quick
move v2, v3
goto :goto_quick[/COLOR]
.end method
That's it for SecSettings. Compile.
android.policy.jar
4.1.x
Navigate to /smali/com/android/internal/policy/impl/PasswordUnlockScreen.smali
Code:
.field private mPwdPolicy:Landroid/app/enterprise/PasswordPolicy;
.field private mResuming:Z
[COLOR="Red"].field private mQuickUnlock:Z[/COLOR]
.field private final mStatusViewManager:Lcom/android/internal/policy/impl/KeyguardStatusViewManager;
.field private final mUpdateMonitor:Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;
.method public constructor <init>(Landroid/content/Context;Landroid/content/res/Configuration;Lcom/android/internal/widget/LockPatternUtils;Lcom/android/internal/policy/impl/KeyguardUpdateMonitor;Lcom/android/internal/policy/impl/KeyguardScreenCallbackV
Code:
iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
const/16 v2, 0x81
invoke-virtual {v1, v2}, Landroid/widget/EditText;->setInputType(I)V
.line 250
:goto_4
iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
new-instance v2, Lcom/android/internal/policy/impl/PasswordUnlockScreen$4;
invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$4;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V
invoke-virtual {v1, v2}, Landroid/widget/EditText;->setOnClickListener(Landroid/view/View$OnClickListener;)V
.line 255
[COLOR="red"]iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const/4 v3, 0x0
const-string v9, "quick_unlock"
invoke-static {v1, v9, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const/4 v2, 0x1
if-ne v1, v2, :cond_quick
move v1, v2
:goto_quick
iput-boolean v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mQuickUnlock:Z[/COLOR]
iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
new-instance v2, Lcom/android/internal/policy/impl/PasswordUnlockScreen$5;
invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$5;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V
invoke-virtual {v1, v2}, Landroid/widget/EditText;->addTextChangedListener(Landroid/text/TextWatcher;)V
Code:
new-instance v1, Lcom/android/internal/policy/impl/PasswordUnlockScreen$2;
invoke-direct {v1, p0}, Lcom/android/internal/policy/impl/PasswordUnlockScreen$2;-><init>(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)V
invoke-virtual {v10, v1}, Landroid/view/View;->setOnLongClickListener(Landroid/view/View$OnLongClickListener;)V
goto/16 :goto_3
.line 181
.end local v10 #pinDelete:Landroid/view/View;
:cond_f
const/4 v1, 0x0
goto :goto_5
[COLOR="red"]:cond_quick
move v1, v3
goto :goto_quick[/COLOR]
.line 242
:cond_10
iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
invoke-static {}, Landroid/text/method/DigitsKeyListener;->getInstance()Landroid/text/method/DigitsKeyListener;
move-result-object v2
invoke-virtual {v1, v2}, Landroid/widget/EditText;->setKeyListener(Landroid/text/method/KeyListener;)V
.line 243
iget-object v1, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
const/16 v2, 0x12
invoke-virtual {v1, v2}, Landroid/widget/EditText;->setInputType(I)V
goto/16 :goto_4
.end method
Add the following methods:
Code:
.method static synthetic access$100(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Landroid/widget/EditText;
.locals 1
.parameter "x0"
.prologue
.line 76
iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mPasswordEntry:Landroid/widget/EditText;
return-object v0
.end method
[COLOR="Red"].method static synthetic access$1000(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Z
.locals 1
.parameter "x0"
.prologue
.line 76
iget-boolean v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mQuickUnlock:Z
return v0
.end method
.method static synthetic access$1100(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Lcom/android/internal/widget/LockPatternUtils;
.locals 1
.parameter "x0"
.prologue
.line 76
iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
return-object v0
.end method[/COLOR]
.method static synthetic access$200(Lcom/android/internal/policy/impl/PasswordUnlockScreen;)Lcom/android/internal/policy/impl/KeyguardScreenCallback;
.locals 1
.parameter "x0"
.prologue
.line 76
iget-object v0, p0, Lcom/android/internal/policy/impl/PasswordUnlockScreen;->mCallback:Lcom/android/internal/policy/impl/KeyguardScreenCallback;
return-object v0
.end method
Now download the zip attached to this post and extract to the root of your project.
Compile and enjoy!
4.3
Navigate to smali/com/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView.smali
Add the following in red:
Code:
.field protected mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;
.field protected mPasswordEntry:Landroid/widget/TextView;
[COLOR="Red"].field private mQuickUnlock:Z[/COLOR]
Add the following method in red:
Code:
.method static synthetic access$300(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)Landroid/widget/Button;
.locals 1
.parameter "x0"
.prologue
.line 68
iget-object v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mEmergencyButton:Landroid/widget/Button;
return-object v0
.end method
[COLOR="red"].method static synthetic access$400(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)Z
.locals 1
.parameter "x0"
.prologue
.line 42
iget-boolean v0, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z
return v0
.end method[/COLOR]
.method protected onFinishInflate()V
Make sure this is larger than 3
Code:
.method protected onFinishInflate()V
[COLOR="Red"] .locals 4[/COLOR]
Code:
.line 176
iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;
new-instance v2, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$1;
invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$1;-><init>(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)V
invoke-virtual {v1, v2}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
[COLOR="red"]iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "quick_unlock"
const/4 v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
if-eqz v1, :cond_quick
const/4 v1, 0x1
:goto_0
iput-boolean v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mQuickUnlock:Z[/COLOR]
.line 182
iget-object v1, p0, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;->mPasswordEntry:Landroid/widget/TextView;
new-instance v2, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$2;
invoke-direct {v2, p0}, Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView$2;-><init>(Lcom/android/internal/policy/impl/keyguard/KeyguardAbsKeyInputView;)V
invoke-virtual {v1, v2}, Landroid/widget/TextView;->addTextChangedListener(Landroid/text/TextWatcher;)V
Code:
:cond_2
return-void
[COLOR="red"]:cond_quick
const/4 v1, 0x0
goto :goto_0[/COLOR]
.end method
Awesome stuff my man!
(P.S. I think you might have a toggle problem. )
Edit:
Works perfect. :good:
upndwn4par said:
Awesome stuff my man!
(P.S. I think you might have a toggle problem. )
Click to expand...
Click to collapse
I love me some toggles!
loserskater said:
I love me some toggles!
Click to expand...
Click to collapse
I love how all of your mods include the toggle in the Settings app! I hate having to have a seperate tweak/mod app.
Much props and huge apprectiation for passing on your modding/deving knowledge!
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
Thanks man for this feature. For me this will be the killer feature on Touchwiz ROM. Do we need decomplie the APK and JAR file mentioned in the OP. I am bad in coding
shane87 said:
I love how all of your mods include the toggle in the Settings app! I hate having to have a seperate tweak/mod app.
Much props and huge apprectiation for passing on your modding/deving knowledge!
Sent from my SAMSUNG-SGH-I747 using xda app-developers app
Click to expand...
Click to collapse
It's good, but awkward on updates!
Many thanks for this! do you know if it will work on a galaxy note 2 tw based 4.1.2 rom? no worries if not, i will try later and let you guys know
Found it in values/public. notepad++ was being finicky when I searched
Thanks for this brother, and for sharing all your knowledge
worked like a dream. Thanks !
I'm trying to follow your guide but I am getting a compile error at the end and I think I'm lost on this part that you explain...
---------------------------------------------------------------------------------------------------------------------
.method private createPreferenceHierarchy()Landroid/preference/PreferenceScreen;
WAIT!
WAIT!
You need to grab some ID's. Luckily they're already available so no need to compile, etc.!
There's only two.
Code:
:cond_5
const-string v4, "quick_note"
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequenceLandroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
.line 203
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
if-eqz v4, :cond_6
const v4, 0x7f07004f
if-eq v2, v4, :cond_6
.line 205
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuicknote:Landroid/preference/CheckBoxPreference;
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/PreferenceZ
.line 208
:cond_6
const-string v4, "quick_unlock"
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequenceLandroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
.line 203
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
if-eqz v4, :cond_next
const v4, 0x7f070051 # type="xml" name="security_settings_password"
if-eq v2, v4, :cond_next
const v4, 0x7f070054 # type="xml" name="security_settings_pin"
if-eq v2, v4, :cond_next
.line 205
iget-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mQuickUnlock:Landroid/preference/CheckBoxPreference;
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->removePreference(Landroid/preference/PreferenceZ
:cond_next
const-string v4, "visiblesignature"
invoke-virtual {v3, v4}, Landroid/preference/PreferenceScreen;->findPreference(Ljava/lang/CharSequenceLandroid/preference/Preference;
move-result-object v4
check-cast v4, Landroid/preference/CheckBoxPreference;
iput-object v4, p0, Lcom/android/settings/LockscreenMenuSettings;->mVisibleSignature:Landroid/preference/CheckBoxPreference;
WAIT!
WAIT!
Did you replace those two ID's in that last section? Good. Let's continue.
-----------------------------------------------------------------------------------------------------------------
I was just adding the red. What do you mean by grabbing ID's and replacing ID's? Specific thing that's not universal that I have to figure out?(sorry for ignorance, i'm not a developer/experienced with coding)
lmike6453 said:
I'm trying to follow your guide but I am getting a compile error at the end and I think I'm lost on this part that you explain...
I was just adding the red. What do you mean by grabbing ID's and replacing ID's? Specific thing that's not universal that I have to figure out?(sorry for ignorance, i'm not a developer/experienced with coding)
Click to expand...
Click to collapse
Look in the code for lines that have the #
Code:
const v4, [COLOR="Red"]0x7f070051[/COLOR] # type="xml" name="security_settings_password"
Now search in /res/values/public.xml for what's after the #
You should see something like
Code:
<public type="xml" name="security_settings_pattern" id="[COLOR="red"]0x7f070051[/COLOR]" />
Now look back at the line in the smali and replace the 0x7fxxxxxx with what is in your public.xml (Match what's in red)
loserskater said:
Look in the code for lines that have the #
Code:
const v4, [COLOR="Red"]0x7f070051[/COLOR] # type="xml" name="security_settings_password"
Now search in /res/values/public.xml for what's after the #
You should see something like
Code:
<public type="xml" name="security_settings_pattern" id="[COLOR="red"]0x7f070051[/COLOR]" />
Now look back at the line in the smali and replace the 0x7fxxxxxx with what is in your public.xml (Match what's in red)
Click to expand...
Click to collapse
Loser,
He has a point as the way you explain about the part in getting the id's is a bit different than I've seen in others. I had to do a double take to make sure I was understanding the wording.
I love this mod though...so simple but negates out the "ok" step to make it seem more fluid
Remember that doing these mods is not for everyone. Loser is very kind to even bother explaining how to match the ids (or anything else for that matter). Most devs post the mod and don't offer any support. Everyone should try not to bother him too much.
upndwn4par said:
Remember that doing these mods is not for everyone. Loser is very kind to even bother explaining how to match the ids (or anything else for that matter). Most devs post the mod and don't offer any support. Everyone should try not to bother him too much.
Click to expand...
Click to collapse
Just trying to see where the guy was coming from. I myself probably didn't even come across how I meant to. I wasn't complaining.
So if I'm not "good enough" I don't need to post ?
loserskater said:
Look in the code for lines that have the #
Code:
const v4, [COLOR="Red"]0x7f070051[/COLOR] # type="xml" name="security_settings_password"
Now search in /res/values/public.xml for what's after the #
You should see something like
Code:
<public type="xml" name="security_settings_pattern" id="[COLOR="red"]0x7f070051[/COLOR]" />
Now look back at the line in the smali and replace the 0x7fxxxxxx with what is in your public.xml (Match what's in red)
Click to expand...
Click to collapse
Many thanks for the reply and guidance! I can understand how annoying dumb questions can get and I hope that mine does not discourage ya in any way.
Always know that ppl in my shoes that are just "getting my feet wet" appreciate it that much more since your guides for such useful MODS are a rarity among developers as upndwn4par explained.
I will give it another go and post back my findings for TW based 4.1.2 ROM for Galaxy Note 2 that I'll be attempting it for :good:
hednik said:
Just trying to see where the guy was coming from. I myself probably didn't even come across how I meant to. I wasn't complaining.
So if I'm not "good enough" I don't need to post ?
Click to expand...
Click to collapse
That was not directed at you buddy, but everyone in general.
Just reminding everyone that these are dev level mods.
I post these guides in hopes that people will attempt to get into learning how they work instead of just copy and pasting the guide. I know smali is a crazy foreign language to most people and it is a very steep learning curve, but anybody that sees these guides and starts seeing patterns, and then attempt to do their own mods is a great success to me.
You're right that the ID section is vague, but I'm hoping that people have done enough mods that they will understand what is meant. It's just one of those things that I don't want to post in every how-to. I have mulitple guides that explain how to get IDs that I don't see the point in posting it over and over. I also don't mind answering people that have issues with getting ID's (as you can see in my previous post) so it's not that big of an issue.
And I don't mind being bothered as long as it's in my thread and not a PM. I'm MUCH more likely to help if you post in the thread. It also allows other users to help out if they've come across the issue you're having which helps me out a lot.
Hi Loserskater,
I'm trying to apply the mod to the Galaxy S2. When i apply the changes to SecSettings.apk, I get an error:
Code:
I: Smaling...
[3177,16] Label "cond_quick" is not defined.
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file
: C:\Users\Do Khac Minh Duc\Desktop\apktool\SecSettings\smali\com\android\settin
gs\LockscreenMenuSettings.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Can you please tell me, what I'm doing wrong? I have already changed line references to match the S2 smali.
I'll attach the publics.xml and LockscreenMenuSettings.smali.
Thanks for your response in advance!

[MOD][HOW-TO] Change Volume Panel Timeout

Tired of the volume panel sitting on the screen for what seems like way too long? You can now change the timeout so it hides much quicker.
We're going to be working with the following two files:
SecSettings.apk
framework.jar
KEY
ADD what's in RED
SecSettings.apk
Navigate to /res/values/arrays.xml
Add the following to the end of the file
Code:
<string-array name="volume_panel_timeout_entries">
<item>0.5s</item>
<item>1s</item>
<item>1.5s</item>
<item>2s</item>
<item>2.5s</item>
<item>3s (Default)</item>
</string-array>
<string-array name="volume_panel_timeout_values">
<item>500</item>
<item>1000</item>
<item>1500</item>
<item>2000</item>
<item>2500</item>
<item>3000</item>
</string-array>
Navigate to /res/values/strings.xml
Add the following to the end of the file
Code:
<string name="volume_panel_timeout_title">Volume Panel Timeout</string>
<string name="volume_panel_timeout_summary">%s</string>
Navigate to /xml/display_settings.xml
Add the following line wherever you would like it to show in the menu
Code:
<ListPreference android:persistent="false" android:entries="@array/volume_panel_timeout_entries" android:title="@string/volume_panel_timeout_title" android:key="volume_panel_timeout" android:summary="@string/volume_panel_timeout_summary" android:widgetLayout="@layout/round_more_icon" android:entryValues="@array/volume_panel_timeout_values" />
Navigate to /smali/com/android/settings/DisplaySettings.smali
Code:
.field mSupportFolderType:Z
.field private mTouchKeyLight:Landroid/preference/ListPreference;
[COLOR="Red"].field mVolumePanel:Landroid/preference/ListPreference;[/COLOR]
.method private updateState()V
Code:
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
const-string v4, "display_battery_percentage"
invoke-static {v0, v4, v2}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
if-eqz v0, :cond_4
move v0, v1
:goto_1
invoke-virtual {v3, v0}, Landroid/preference/CheckBoxPreference;->setChecked(Z)V
[COLOR="red"]iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "volume_panel_timeout"
const/16 v5, 0x5
invoke-static {v3, v4, v5}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v3
invoke-static {v3}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
iget-object v3, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {v3}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v3
invoke-virtual {v0, v3}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V[/COLOR]
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mTouchKeyLight:Landroid/preference/ListPreference;
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "button_key_light"
.method public onCreate(Landroid/os/BundleV
Code:
const-string v11, "display_battery_level"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/CheckBoxPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mDisplayBatteryLevel:Landroid/preference/CheckBoxPreference;
[COLOR="red"]const-string v11, "volume_panel_timeout"
invoke-virtual {p0, v11}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v11
check-cast v11, Landroid/preference/ListPreference;
iput-object v11, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
iget-object v11, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {v11, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getActivity()Landroid/app/Activity;
move-result-object v11
invoke-static {v11}, Lcom/android/settings/Utils;->isTablet(Landroid/content/Context;)Z
move-result v11
if-eqz v11, :cond_6
.method public onPreferenceChange(Landroid/preference/Preference;Ljava/lang/ObjectZ
Code:
:catch_2
move-exception v0
.line 1038
const-string v1, "DisplaySettings"
const-string v2, "could not persist Touch key light setting"
invoke-static {v1, v2, v0}, Landroid/util/Log;->secE(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I
goto/16 :goto_4
.line 1040
:cond_9
[COLOR="red"]const-string v2, "volume_panel_timeout"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_next
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->parseInt(Ljava/lang/String;)I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "volume_panel_timeout"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-static {v0}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v0
invoke-virtual {v1, v0}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v0, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mVolumePanel:Landroid/preference/ListPreference;
invoke-virtual {v1}, Landroid/preference/ListPreference;->getEntry()Ljava/lang/CharSequence;
move-result-object v1
invoke-virtual {v0, v1}, Landroid/preference/ListPreference;->setSummary(Ljava/lang/CharSequence;)V
goto/16 :goto_4
:cond_next[/COLOR]
const-string v2, "quick_launch"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
That's it for SecSettings. Compile.
framework.jar
Navigate to /smali/android/view/VolumePanel.smali
Find .method private resetTimeout()V
and replace the entire thing with this:
Code:
.method private resetTimeout()V
.locals 5
.prologue
const/4 v4, 0x5
.line 16
iget-object v1, p0, Landroid/view/VolumePanel;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
.line 17
const-string v2, "volume_panel_timeout"
const/4 v3, 0x0
.line 16
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v0
.line 18
.local v0, temp:I
invoke-virtual {p0, v4}, Landroid/view/VolumePanel;->removeMessages(I)V
.line 19
if-eqz v0, :cond_0
.line 20
invoke-virtual {p0, v4}, Landroid/view/VolumePanel;->obtainMessage(I)Landroid/os/Message;
move-result-object v1
int-to-long v2, v0
invoke-virtual {p0, v1, v2, v3}, Landroid/view/VolumePanel;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 24
:goto_0
return-void
.line 22
:cond_0
invoke-virtual {p0, v4}, Landroid/view/VolumePanel;->obtainMessage(I)Landroid/os/Message;
move-result-object v1
const-wide/16 v2, 0xbb8
invoke-virtual {p0, v1, v2, v3}, Landroid/view/VolumePanel;->sendMessageDelayed(Landroid/os/Message;J)Z
goto :goto_0
.end method
Now compile framework.jar (Make sure you compile it correctly adding back the META-INF and preloaded-classes files)
First. (;
Sent from my SGH-I747 using Tapatalk 4
Sajoeee said:
First. (;
Sent from my SGH-I747 using Tapatalk 4
Click to expand...
Click to collapse
First thanks
awesome mod man
Danvdh said:
First thanks
awesome mod man
Click to expand...
Click to collapse
(; ah, man. should have done that. Second thanks. (;
Sent from my SGH-I747 using Tapatalk 4
Nice work....how about some array detail? Looks like you forgot to post up your res/arrays info.
Thanks man.
Didact74 said:
Nice work....how about some array detail? Looks like you forgot to post up your res/arrays info.
Thanks man.
Click to expand...
Click to collapse
Awkward... will do that right now
Sent from my SAMSUNG-SGH-I747
EDIT: Done. Here's what needs to be added:
Navigate to /res/values/arrays.xml
Add the following to the end of the file
Code:
<string-array name="volume_panel_timeout_entries">
<item>0.5s</item>
<item>1s</item>
<item>1.5s</item>
<item>2s</item>
<item>2.5s</item>
<item>3s (Default)</item>
</string-array>
<string-array name="volume_panel_timeout_values">
<item>500</item>
<item>1000</item>
<item>1500</item>
<item>2000</item>
<item>2500</item>
<item>3000</item>
</string-array>
You're a king with this stuff buddy, great work still not really sure what this mod does, is it the timeout for the volume sliders? but definately gonna do it
loserskater said:
Awkward... will do that right now
Sent from my SAMSUNG-SGH-I747
Click to expand...
Click to collapse
Thanks man!
sbreen94 said:
You're a king with this stuff buddy, great work still not really sure what this mod does, is it the timeout for the volume sliders? but definately gonna do it
Click to expand...
Click to collapse
When you press the volume buttons and the slider pops up, this changes how long that is displayed for.
loserskater said:
When you press the volume buttons and the slider pops up, this changes how long that is displayed for.
Click to expand...
Click to collapse
Alright very cool, Lol this is a very general question, but how the heck did you find where that was located in the framework files lol
sbreen94 said:
Alright very cool, Lol this is a very general question, but how the heck did you find where that was located in the framework files lol
Click to expand...
Click to collapse
I decompiled framework and searched for volume. Luckily it was in framework.jar, otherwise I would have just kept decompiling different files until I found it.
Sent from my SAMSUNG-SGH-I747
loserskater said:
I decompiled framework and searched for volume. Luckily it was in framework.jar, otherwise I would have just kept decompiling different files until I found it.
Sent from my SAMSUNG-SGH-I747
Click to expand...
Click to collapse
Ahh so you just have a general idea of what you want to do for a mod and then you search for corresponding files for it.
Mod Works like a charm. Easy to do for the Galaxy S4
Hi! Thanks for this usefull mod Just one small question - is there any way how to set some value as default? After apply this mod and after restart, there wasn't any timeout selected and after volume change volume panel was still visible.
somin.n said:
Hi! Thanks for this usefull mod Just one small question - is there any way how to set some value as default? After apply this mod and after restart, there wasn't any timeout selected and after volume change volume panel was still visible.
Click to expand...
Click to collapse
I just updated this on my rom. I'll edit the OP with the changes.
EDIT: Updated. You'll just have to change the framework.jar
loserskater said:
I just updated this on my rom. I'll edit the OP with the changes.
EDIT: Updated. You'll just have to change the framework.jar
Click to expand...
Click to collapse
Once again thanks for your mods and effort :good:
loserskater said:
Tired of the volume panel sitting on the screen for what seems like way too long? You can now change the timeout so it hides much quicker.
We're going to be working with the following two files:
SecSettings.apk
Click to expand...
Click to collapse
I want volume panel timeout, so i did all other things except in DisplaySettings.smali, actually i cant find those lines in here, so requested to you, i am given here my DisplaySettings.smali, you check please and put those edit in the file and give.
Thanks ☺
Link- https://drive.google.com/file/d/0B-yQqsVcgEKWOXFzc1lxVHh3X2c/view?usp=drivesdk

[CM9/ICS] Guide How to full screen Expanded Pulldown JB style

Guide CM9 / ICS How to full screen Expanded Pulldown JB style
ok lets go to Guide:
first of all need some requirement for this MOD-GUIDE
REQUIREMENT:
- BRAIN
- Patient
- experience
- Know how to decompile/recompiling Apk file
- notepad++
- Tool for decompiling, : apkmanager/apktool/Virtous/apkmultitools/ or else
STEP -1
Decompile SytemUI.apk, go to SystemUI.apk\res\layout\ status_bar.xml
Make change to this line
Code:
<com.android.systemui.statusbar.phone.PhoneStatusBarView [COLOR="Blue"]android:background="@drawable/status_bar_custom_background"[/COLOR] android:focusable="true" android:descendantFocusability="afterDescendants" android:layout_width="fill_parent" android:layout_height="fill_parent"
STEP -2
Download attached file status_bar_custom_background.zip exstract it and put it to SystemUI.apk\res\drawable-hdpi
STEP -3
SystemUI.apk\res\layout\ status_bar_expanded.xml
add the blue code,. and 20.0dip you can set it to others value you like
Code:
<?xml version="1.0" encoding="utf-8"?>
<com.android.systemui.statusbar.phone.ExpandedView android:orientation="vertical" android:focusable="true" android:descendantFocusability="afterDescendants"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:systemui="http://schemas.android.com/apk/res/com.android.systemui">
<LinearLayout [COLOR="Blue"]android:layout_marginTop="20.0dip"[/COLOR] android:orientation="vertical" android:background="@drawable/notification_header_bg" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.android.systemui.statusbar.powerwidget.PowerWidget android:id="@id/exp_power_stat" android:layout_width="fill_parent" android:layout_height="wrap_content" />
<RelativeLayout android:paddingTop="3.0dip" android:paddingRight="3.0dip" android:paddingBottom="5.0dip" android:layout_width="fill_parent" android:layout_height="52.0dip">
<com.android.systemui.statusbar.policy.DateView android:textAppearance="@style/TextAppearance.StatusBar.Date" android:gravity="left|center" android:id="@id/date" android:paddingLeft="16.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:singleLine="true" android:layout_alignParentLeft="true" />
<ImageView android:id="@id/settings_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_quicksettings" android:layout_toRightOf="@id/date" android:contentDescription="@string/accessibility_settings_button" />
<ImageView android:id="@id/clear_all_button" android:paddingLeft="8.0dip" android:paddingRight="8.0dip" android:layout_width="wrap_content" android:layout_height="fill_parent" android:src="@drawable/ic_notify_clear" android:layout_alignParentRight="true" android:contentDescription="@string/accessibility_clear_all" />
</RelativeLayout>
</LinearLayout>
<View android:background="@drawable/status_bar_hr" android:layout_width="fill_parent" android:layout_height="2.0dip" />
<FrameLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1.0">
<TextView android:textAppearance="@*android:style/TextAppearance.Large" android:gravity="left" android:layout_gravity="top" android:id="@id/noNotificationsTitle" android:padding="8.0dip" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="@string/status_bar_no_notifications_title" />
<ScrollView android:id="@id/scroll" android:fadingEdge="none" android:layout_width="fill_parent" android:layout_height="fill_parent" android:overScrollMode="ifContentScrolls">
<LinearLayout android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content">
<com.android.systemui.statusbar.policy.NotificationRowLayout android:id="@id/latestItems" android:layout_width="fill_parent" android:layout_height="wrap_content" systemui:rowHeight="@dimen/notification_height" />
</LinearLayout>
</ScrollView>
<ImageView android:layout_width="fill_parent" android:layout_height="fill_parent" android:src="@drawable/title_bar_shadow" android:scaleType="fitXY" />
</FrameLayout>
</com.android.systemui.statusbar.phone.ExpandedView>
STEP -4
SystemUI.apk\smali\com\android\systemui\statusbar\ StatusBar.smali
search this line
Code:
invoke-direct/range {v11 .. v16}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V
and add this const/16 v16, -0x3 above it
Code:
const/4 v12, -0x1
const/16 v14, 0x7d0
const v15, 0x800048
const/16 v16, 0x4
[COLOR="Blue"]const/16 v16, -0x3[/COLOR]
invoke-direct/range {v11 .. v16}, Landroid/view/WindowManager$LayoutParams;-><init>(IIIII)V
.line 135
.local v11, lp:Landroid/view/WindowManager$LayoutParams;
move-object/from16 v0, p0
Next continue in Post # 2
STEP -5
SystemUI.apk\smali\com\android\systemui\statusbar\phone\ PhoneStatusBar.smali
Add the blue code
Code:
.field private mFlingGestureMaxXVelocityPx:F
.field mFocusChangeListener:Landroid/view/View$OnFocusChangeListener;
[COLOR="Blue"].field mGetStatusBarHeight:I[/COLOR]
.field mHandler:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;
.field mIconHPadding:I
Code:
[B]# direct methods
.method public constructor <init>()V[/B]
.locals 4
.prologue
const/4 v3, 0x2
const/4 v2, 0x0
const/4 v0, -0x1
const/4 v1, 0x0
.line 99
invoke-direct {p0}, Lcom/android/systemui/statusbar/StatusBar;-><init>()V
.line 155
iput v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNaturalBarHeight:I
.line 156
iput v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconSize:I
.line 157
iput v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconHPadding:I
.line 164
new-instance v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;
invoke-direct {v0, p0, v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;Lcom/android/systemui/statusbar/phone/PhoneStatusBar$1;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mHandler:Lcom/android/systemui/statusbar/phone/PhoneStatusBar$H;
.line 165
new-instance v0, Ljava/lang/Object;
invoke-direct {v0}, Ljava/lang/Object;-><init>()V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQueueLock:Ljava/lang/Object;
.line 188
new-instance v0, Lcom/android/systemui/statusbar/NotificationData;
invoke-direct {v0}, Lcom/android/systemui/statusbar/NotificationData;-><init>()V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNotificationData:Lcom/android/systemui/statusbar/NotificationData;
.line 192
new-array v0, v3, [I
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPositionTmp:[I
.line 203
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNavigationBarView:Lcom/android/systemui/statusbar/phone/NavigationBarView;
.line 236
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimatingReveal:Z
.line 238
new-array v0, v3, [I
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAbsPos:[I
.line 239
iput v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mLinger:I
.line 240
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mPostCollapseCleanup:Ljava/lang/Runnable;
.line 245
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mRecreating:Z
.line 248
iput v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabled:I
.line 251
iput [COLOR="Red"]v1[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mSystemUiVisibility:I
[COLOR="Blue"]iput [COLOR="Red"]v1[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGetStatusBarHeight:I[/COLOR]
.line 253
new-instance v0, Landroid/util/DisplayMetrics;
invoke-direct {v0}, Landroid/util/DisplayMetrics;-><init>()V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
Code:
[B].method private makeExpandedVisible()V[/B]
.locals 3
.prologue
const/4 v1, 0x1
.line 1267
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
if-eqz v0, :cond_0
.line 1282
:goto_0
return-void
.line 1270
:cond_0
iput-boolean v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
.line 1271
invoke-virtual {p0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->visibilityChanged(Z)V
.line 1273
const/16 v0, -0x2710
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateExpandedViewPos(I)V
.line 1274
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedParams:Landroid/view/WindowManager$LayoutParams;
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
and-int/lit8 v1, v1, -0x9
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 1275
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedParams:Landroid/view/WindowManager$LayoutParams;
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
const/high16 v2, 0x2
or-int/2addr v1, v2
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 1279
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedDialog:Landroid/app/Dialog;
invoke-virtual {v0}, Landroid/app/Dialog;->getWindow()Landroid/view/Window;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedParams:Landroid/view/WindowManager$LayoutParams;
invoke-virtual {v0, v1}, Landroid/view/Window;->setAttributes(Landroid/view/WindowManager$LayoutParams;)V
.line 1280
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedView:Lcom/android/systemui/statusbar/phone/ExpandedView;
const/4 v1, 0x2
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/ExpandedView;->requestFocus(I)Z
.line 1281
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTrackingView:Lcom/android/systemui/statusbar/phone/TrackingView;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/TrackingView;->setVisibility(I)V
[COLOR="Blue"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const/4 v1, 0x4
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->setVisibility(I)V[/COLOR]
goto :goto_0
.end method
Code:
[B].method performCollapse()V[/B]
.locals 4
.prologue
const/4 v3, 0x0
.line 1357
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
if-nez v0, :cond_1
.line 1379
:cond_0
:goto_0
return-void
.line 1360
:cond_1
iput-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedVisible:Z
.line 1361
invoke-virtual {p0, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->visibilityChanged(Z)V
.line 1362
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedParams:Landroid/view/WindowManager$LayoutParams;
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
or-int/lit8 v1, v1, 0x8
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 1363
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedParams:Landroid/view/WindowManager$LayoutParams;
iget v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
const v2, -0x20001
and-int/2addr v1, v2
iput v1, v0, Landroid/view/WindowManager$LayoutParams;->flags:I
.line 1364
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedDialog:Landroid/app/Dialog;
invoke-virtual {v0}, Landroid/app/Dialog;->getWindow()Landroid/view/Window;
move-result-object v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandedParams:Landroid/view/WindowManager$LayoutParams;
invoke-virtual {v0, v1}, Landroid/view/Window;->setAttributes(Landroid/view/WindowManager$LayoutParams;)V
.line 1365
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTrackingView:Lcom/android/systemui/statusbar/phone/TrackingView;
const/16 v1, 0x8
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/TrackingView;->setVisibility(I)V
[COLOR="Blue"]iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
const/4 v1, 0x0
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->setVisibility(I)V[/COLOR]
.line 1367
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabled:I
const/high16 v1, 0x2
and-int/2addr v0, v1
if-nez v0, :cond_2
Code:
[B].method protected makeStatusBarView()Landroid/view/View;[/B]
.locals 12
.prologue
const/16 v11, 0x8
const/4 v10, 0x0
.line 333
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mContext:Landroid/content/Context;
.line 335
.local v0, context:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
.line 337
.local v3, res:Landroid/content/res/Resources;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateDisplaySize()V
.line 338
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->loadDimens()V
[COLOR="Blue"]iget v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mNaturalBarHeight:I[/COLOR]
const v8, 0x105000e
invoke-virtual {v3, v8}, Landroid/content/res/Resources;->getDimensionPixelSize(I)I
move-result v8
iput v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mIconSize:I
STEP -6
Add the blue code
and pay attention to the red v1 iget v1, p0,..... you must write same like what move-result v1
Code:
[B].method doAnimation()V[/B]
.locals 4
.prologue
const/4 v2, 0x0
.line 1382
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimating:Z
if-eqz v0, :cond_0
.line 1385
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->incrementAnim()V
.line 1387
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimY:F
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
iget v1, v1, Landroid/util/DisplayMetrics;->heightPixels:I
add-int/lit8 v1, v1, -0x1
int-to-float v1, v1
cmpl-float v0, v0, v1
if-ltz v0, :cond_1
.line 1389
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimating:Z
.line 1390
const/16 v0, -0x2711
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateExpandedViewPos(I)V
.line 1391
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->performExpand()V
.line 1405
:cond_0
:goto_0
return-void
.line 1393
:cond_1
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimY:F
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getHeight()I
move-result [COLOR="Red"]v1[/COLOR]
[COLOR="Blue"]iget [COLOR="Red"]v1[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGetStatusBarHeight:I[/COLOR]
int-to-float v1, v1
cmpg-float v0, v0, v1
if-gez v0, :cond_2
.line 1395
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimating:Z
Code:
[B].method doRevealAnimation()V[/B]
.locals 5
.prologue
.line 1427
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCloseView:Lcom/android/systemui/statusbar/phone/CloseDragHandle;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/CloseDragHandle;->getHeight()I
move-result v1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getHeight()I
move-result [COLOR="Red"]v2[/COLOR]
[COLOR="Blue"]iget [COLOR="Red"]v2[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGetStatusBarHeight:I[/COLOR]
add-int v0, v1, v2
.line 1428
.local v0, h:I
iget-boolean v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimatingReveal:Z
Code:
[B].method getExpandedHeight(I)I[/B]
.locals 2
.parameter "disph"
.prologue
.line 2166
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getHeight()I
move-result [COLOR="Red"]v0[/COLOR]
[COLOR="Blue"]iget [COLOR="Red"]v0[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGetStatusBarHeight:I[/COLOR]
sub-int v0, p1, v0
iget-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mCloseView:Lcom/android/systemui/statusbar/phone/CloseDragHandle;
invoke-virtual {v1}, Lcom/android/systemui/statusbar/phone/CloseDragHandle;->getHeight()I
Code:
[B].method prepareTracking(IZ)V[/B]
.locals 6
.parameter "y"
.parameter "opening"
.prologue
const/16 v5, 0x65
const/16 v3, 0x64
const/4 v4, 0x1
.line 1449
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateExpandedSize()V
.line 1451
iput-boolean v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTracking:Z
.line 1452
invoke-static {}, Landroid/view/VelocityTracker;->obtain()Landroid/view/VelocityTracker;
move-result-object v2
iput-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mVelocityTracker:Landroid/view/VelocityTracker;
.line 1453
if-eqz p2, :cond_0
.line 1454
iget v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mExpandAccelPx:F
iput v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimAccel:F
.line 1455
iget v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mFlingExpandMinVelocityPx:F
iput v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimVel:F
.line 1456
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getHeight()I
move-result [COLOR="Red"]v2[/COLOR]
[COLOR="Blue"]iget [COLOR="Red"]v2[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGetStatusBarHeight:I[/COLOR]
int-to-float v2, v2
iput v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimY:F
.line 1457
iget v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mAnimY:F
Code:
[B].method updateExpandedViewPos(I)V[/B]
.locals 12
.parameter "expandedPosition"
.prologue
const/16 v11, -0x2710
const/4 v7, 0x1
.line 2070
iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mStatusBarView:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v8}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getHeight()I
move-result [COLOR="Red"]v3[/COLOR]
[COLOR="Blue"]iget [COLOR="Red"]v3[/COLOR], p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mGetStatusBarHeight:I[/COLOR]
.line 2071
.local v3, h:I
iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisplayMetrics:Landroid/util/DisplayMetrics;
iget v2, v8, Landroid/util/DisplayMetrics;->heightPixels:I
Done, and recompile your systemUI.apk
Credit & Thanks to :
Recognized Themer @serajr
Senior Member @ZN6
Recognized Developer @arco68
Senior member @mastershefis
reserved 5
Awesome guide bro... congrats!!! :good:
You ported exactly what I implemented on my initial ICS SystemUI mod, it is not for everyone... I think we have a new RD coming up... I have no doubt!!!
serajr said:
Awesome guide bro... congrats!!! :good:
You ported exactly what I implemented on my initial ICS SystemUI mod, it is not for everyone... I think we have a new RD coming up... I have no doubt!!!
Click to expand...
Click to collapse
Thanks,
I learned so many codes from your mods
This guide dont work for mdpi screens. SystemUI fc. Can you made it also for mdpi?
Adi Aisiteru Reborn said:
Done, and recompile your systemUI.apk
Credit & Thanks to :
Recognized Themer @serajr
Senior Member @ZN6
Recognized Developer @arco68
Senior member @mastershefis
Click to expand...
Click to collapse
I could not compile it. I get this error.
Code:
[7231,4] The register number must be less than v16
Exception in thread "main" brut.androlib.AndrolibException: Could not smali file: /home/grv/Projects/android/theme/try/SystemUI/smali/com/android/systemui/statusbar/phone/PhoneStatusBar.smali
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:45)
at brut.androlib.src.DexFileBuilder.addSmaliFile(DexFileBuilder.java:33)
at brut.androlib.src.SmaliBuilder.buildFile(SmaliBuilder.java:66)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:50)
at brut.androlib.src.SmaliBuilder.build(SmaliBuilder.java:37)
at brut.androlib.Androlib.buildSourcesSmali(Androlib.java:257)
at brut.androlib.Androlib.buildSources(Androlib.java:214)
at brut.androlib.Androlib.build(Androlib.java:205)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Here's my Phonestatusbar.smali, after adding everything http://ubuntuone.com/2JjDXRYSNQvnq05zk7dmII
Also, how's this mod different from this here http://forum.xda-developers.com/showpost.php?p=38232297&postcount=2
Hey hi ! I'm getting the same compile error as the guy above me . Why ?? Bro why,??
Sent from my A500 using xda premium
Sorry for the inconvenion.. the guide is work on my CM9 and it should work too on other Aosp base. Havn't test it on Mtk , leak , Tw.
Sent from my GT-I8150 using xda app-developers app
Can you help me out if I give you my phonestatusbar.smali ???
Sent from my A500 using xda premium
Dude ! Got it working !! Yay !!!! But it looks so weird that when I touch the status bar the whole screen goes up and realignes itself and when it comes down again
Sent from my A500 using xda premium
professor_proton said:
Dude ! Got it working !! Yay !!!! But it looks so weird that when I touch the status bar the whole screen goes up and realignes itself and when it comes down again
Sent from my A500 using xda premium
Click to expand...
Click to collapse
Anyone???
sent from my XOLO A500 running ionised rom you haven't heard of it ???
Please post the link of Xolo a500 ionised rom ..... please ...thanks in advance
Sent from my A500 using XDA Premium 4 mobile app
hp02 said:
Please post the link of Xolo a500 ionised rom ..... please ...thanks in advance
Sent from my A500 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
D Dude I'm currently working on it but my exams going on so give me a month
sent from my XOLO A500 running ionised rom you haven't heard of it ???
Thank u for ur reply
Sent from my A500 using XDA Premium 4 mobile app
professor_proton said:
Dude ! Got it working !! Yay !!!! But it looks so weird that when I touch the status bar the whole screen goes up and realignes itself and when it comes down again
Sent from my A500 using xda premium
Click to expand...
Click to collapse
thats because it uses full screen code and not used as overlay
SpaceCaker said:
thats because it uses full screen code and not used as overlay
Click to expand...
Click to collapse
Hi ! There's a guide by ZN6 about full screen systemui I followed that once but i missed some smali edit which caused the statusbar to use fullscreen but it didnt hide the statusbar so the statusbar overlapped the date bar (the area where the date and time comes ) if you could somehow make it overlap that would be awesome !
In not good enough at smali editing and usually end up with fc's
sent from my XOLO A500 running ionised rom you haven't heard of it ???

Categories

Resources