[MOD][Guide]Change Toggles Icon Theme "on the fly" - Galaxy S II Android Development

GUIDE TO CHANGE QUICKSETTING TOGGLES ICON THEME
work perfectly in my JB rom 4.1.2 xwlsd based
Before modding do a Nandroid Backup
thanks and credit to Goldie for his help to achieve this mod:good:
thanks and credit to Didact74 for how to add a listpreference:good:
thanks and credit to CNexus for his shared observer code:good:
To achieve you need:
SecSettings.apk
SystemUI.apk
tool for decompile and compile like apktool 1.5.2;
tool for text edit like notepad++:
Start with SecSettings.apk:
Decompile SecSettings.apk ,go in res/xml ,open with text editor display_settings.xml and add the red line
Code:
<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" />
[COLOR="Red"]<PreferenceCategory android:title="@string/statusbar_options" android:key="statusbar_options">
<ListPreference android:persistent="false" android:entries="@array/toggles_chooser_entries" android:title="@string/icon_toggles_chooser" android:key="toggles_chooser" android:summary="@string/icon_toggles_chooser_summary" android:entryValues="@array/toggles_chooser_values" />
</PreferenceCategory>[/COLOR]
Go in res/value open with text editor arrays.xml and add at the end the red line
Code:
[COLOR="Red"]<string-array name="toggles_chooser_entries">
<item>S2 Stock Toggles</item>
<item>S5 Stock Toggles</item>
<item>Green Toggles</item>
</string-array>
<string-array name="toggles_chooser_values">
<item>0</item>
<item>1</item>
<item>2</item>
</string-array>[/COLOR]
</resources>
Go in res/value open with text editor strings.xml and add at the end this line
Code:
<string name="statusbar_options">Statusbar Options</string>
<string name="icon_toggles_chooser">Toggles Theme</string>
<string name="icon_toggles_chooser_summary">Select toggles\'s icons theme</string>
</resources>
Go in smali\com\android\settings\DisplaySettings.smal i and add the following lines in RED
Code:
.field mSupportFolderType:Z
[COLOR="Red"].field private mTogglesTheme:Landroid/preference/ListPreference;[/COLOR]
.field private mTouchKeyLight:Landroid/preference/ListPreference;
In the same file find .method public onCreate and add the following lines in RED
Code:
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 424
iget-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v12, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="Red"]
const-string v12, "toggles_chooser"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
const-string v12, "toggles_chooser"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V[/COLOR]
.line 426
In the same file find .method public onPreferenceChange then find this code and add the red lines ,in blue line some explanation
Code:
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :[COLOR="Red"]cond_togglestheme[/COLOR] [COLOR="Blue"]change this from cond_2 to cond_togglestheme[/COLOR]
.line 1089
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_e
Code:
.line 1100
const-string v1, "DisplaySettings"
const-string v3, "CONTEXTUALPAGE_SWITCH_CHANGED changed = false"
invoke-static {v1, v3}, Landroid/util/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_7
:cond_11
move-wide v0, v4
goto/16 :goto_3
[COLOR="Red"]:cond_togglestheme
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mTogglesTheme:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4[/COLOR]
.end method
Save all changes and compile SecSettings
SystemUI part
Decompile SystemUI.apk ,download this zip View attachment togglestheme.zip and put the drawable png in res\drawable-hdpi
Compile SystemUI and decompile the new SystemUI.apk to obtain the new ids of the new pngs
So open SystemUI\res\value\public and leave it open
Go in SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting and open AirplaneModeQuickSettingButton,smali and add the following red lines, in blue lines some explanation
find .method public constructor <init>(Landroid/content/ContextV and change the code from this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v7, 0x0
.line 112
const/4 v2, 0x0
const v3, 0x7f0a00f5
const v4, 0x7f0201ba
const v5, 0x7f0201b9
const v6, 0x7f0201b8
move-object v0, p0
move-object v1, p1
move v8, v7
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 53
to this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v3, 0x7f0a00f5 [COLOR="Blue"] <--this is id of text show under the icon, this remain the same in each theme[/COLOR]
const v4, 0x7f0201ba[COLOR="Blue"] <--this id is of stock tw_quick_panel_icon_airplane_on, check if it's the same of you public[/COLOR]
const v5, 0x7f0201b9[COLOR="Blue"] <--this id is of stock tw_quick_panel_icon_airplane_off, check if it's the same of you public[/COLOR]
const v6, 0x7f0201b8[COLOR="Blue"] <--this id is of stock tw_quick_panel_icon_airplane_dim, check if it's the same of you public[/COLOR]
goto :goto_new
:cond_themes5
const v3, 0x7f0a00f5
const v4, 0x7f021104[COLOR="Blue"] <--this id is of s5tw_quick_panel_icon_airplane_on, check if it's the same of you public[/COLOR]
const v5, 0x7f021103[COLOR="Blue"] <--this id is of s5tw_quick_panel_icon_airplane_off, check if it's the same of you public[/COLOR]
const v6, 0x7f021102[COLOR="Blue"] <--this id is of s5tw_quick_panel_icon_airplane_dim, check if it's the same of you public[/COLOR]
goto :goto_new
:cond_green
const v3, 0x7f0a00f5
const v4, 0x7f0210d2[COLOR="Blue"] <--this id is of greentw_quick_panel_icon_airplane_on, check if it's the same of you public[/COLOR]
const v5, 0x7f0210d1[COLOR="Blue"] <--this id is of greentw_quick_panel_icon_airplane_off, check if it's the same of you public[/COLOR]
const v6, 0x7f0210d0[COLOR="Blue"] <--this id is of greentw_quick_panel_icon_airplane_dim, check if it's the same of you public[/COLOR]
:goto_new[/COLOR]
const/4 v7, 0x0
.line 112
const/4 v2, 0x0
move-object v0, p0
move-object v1, p1
move v8, v7
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 53
then apply the same code for these others smali file:
AllShareCastQuickSettingButton
AutoRotateQuickSettingButton
BluetoothQuickSettingButton
DoNotDisturbQuickSettingButton
DormantModeQuickSettingButton
DrivingModeQuickSettingButton
LocationQuickSettingButton
MobileDataQuickSettingButton
MultiWindowQuickSettingButton
NfcP2pQuickSettingButton
PowerSavingQuickSettingButton
SBeamQuickSettingButton
SilentModeQuickSettingButton
SmartStayQuickSettingButton
SyncQuickSettingButton
WifiQuickSettingButton
In the SilentModeQuickSettingButton.smali change code from this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
const/4 v2, 0x0
const v5, 0x7f0201ed
.line 53
const v3, 0x7f0a00ed
const v4, 0x7f0201ec
const/4 v6, 0x0
const v7, 0x7f0201eb
move-object v0, p0
move-object v1, p1
move v8, v5
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 36
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/quicksetting/SilentModeQuickSettingButton;->mAudioManager:Landroid/media/AudioManager;
to this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 9
.parameter "context"
.prologue
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v5, 0x7f0201ed [COLOR="Blue"] this id is stock tw_quick_panel_icon_silent_on [/COLOR]
const v3, 0x7f0a00ed[COLOR="Blue"] this id is for the text[/COLOR]
const v4, 0x7f0201ec[COLOR="Blue"] this id is stock tw_quick_panel_icon_silent_off [/COLOR]
const v7, 0x7f0201eb[COLOR="Blue"] this id is stock tw_quick_panel_icon_silent_on_on [/COLOR]
goto :goto_new
:cond_themes5
const v5, 0x7f02112a[COLOR="Blue"] this id is s5tw_quick_panel_icon_silent_on [/COLOR]
const v3, 0x7f0a00ed
const v4, 0x7f021128[COLOR="Blue"] this id is s5tw_quick_panel_icon_silent_on [/COLOR]
const v7, 0x7f021127[COLOR="Blue"] this id is s5tw_quick_panel_icon_silent_on [/COLOR]
goto :goto_new
:cond_green
const v5, 0x7f0210f8[COLOR="Blue"] this id is greentw_quick_panel_icon_silent_on [/COLOR]
const v3, 0x7f0a00ed
const v4, 0x7f0210f7[COLOR="Blue"] this id is greentw_quick_panel_icon_silent_on [/COLOR]
const v7, 0x7f0210f6[COLOR="Blue"] this id is greentw_quick_panel_icon_silent_on [/COLOR]
:goto_new[/COLOR]
const/4 v2, 0x0
.line 53
const/4 v6, 0x0
move-object v0, p0
move-object v1, p1
move v8, v5
invoke-direct/range {v0 .. v8}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;IIIIII)V
.line 36
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/quicksetting/SilentModeQuickSettingButton;->mAudioManager:Landroid/media/AudioManager;
For each smali files check each ids with yours in your public.xml
This part add the observer, is to change the icons theme in real time, whitout this part you need to restart device to show the changes
Go in SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting and open QuickSettingPanel
find .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;I)V and add the following red lines at the end
Code:
.line 99
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->update()V
.line 100
[COLOR="Red"]iget-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->mContext:Landroid/content/Context;
invoke-virtual {v0}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v0
invoke-direct {p0, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->regObserver(Landroid/content/ContentResolver;)V[/COLOR]
return-void
.end method
then add this entire in red method like this
Code:
.method static synthetic access$100(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;)I
.locals 1
.parameter "x0"
.prologue
.line 51
iget v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->mButtonCnt:I
return v0
.end method
[COLOR="Red"].method static synthetic access$500(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;)V
.locals 0
.parameter
.prologue
.line 83
invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->refreshView()V
return-void
.end method[/COLOR]
.method private disableQuickSettingButton([Ljava/lang/String;)[Ljava/lang/String;
.locals 3
then add this entire in red method like this
Code:
:cond_2
invoke-virtual {p0, v11}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;->prepareTranslationX(Z)V
.line 345
return-void
.end method
[COLOR="Red"].method private regObserver(Landroid/content/ContentResolver;)V
.locals 3
.parameter "cs"
.prologue
const/4 v2, 0x0
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel$SettingsObserver;
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
invoke-direct {v0, p0, p0, v1}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel$SettingsObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel;Landroid/os/Handler;)V
.local v0, ob:Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingPanel$SettingsObserver;
const-string v1, "toggles_chooser"
invoke-static {v1}, Landroid/provider/Settings$System;->getUriFor(Ljava/lang/String;)Landroid/net/Uri;
move-result-object v1
invoke-virtual {p1, v1, v2, v0}, Landroid/content/ContentResolver;->registerContentObserver(Landroid/net/Uri;ZLandroid/database/ContentObserver;)V
return-void
.end method[/COLOR]
.method private setViewWidth()I
.locals 5
then add this smali file View attachment QuickSettingPanel$SettingsObserver.zip in SystemUI\smali\com\android\systemui\statusbar\policy\quicksetting
Save all changes and compile SystemUI, the put SecSettings.apk and SystemUI.apk in your device.

reserved

hey buddy.
been trying to do this mod this morning but having problems.
my code doesn't match yours as im using android4.4 so its alittle different.
can you see from the below how I should change mine?
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
const v1, 0x7f0a00e5
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
.line 148
const v2, 0x7f0201ac
const v3, 0x7f0201ab
const v4, 0x7f0201aa
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V

maskerwsk said:
hey buddy.
been trying to do this mod this morning but having problems.
my code doesn't match yours as im using android4.4 so its alittle different.
can you see from the below how I should change mine?
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
const v1, 0x7f0a00e5
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
.line 148
const v2, 0x7f0201ac
const v3, 0x7f0201ab
const v4, 0x7f0201aa
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
Click to expand...
Click to collapse
what are refer those three ids in your constructor?

const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim

maskerwsk said:
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
Click to expand...
Click to collapse
try with this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
const v1, 0x7f0a00e5
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
.line 148
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
goto :goto_new
:cond_themes5
const v2, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_dim, check if it's the same of you public
goto :goto_new
:cond_green
const v2, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_dim, check if it's the same of you public
:goto_new[/COLOR]
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
instead of 0xxxxxxxx you need to check your ids,if this not work try to concact Goldie , now he is with 4.4 with his galaxy s5

thanks buddy, I've tried what you posted but still having issues.
when icon list is set to S2 Stock toggles, the airplane mode toggle is there but has no text.
when set to S5/Green toggles the airplane mode toggle disappears completely.

maskerwsk said:
thanks buddy, I've tried what you posted but still having issues.
when icon list is set to S2 Stock toggles, the airplane mode toggle is there but has no text.
when set to S5/Green toggles the airplane mode toggle disappears completely.
Click to expand...
Click to collapse
i suppose your const v1, 0x7f0a00e5 is for text, try with this
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"] invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v2, 0x2
if-eq v2, v1, :cond_green
const v1, 0x7f0a00e5
const v2, 0x7f0201ac --> tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ab --> tw_quick_panel_icon_airplane_off
const v4, 0x7f0201aa --> tw_quick_panel_icon_airplane_dim
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e5
const v2, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of s5tw_quick_panel_icon_airplane_dim, check if it's the same of you public
goto :goto_new
:cond_green
const v1, 0x7f0a00e5
const v2, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_on, check if it's the same of you public
const v3, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_off, check if it's the same of you public
const v4, 0xxxxxxxx <--this id is of greentw_quick_panel_icon_airplane_dim, check if it's the same of you public
:goto_new[/COLOR]
const/4 v7, 0x1
const/4 v5, 0x0
.line 145
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
move v0, v7
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 64
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOn:Z
.line 65
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsTurningOff:Z
.line 68
iput-boolean v5, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIsWaitingForEcmExit:Z
.line 79
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 117
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton$2;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AirplaneModeQuickSettingButton;->mPhoneStateListener:Landroid/telephony/PhoneStateListener;
.line 147
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v6, v5
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V

PERFECT!!!!!
thanks a lot mate, works great!! well done!!!
now for all the other toggles lol

maskerwsk said:
PERFECT!!!!!
thanks a lot mate, works great!! well done!!!
now for all the other toggles lol
Click to expand...
Click to collapse
You are welcome
Inviato dal mio GT-I9100 utilizzando Tapatalk

remuntada78 said:
You are welcome
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
EDIT - here is the code im using in red (I removed one set of icons, only want stock and s5)
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0201ef #tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const v3, 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 57
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mAutoRotationObserver:Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
.line 65
iput-boolean v4, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mSupportFolderType:Z
.line 68
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 100
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v5, v4
move v6, v4
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
.line 111
:goto_1
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V
.line 112
return-void
:cond_0
move v0, v4
.line 98
goto :goto_0
.line 108
:cond_1
const v0, 0x7f0201f0
invoke-virtual {p0, v1, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(II)V
goto :goto_1
.end method

maskerwsk said:
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
Click to expand...
Click to collapse
have you added the right ids of the toggles on?
Inviato dal mio GT-I9100 utilizzando Tapatalk

remuntada78 said:
have you added the right ids of the toggles on?
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
yeah ids are correct, checked them several times.
I edited my post above btw incase you missed it

maskerwsk said:
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
EDIT - here is the code im using in red (I removed one set of icons, only want stock and s5)
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0201ef #tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const v3, 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 57
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mAutoRotationObserver:Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
.line 65
iput-boolean v4, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mSupportFolderType:Z
.line 68
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 100
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v5, v4
move v6, v4
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
.line 111
:goto_1
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V
.line 112
return-void
:cond_0
move v0, v4
.line 98
goto :goto_0
.line 108
:cond_1
const v0, 0x7f0201f0
invoke-virtual {p0, v1, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(II)V
goto :goto_1
.end method
Click to expand...
Click to collapse
try to change your code like this, in blue what i changed
Code:
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const[COLOR="Blue"] v3[/COLOR], 0x7f0a00e1
const[COLOR="Blue"] v4[/COLOR], 0x7f0201ef #tw_quick_panel_icon_airplane_on
const[COLOR="Blue"] v5[/COLOR], 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const[COLOR="Blue"] v3[/COLOR], 0x7f0a00e1
const[COLOR="Blue"] v4[/COLOR], 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const[COLOR="Blue"] v5[/COLOR], 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0

maskerwsk said:
Hi again buddy.
just found a little issue with the mod.
When the toggle is turned off, the icons show as they should,
however when I turn on the toggle the icon disappears.
the toggle still works etc, just no icon.
any ideas
EDIT - here is the code im using in red (I removed one set of icons, only want stock and s5)
Code:
# direct methods
.method public constructor <init>(Landroid/content/Context;)V
.locals 8
.parameter "context"
.prologue
[COLOR="Red"]invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "toggles_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v2, v1, :cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0201ef #tw_quick_panel_icon_airplane_on
const v3, 0x7f0201ee #tw_quick_panel_icon_airplane_off
goto :goto_new
:cond_themes5
const v1, 0x7f0a00e1
const v2, 0x7f0202fd #s5tw_quick_panel_icon_airplane_on
const v3, 0x7f0202fc #s5tw_quick_panel_icon_airplane_off
:goto_new[/COLOR]
const/4 v4, 0x0
.line 98
const/4 v2, 0x0
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
invoke-direct {p0, p1, v2, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;Z)V
.line 57
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mAutoRotationObserver:Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$AutoRotationObserver;
.line 65
iput-boolean v4, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mSupportFolderType:Z
.line 68
new-instance v0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;
invoke-direct {v0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton$1;-><init>(Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/policy/quicksetting/AutoRotateQuickSettingButton;->mIntentReceiver:Landroid/content/BroadcastReceiver;
.line 100
sget-boolean v0, Lcom/android/systemui/statusbar/Feature;->mUseJellyBeanGUI:Z
if-eqz v0, :cond_1
move-object v0, p0
move v5, v4
move v6, v4
invoke-virtual/range {v0 .. v6}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(IIIIII)V
.line 111
:goto_1
invoke-virtual {p0, p0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->setListener(Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton$Listener;)V
.line 112
return-void
:cond_0
move v0, v4
.line 98
goto :goto_0
.line 108
:cond_1
const v0, 0x7f0201f0
invoke-virtual {p0, v1, v0}, Lcom/android/systemui/statusbar/policy/quicksetting/QuickSettingButton;->initLayout(II)V
goto :goto_1
.end method
Click to expand...
Click to collapse
are you sure you are doing in the right way?, because in your code you talk about tw_quick_panel_icon_airplane but the file is for AutoRotateQuickSettingButton

Yeah i just left those # values to show me which ones relate to on, off, and dim. The ids are definatly right plus i would get airplane icon when toggle is off if it was wrong. Which i dont
Sent from my SM-N9005 using XDA Premium 4 mobile app
---------- Post added at 07:01 PM ---------- Previous post was at 06:59 PM ----------
And thanks ill try those new v values
Sent from my SM-N9005 using XDA Premium 4 mobile app

Didnt work with the new values. Lost toggle completly. Wondering if theres an easier way to do it using quickbutton smali rather than having to mod every toggle. Maybe setvisibility on exsisting s5 toggle files the note 3 has
Sent from my SM-N9005 using XDA Premium 4 mobile app

maskerwsk said:
Didnt work with the new values. Lost toggle completly. Wondering if theres an easier way to do it using quickbutton smali rather than having to mod every toggle. Maybe setvisibility on exsisting s5 toggle files the note 3 has
Sent from my SM-N9005 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
yes my was just an attempt
you lost your toggles because the original toggles are set with v1, v2, v3 registers so you need tu use this value
i don't understand why your code doesn't work it's right

Im wondering if it has something to do with another mod i have. I can color the toggle icons, text and background so maybe its something to do with that.
Sent from my SM-N9005 using XDA Premium 4 mobile app

maskerwsk said:
Im wondering if it has something to do with another mod i have. I can color the toggle icons, text and background so maybe its something to do with that.
Sent from my SM-N9005 using XDA Premium 4 mobile app
Click to expand...
Click to collapse
maybe yes if the added code is in the same file where you want add the code for change the toggles

Related

[HOW-TO] [LSJ] [4.1.2] Volume Rocker mod **26 NOV fixed**

Hello xda'ers.
Today I post this thread to help people who want volume rocker mod in their I9100.
This thread is not supposed to be a request thread, especially for non thanking people, but is open to help, support and debug (or improves).
For DEVs the how to on jelly bean [LSJ] (add green parts)
edit PhoneWindowManager.smali in android.policy.jar
Code:
.field private mIsSensorhubEnabled:Z
.field mIsSleepWithCameraOnTop:Z
.field private mIsTablet:Z
.field private mIsVisibleSPenGestureView:Z
[COLOR="YellowGreen"].field mIsVolumeAction:Z
.field mIsVolumeBlocking:Z
[/COLOR]
.field mKeyboardTapVibePattern:[J
.field mKeyguard:Landroid/view/WindowManagerPolicy$WindowState;
.field mKeyguardMediator:Lcom/android/internal/policy/impl/KeyguardViewMediator;
Code:
.field private mVolumeDownKeyTime:J
.field private mVolumeDownKeyTriggered:Z
[COLOR="YellowGreen"].field mVolumeDownLongPress:Ljava/lang/Runnable;[/COLOR]
.field private final mVolumeKeyLongPressforOneTouchReport:Ljava/lang/Runnable;
.field private mVolumeUpKeyConsumedByOneTouchReportChord:Z
.field private mVolumeUpKeyConsumedByScreenRecordChord:Z
.field private mVolumeUpKeyTime:J
.field private mVolumeUpKeyTriggered:Z
[COLOR="YellowGreen"].field mVolumeUpLongPress:Ljava/lang/Runnable;[/COLOR]
.field mWindowManager:Landroid/view/IWindowManager;
.field mWindowManagerFuncs:Landroid/view/WindowManagerPolicy$WindowManagerFuncs;
Code:
.line 7234
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$35;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$35;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenLockTimeout:Ljava/lang/Runnable;
[COLOR="YellowGreen"] .line 8130
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipNext;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipNext;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.line 8131
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipPrev;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$SkipPrev;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
[/COLOR]
.line 8132
return-void
.end method
Code:
.method handleVolumeKey(II)V
.registers 8
.parameter "stream"
.parameter "keycode"
.prologue
.line 5405
[COLOR="YellowGreen"] move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-nez v0, :cond_c[/COLOR]
invoke-static {}, Lcom/android/internal/policy/impl/PhoneWindowManager;->getAudioService()Landroid/media/IAudioService;
move-result-object v0
.line 5406
.local v0, audioService:Landroid/media/IAudioService;
if-nez v0, :cond_7
.line 5437
[COLOR="YellowGreen"] :cond_c
:goto_c[/COLOR]
return-void
[COLOR="Red"]:goto_6[/COLOR]
Code:
.line 5435
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
[COLOR="YellowGreen"]goto :goto_c[/COLOR]
[COLOR="Red"] goto :goto_6[/COLOR]
Code:
.line 5435
iget-object v2, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBroadcastWakeLock:Landroid/os/PowerManager$WakeLock;
invoke-virtual {v2}, Landroid/os/PowerManager$WakeLock;->release()V
[COLOR="YellowGreen"]goto :goto_c[/COLOR]
[COLOR="Red"]goto :goto_6[/COLOR]
add this just above .method public hasNavigationBar()Z
Code:
[COLOR="YellowGreen"].method handleVolumeLongPress(I)V
.registers 6
.parameter "keycode"
.prologue
const/4 v1, 0x1
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
const/4 v1, 0x0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
const/16 v1, 0x18
if-ne p1, v1, :cond_19
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
.local v0, btnHandler:Ljava/lang/Runnable;
:goto_e
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
invoke-static {}, Landroid/view/ViewConfiguration;->getTapTimeout()I
move-result v2
int-to-long v2, v2
invoke-virtual {v1, v0, v2, v3}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
return-void
.end local v0 #btnHandler:Ljava/lang/Runnable;
:cond_19
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
.restart local v0 #btnHandler:Ljava/lang/Runnable;
goto :goto_e
.end method
.method handleVolumeLongPressAbort()V
.registers 3
.prologue
const/4 v1, 0x0
move-object/from16 v0, p0
iput-boolean v1, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeUpLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
iget-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mHandler:Landroid/os/Handler;
iget-object v1, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mVolumeDownLongPress:Ljava/lang/Runnable;
invoke-virtual {v0, v1}, Landroid/os/Handler;->removeCallbacks(Ljava/lang/Runnable;)V
return-void
.end method
[/COLOR]
Code:
.line 5838
:cond_388
:goto_388
[COLOR="YellowGreen"]if-eqz v5, :cond_mir[/COLOR]
[COLOR="Red"]if-eqz v5, :cond_4f3[/COLOR]
Code:
.line 5926
.end local v6 #ex:Landroid/os/RemoteException;
:cond_4c0
move-object/from16 v0, p0
[COLOR="YellowGreen"] iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mScreenOnEarly:Z
if-nez v0, :cond_new
invoke-virtual/range {p0 .. p0}, Lcom/android/internal/policy/impl/PhoneWindowManager;->isMusicActive()Z
move-result v25
if-eqz v25, :cond_new
move-object/from16 v0, p0
move/from16 v14, v18
invoke-virtual {v0, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeLongPress(I)V
:cond_new
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 v27, v0
if-nez v27, :cond_68
Code:
.line 5934
.end local v26 #telephonyService:Lcom/android/internal/telephony/ITelephony;
[COLOR="Red"]:cond_4f3[/COLOR]
[COLOR="YellowGreen"]:cond_mir
if-nez v5, :cond_ko
move-object/from16 v0, p0
iget-boolean v0, v0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeBlocking:Z
if-eqz v0, :cond_ko
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_ko
move-object/from16 v0, p0
const/4 v3, 0x0
move/from16 v14, v18
invoke-virtual {v0, v3, v14}, Lcom/android/internal/policy/impl/PhoneWindowManager;->handleVolumeKey(II)V
:cond_ko[/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 v27, v0
if-eqz v27, :cond_68
add this method under .method sendCloseSystemWindows(Ljava/lang/StringV
Code:
[COLOR="YellowGreen"].method protected sendMediaButtonEvent(I)V
.registers 15
.parameter "code"
.prologue
invoke-static {}, Landroid/os/SystemClock;->uptimeMillis()J
move-result-wide v1
.local v1, eventtime:J
new-instance v11, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v11, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v11, downIntent:Landroid/content/Intent;
new-instance v0, Landroid/view/KeyEvent;
const/4 v5, 0x0
const/4 v7, 0x0
move-wide v3, v1
move v6, p1
invoke-direct/range {v0 .. v7}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v0, downEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v11, v4, v0}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v11, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
new-instance v12, Landroid/content/Intent;
const-string v4, "android.intent.action.MEDIA_BUTTON"
const/4 v5, 0x0
invoke-direct {v12, v4, v5}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V
.local v12, upIntent:Landroid/content/Intent;
new-instance v3, Landroid/view/KeyEvent;
const/4 v8, 0x1
const/4 v10, 0x0
move-wide v4, v1
move-wide v6, v1
move v9, p1
invoke-direct/range {v3 .. v10}, Landroid/view/KeyEvent;-><init>(JJIII)V
.local v3, upEvent:Landroid/view/KeyEvent;
const-string v4, "android.intent.extra.KEY_EVENT"
invoke-virtual {v12, v4, v3}, Landroid/content/Intent;->putExtra(Ljava/lang/String;Landroid/os/Parcelable;)Landroid/content/Intent;
iget-object v4, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mContext:Landroid/content/Context;
const/4 v5, 0x0
invoke-virtual {v4, v12, v5}, Landroid/content/Context;->sendOrderedBroadcast(Landroid/content/Intent;Ljava/lang/String;)V
const/4 v8, 0x1
move-object/from16 v9, p0
iput-boolean v8, v9, Lcom/android/internal/policy/impl/PhoneWindowManager;->mIsVolumeAction:Z
return-void
.end method[/COLOR]
done.
now add the 2 subclasses attached and recompile.
Mirko ddd said:
Hello xda'ers.
Today I post this thread to help people who want volume rocker mod in their I9100.
Mod is based on kahvitara's one, but cleaned up and easier to implement; no SDcard path, minimum delay and ready to use.
This thread is not supposed to be a request thread, especially for non thanking people, but is open to help, support and debug (or improves).
here is the smali diffs, and u can find the untouched file before of applying the mod so u can compare and implement it easily.
Tested on I9100 (my phone) but will work on US clones, and most of ICS samsung touchwized phones with some rearranging.
Currently I m on LPX, if someone cares I can provide the zip, but only with this mod and reccommended ONLY to samsung stock deodexed roms LPX.
Click to expand...
Click to collapse
Another awwsome mod by Mirko.!! Always grt to hv you arnd mate :good:
geekynoob said:
Another awwsome mod by Mirko.!! Always grt to hv you arnd mate :good:
Click to expand...
Click to collapse
Inviato dal mio GT-I9100 con Tapatalk 2
Hi Mirko.
In your file you have this code. In the stock file I am comparing to and the PhoneWindowManager$KillConcept.smali file does not exist either. Is this part new code and new file?:
Code:
.line 3674
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
tdunham said:
Hi Mirko.
In your file you have this code. In the stock file I am comparing to and the PhoneWindowManager$KillConcept.smali file does not exist either. Is this part new code and new file?:
Code:
.line 3674
new-instance v0, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;
invoke-direct {v0, p0}, Lcom/android/internal/policy/impl/PhoneWindowManager$KillConcept;-><init>(Lcom/android/internal/policy/impl/PhoneWindowManager;)V
iput-object v0, p0, Lcom/android/internal/policy/impl/PhoneWindowManager;->mBackLongPress:Ljava/lang/Runnable;
Click to expand...
Click to collapse
i don t understand, are we talking about backto kill or volume rocker?
Mirko ddd said:
i don t understand, are we talking about backto kill or volume rocker?
Click to expand...
Click to collapse
This is for Volume Rocker. I do not have those lines or (Killconcept file) in my code. I also download this: i9100_XWLPX_Deodexed_signed.zip hoping to have stock android.policy.jar for comparison and is does not exist there either. So I thought I would ask.
Edit: I feel foolish, you put code on Github that included code for back to kill mod. I should have noticed. You may want to remove that code to prevent confusion.
tdunham said:
This is for Volume Rocker. I do not have those lines or (Killconcept file) in my code. I also download this: i9100_XWLPX_Deodexed_signed.zip hoping to have stock android.policy.jar for comparison and is does not exist there either. So I thought I would ask.
Click to expand...
Click to collapse
mate.. kill concept smali has nothing to do with volume rocker
Mirko ddd said:
mate.. kill concept smali has nothing to do with volume rocker
Click to expand...
Click to collapse
Yes, no problem. I found out as soon as I posted. Thanks.
tdunham said:
Yes, no problem. I found out as soon as I posted. Thanks.
Click to expand...
Click to collapse
lol :silly:
MirkO You Are Really Great
updated to LSJ
reupdated
Nice work
One thing tho, a fast look and seems like you have a field missing:
.field mVolumeDownPress:Ljava/lang/Runnable;
LegendK95 said:
Nice work
One thing tho, a fast look and seems like you have a field missing:
.field mVolumeDownPress:Ljava/lang/Runnable;
Click to expand...
Click to collapse
lol is there, but it s not highlighted well, damn txt editor!
can u make it for odexed one please thanks
Thanks mate for the guide, gonna try it tomorrow.
MyLifeRocks10 said:
Thanks mate for the guide, gonna try it tomorrow.
Click to expand...
Click to collapse
yoshi it s easy to implement, later this week i ll try to improve it.
I am sorry for my ignorance. But what is this supposed to do?
MySeLfPT said:
I am sorry for my ignorance. But what is this supposed to do?
Click to expand...
Click to collapse
Mmh, in OP there s a zip to flash on LSJ jelly bean deodexed rom to get skip songs while screen is off.
And there s a tutorial too to help rom developers to include this feature into their own roms.
Hope u understand now
Mirko, during screen-off single press skips the song instead changing the volume, what did I wrong?
Btw, I think the "goto_6" doesn't need to be changed to "goto_c".

[HOW-TO] Disable the E911 Icon

This comes up frequently, and the icon is annoying. If you don't know what icon I'm talking about, it looks like one of the two that are attached to the post and lives next to the signal indicator. First, I'm going to assume you know how to decompile/recompile an APK. If you don't, well, go find out how to do that first, then come back because it isn't terribly difficult, and knowledge is power Now, what you need is SystemUI and you need to decompile it into resources (images and xml) and smali (java bytecode). Once that is done, we're looking for one specific file.
In the decompiled apk, find smali/com/android/systemui/statusbar/policy/LocationController.smali and open it in your favorite text editor. Replace the entire contents of the file with the following (NOTE: This is for VRALL4, it may be slightly different if you are on a different build):
Code:
.class public Lcom/android/systemui/statusbar/policy/LocationController;
.super Landroid/content/BroadcastReceiver;
.source "LocationController.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/policy/LocationController$1;,
Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;
}
.end annotation
# static fields
.field private static final EVENT_STOP_GPS_TONE:I = 0x40
.field private static final GPS_NOTIFICATION_ID:I = 0x3d8d7
.field private static final GPS_NOTI_STATUS:Ljava/lang/String; = "gps_notification_sounds"
.field private static final TAG:Ljava/lang/String; = "StatusBar.LocationController"
.field private static final sLBSImages:[I
# instance fields
.field private LBS_ENABLED:Ljava/lang/String;
.field private LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String;
.field private VZW_PROVIDER:Ljava/lang/String;
.field private mContext:Landroid/content/Context;
.field private mFocusToneGenerator:Landroid/media/ToneGenerator;
.field private final mHandler:Landroid/os/Handler;
.field private mMyContext:Landroid/content/Context;
.field private mNotificationService:Landroid/app/INotificationManager;
.field private mService:Landroid/app/StatusBarManager;
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 79
const/4 v0, 0x2
new-array v0, v0, [I
fill-array-data v0, :array_0
sput-object v0, Lcom/android/systemui/statusbar/policy/LocationController;->sLBSImages:[I
return-void
nop
:array_0
.array-data 0x4
0xc6t 0x0t 0x2t 0x7ft
0xc7t 0x0t 0x2t 0x7ft
.end array-data
.end method
.method public constructor <init>(Landroid/content/Context;)V
.locals 4
.parameter "context"
.prologue
const/4 v3, 0x0
.line 87
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
.line 69
new-instance v2, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;
invoke-direct {v2, p0, v3}, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;-><init>(Lcom/android/systemui/statusbar/policy/LocationController;Lcom/android/systemui/statusbar/policy/LocationController$1;)V
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler;
.line 78
iput-object v3, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mService:Landroid/app/StatusBarManager;
.line 83
const-string v2, "com.android.internal.location.intent.action.LBS_ENABLED_CHANGE"
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String;
.line 84
const-string v2, "lbsEnabled"
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED:Ljava/lang/String;
.line 85
const-string v2, "vzw_lbs"
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->VZW_PROVIDER:Ljava/lang/String;
.line 88
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
.line 89
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mMyContext:Landroid/content/Context;
.line 91
new-instance v0, Landroid/content/IntentFilter;
invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V
.line 92
.local v0, filter:Landroid/content/IntentFilter;
const-string v2, "android.location.GPS_ENABLED_CHANGE"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 93
const-string v2, "android.location.GPS_FIX_CHANGE"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 97
invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
.line 99
const-string v2, "notification"
invoke-virtual {p1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/app/NotificationManager;
.line 101
.local v1, nm:Landroid/app/NotificationManager;
invoke-static {}, Landroid/app/NotificationManager;->getService()Landroid/app/INotificationManager;
move-result-object v2
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager;
.line 109
return-void
.end method
.method private GenerateBeep()V
.locals 13
.prologue
const/4 v12, 0x0
const/4 v11, 0x1
.line 114
iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
.line 115
const/4 v3, 0x0
.line 116
.local v3, MIN_VOLUME_LEV:I
const/4 v1, 0x7
.line 117
.local v1, MAX_VOLUME_LEV:I
const/16 v4, 0xe
.line 118
.local v4, VOLUME_STEP:I
const/4 v2, 0x0
.line 119
.local v2, MIN_VOLUME:I
const/16 v0, 0x64
.line 120
.local v0, MAX_VOLUME:I
move v8, v0
.line 122
.local v8, mCurVol:I
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
const-string v10, "audio"
invoke-virtual {v9, v10}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v5
check-cast v5, Landroid/media/AudioManager;
.line 124
.local v5, audioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v11}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v8
.line 126
const-string v9, "StatusBar.LocationController"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "GenerateBeep: Volumei Level:"
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 128
if-lt v8, v3, :cond_2
if-gt v8, v1, :cond_2
.line 130
if-eq v8, v1, :cond_1
.line 131
mul-int/2addr v8, v4
.line 135
:goto_0
const-string v9, "StatusBar.LocationController"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "GenerateBeep: valid Volume:"
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 144
:goto_1
:try_start_0
new-instance v9, Landroid/media/ToneGenerator;
const/4 v10, 0x1
invoke-direct {v9, v10, v8}, Landroid/media/ToneGenerator;-><init>(II)V
iput-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 151
:goto_2
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
if-eqz v9, :cond_0
.line 152
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler;
const/16 v10, 0x40
invoke-virtual {v9, v10}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;
move-result-object v7
.line 153
.local v7, m:Landroid/os/Message;
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
const/16 v10, 0x1c
invoke-virtual {v9, v10}, Landroid/media/ToneGenerator;->startTone(I)Z
.line 154
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler;
const-wide/16 v10, 0x1f4
invoke-virtual {v9, v7, v10, v11}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 157
.end local v7 #m:Landroid/os/Message;
:cond_0
return-void
.line 133
:cond_1
move v8, v0
goto :goto_0
.line 138
:cond_2
const-string v9, "StatusBar.LocationController"
const-string v10, "Error getting current volume: Setting volume as max volume"
invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 139
move v8, v0
goto :goto_1
.line 145
:catch_0
move-exception v6
.line 147
.local v6, e:Ljava/lang/Exception;
iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
.line 148
sget-object v9, Ljava/lang/System;->err:Ljava/io/PrintStream;
invoke-virtual {v9, v6}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
goto :goto_2
.end method
.method static synthetic access$100(Lcom/android/systemui/statusbar/policy/LocationController;)Landroid/media/ToneGenerator;
.locals 1
.parameter "x0"
.prologue
.line 60
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
return-object v0
.end method
.method static synthetic access$102(Lcom/android/systemui/statusbar/policy/LocationController;Landroid/media/ToneGenerator;)Landroid/media/ToneGenerator;
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 60
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
return-object p1
.end method
.method private checkLBSStatus()Z
.locals 1
.prologue
.line 300
const/4 v0, 0x0
return v0
.end method
.method private final updateLBS(Landroid/content/Intent;)V
.locals 0
.parameter "intent"
.prologue
.line 290
return-void
.end method
# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 15
.parameter "context"
.parameter "intent"
.prologue
.line 162
invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v7
.line 163
.local v7, action:Ljava/lang/String;
const-string v1, "enabled"
const/4 v2, 0x0
move-object/from16 v0, p2
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v8
.line 171
.local v8, enabled:Z
const/4 v13, 0x0
.line 172
.local v13, valueFromPrefs:Z
const-string v1, "StatusBar.LocationController"
const-string v2, "onReceive: [GPS ICON]"
invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 182
const-string v1, "android.location.GPS_FIX_CHANGE"
invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
if-eqz v8, :cond_0
.line 184
const v10, 0x10806c7
.line 185
.local v10, iconId:I
const v12, 0x7f0a0083
.line 186
.local v12, textResId:I
const/4 v14, 0x1
.line 228
.local v14, visible:Z
:goto_0
if-eqz v14, :cond_2
.line 229
:try_start_0
new-instance v9, Landroid/content/Intent;
const-string v1, "android.settings.LOCATION_SOURCE_SETTINGS"
invoke-direct {v9, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 230
.local v9, gpsIntent:Landroid/content/Intent;
const/high16 v1, 0x1000
invoke-virtual {v9, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 231
const/4 v1, 0x0
const/4 v2, 0x0
move-object/from16 v0, p1
invoke-static {v0, v1, v9, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
move-result-object v11
.line 233
.local v11, pendingIntent:Landroid/app/PendingIntent;
new-instance v1, Landroid/app/Notification$Builder;
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-direct {v1, v2}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V
invoke-virtual {v1, v10}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;
move-result-object v1
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-virtual {v2, v12}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v1
const/4 v2, 0x1
invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setOngoing(Z)Landroid/app/Notification$Builder;
move-result-object v1
invoke-virtual {v1, v11}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Notification$Builder;->getNotification()Landroid/app/Notification;
move-result-object v5
.line 241
.local v5, n:Landroid/app/Notification;
const/4 v1, 0x0
iput-object v1, v5, Landroid/app/Notification;->tickerView:Landroid/widget/RemoteViews;
.line 242
const/4 v1, 0x0
iput-object v1, v5, Landroid/app/Notification;->tickerText:Ljava/lang/CharSequence;
.line 244
const/4 v1, 0x1
iput v1, v5, Landroid/app/Notification;->priority:I
.line 246
const/4 v1, 0x1
new-array v6, v1, [I
.line 247
.local v6, idOut:[I
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager;
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v2
const/4 v3, 0x0
const v4, 0x3d8d7
invoke-interface/range {v1 .. v6}, Landroid/app/INotificationManager;->enqueueNotificationWithTag(Ljava/lang/String;Ljava/lang/String;ILandroid/app/Notification;[I)V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
.line 261
.end local v5 #n:Landroid/app/Notification;
.end local v6 #idOut:[I
.end local v9 #gpsIntent:Landroid/content/Intent;
.end local v11 #pendingIntent:Landroid/app/PendingIntent;
:goto_1
return-void
.line 189
.end local v10 #iconId:I
.end local v12 #textResId:I
.end local v14 #visible:Z
:cond_0
const-string v1, "android.location.GPS_ENABLED_CHANGE"
invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_1
if-nez v8, :cond_1
.line 191
const/4 v14, 0x0
.line 192
.restart local v14 #visible:Z
const/4 v12, 0x0
.restart local v12 #textResId:I
move v10, v12
.restart local v10 #iconId:I
goto :goto_0
.line 199
.end local v10 #iconId:I
.end local v12 #textResId:I
.end local v14 #visible:Z
:cond_1
const-string v1, "StatusBar.LocationController"
const-string v2, "onReceive: [GPS ICON] GPS is on, but not receiving fixes"
invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 200
const v10, 0x7f0200c5
.line 201
.restart local v10 #iconId:I
const v12, 0x7f0a0082
.line 202
.restart local v12 #textResId:I
const/4 v14, 0x1
.restart local v14 #visible:Z
goto :goto_0
.line 254
:cond_2
:try_start_1
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager;
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v2
const v3, 0x3d8d7
invoke-interface {v1, v2, v3}, Landroid/app/INotificationManager;->cancelNotification(Ljava/lang/String;I)V
:try_end_1
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_1
.line 258
:catch_0
move-exception v1
goto :goto_1
.end method
Save the file, rebuild SystemUI.apk and enjoy
Well this possibly be implemented in your ROM?
Thanks!
Sent from my SCH-I605 using xda premium
Jetdr said:
Well this possibly be implemented in your ROM?
Thanks!
Sent from my SCH-I605 using xda premium
Click to expand...
Click to collapse
Already is
Why do this over just renaming the image files? Seems like a lot of work for the same thing.
Its TwiX said:
Why do this over just renaming the image files? Seems like a lot of work for the same thing.
Click to expand...
Click to collapse
This gets rid of the icon in what would be a "proper" manner. If you replaced the icon with a transparent image (what many people do), it still takes up a location on the status bar, and you may see an empty space between icons, or partially hidden notifications, if you use that method. Deleting the icon entirely would make an APK that can't be recompiled since the resources are missing.
This will allow you to make the icon fully disappear without taking up any space on the status bar, and allowing for the APK to be decompiled/recompiled in the future for more modifications.
imnuts said:
Already is
Click to expand...
Click to collapse
Here comes another Rom! Love it!
well icon is still appearing after opening up maps or after opening an app that uses the gps. upon reboot its gone but it re appears after using the gps. any other ideas?
inline6power said:
well icon is still appearing after opening up maps or after opening an app that uses the gps. upon reboot its gone but it re appears after using the gps. any other ideas?
Click to expand...
Click to collapse
Are you sure that's not the regular GPS symbol you're seeing? Screenshot?
Sent from my unlocked & underclocked Galaxy Note 2
sleevasteve said:
Are you sure that's not the regular GPS symbol you're seeing? Screenshot?
Sent from my unlocked & underclocked Galaxy Note 2
Click to expand...
Click to collapse
Sent from my SCH-I605 using Tapatalk 2
---------- Post added at 05:56 PM ---------- Previous post was at 05:54 PM ----------
I habe verified I have the right code in the right location. As soon as I reboot the icon is gone but if I use any app that uses gps it pops back up
Sent from my SCH-I605 using Tapatalk 2
can anyone else comfirm if the icon reappears after using maps or navigation?
I'll look through and make sure I didn't also change something else when I made this change. I didn't think I did, but I was looking for other items when I found this too.
inline6power said:
Sent from my SCH-I605 using Tapatalk 2
---------- Post added at 05:56 PM ---------- Previous post was at 05:54 PM ----------
I habe verified I have the right code in the right location. As soon as I reboot the icon is gone but if I use any app that uses gps it pops back up
Sent from my SCH-I605 using Tapatalk 2
Click to expand...
Click to collapse
In the meantime, just changing the extension of the .PNG files to .bak will do the trick. And it didn't seem to leave a blank space for me in the status bar, the only one that did that for me was the alarm clock icon.
Sent from my unlocked & underclocked Galaxy Note 2
I fixed the issue with the icon reappearing and put the updated info in the OP. It was updated for VRALL4, but I don't think it will be much different for VRALJB.
imnuts said:
I fixed the issue with the icon reappearing and put the updated info in the OP. It was updated for VRALL4, but I don't think it will be much different for VRALJB.
Click to expand...
Click to collapse
for I605VRAMC3 you will need to change a a few ids other wise the wrong icons and strings will display for "searching for gps" and "location set by gps"
here is the updated just like the OP just replace everything thing in there with this content
LocationController.smali
Code:
.class public Lcom/android/systemui/statusbar/policy/LocationController;
.super Landroid/content/BroadcastReceiver;
.source "LocationController.java"
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/systemui/statusbar/policy/LocationController$1;,
Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;
}
.end annotation
# static fields
.field private static final EVENT_STOP_GPS_TONE:I = 0x40
.field private static final GPS_NOTIFICATION_ID:I = 0x3d8d7
.field private static final GPS_NOTI_STATUS:Ljava/lang/String; = "gps_notification_sounds"
.field private static final TAG:Ljava/lang/String; = "StatusBar.LocationController"
.field private static final sLBSImages:[I
# instance fields
.field private LBS_ENABLED:Ljava/lang/String;
.field private LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String;
.field private VZW_PROVIDER:Ljava/lang/String;
.field private mContext:Landroid/content/Context;
.field private mFocusToneGenerator:Landroid/media/ToneGenerator;
.field private final mHandler:Landroid/os/Handler;
.field private mMyContext:Landroid/content/Context;
.field private mNotificationService:Landroid/app/INotificationManager;
.field private mService:Landroid/app/StatusBarManager;
# direct methods
.method static constructor <clinit>()V
.locals 1
.prologue
.line 79
const/4 v0, 0x2
new-array v0, v0, [I
fill-array-data v0, :array_0
sput-object v0, Lcom/android/systemui/statusbar/policy/LocationController;->sLBSImages:[I
return-void
nop
:array_0
.array-data 0x4
0xc6t 0x0t 0x2t 0x7ft
0xc7t 0x0t 0x2t 0x7ft
.end array-data
.end method
.method public constructor <init>(Landroid/content/Context;)V
.locals 4
.parameter "context"
.prologue
const/4 v3, 0x0
.line 87
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
.line 69
new-instance v2, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;
invoke-direct {v2, p0, v3}, Lcom/android/systemui/statusbar/policy/LocationController$StatusBarHandler;-><init>(Lcom/android/systemui/statusbar/policy/LocationController;Lcom/android/systemui/statusbar/policy/LocationController$1;)V
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler;
.line 78
iput-object v3, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mService:Landroid/app/StatusBarManager;
.line 83
const-string v2, "com.android.internal.location.intent.action.LBS_ENABLED_CHANGE"
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED_CHANGE_ACTION:Ljava/lang/String;
.line 84
const-string v2, "lbsEnabled"
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->LBS_ENABLED:Ljava/lang/String;
.line 85
const-string v2, "vzw_lbs"
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->VZW_PROVIDER:Ljava/lang/String;
.line 88
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
.line 89
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mMyContext:Landroid/content/Context;
.line 91
new-instance v0, Landroid/content/IntentFilter;
invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V
.line 92
.local v0, filter:Landroid/content/IntentFilter;
const-string v2, "android.location.GPS_ENABLED_CHANGE"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 93
const-string v2, "android.location.GPS_FIX_CHANGE"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 97
invoke-virtual {p1, p0, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
.line 99
const-string v2, "notification"
invoke-virtual {p1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v1
check-cast v1, Landroid/app/NotificationManager;
.line 101
.local v1, nm:Landroid/app/NotificationManager;
invoke-static {}, Landroid/app/NotificationManager;->getService()Landroid/app/INotificationManager;
move-result-object v2
iput-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager;
.line 109
return-void
.end method
.method private GenerateBeep()V
.locals 13
.prologue
const/4 v12, 0x0
const/4 v11, 0x1
.line 114
iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
.line 115
const/4 v3, 0x0
.line 116
.local v3, MIN_VOLUME_LEV:I
const/4 v1, 0x7
.line 117
.local v1, MAX_VOLUME_LEV:I
const/16 v4, 0xe
.line 118
.local v4, VOLUME_STEP:I
const/4 v2, 0x0
.line 119
.local v2, MIN_VOLUME:I
const/16 v0, 0x64
.line 120
.local v0, MAX_VOLUME:I
move v8, v0
.line 122
.local v8, mCurVol:I
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
const-string v10, "audio"
invoke-virtual {v9, v10}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v5
check-cast v5, Landroid/media/AudioManager;
.line 124
.local v5, audioManager:Landroid/media/AudioManager;
invoke-virtual {v5, v11}, Landroid/media/AudioManager;->getStreamVolume(I)I
move-result v8
.line 126
const-string v9, "StatusBar.LocationController"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "GenerateBeep: Volumei Level:"
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 128
if-lt v8, v3, :cond_2
if-gt v8, v1, :cond_2
.line 130
if-eq v8, v1, :cond_1
.line 131
mul-int/2addr v8, v4
.line 135
:goto_0
const-string v9, "StatusBar.LocationController"
new-instance v10, Ljava/lang/StringBuilder;
invoke-direct {v10}, Ljava/lang/StringBuilder;-><init>()V
const-string v11, "GenerateBeep: valid Volume:"
invoke-virtual {v10, v11}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10, v8}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v10
invoke-virtual {v10}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v10
invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 144
:goto_1
:try_start_0
new-instance v9, Landroid/media/ToneGenerator;
const/4 v10, 0x1
invoke-direct {v9, v10, v8}, Landroid/media/ToneGenerator;-><init>(II)V
iput-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
.line 151
:goto_2
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
if-eqz v9, :cond_0
.line 152
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler;
const/16 v10, 0x40
invoke-virtual {v9, v10}, Landroid/os/Handler;->obtainMessage(I)Landroid/os/Message;
move-result-object v7
.line 153
.local v7, m:Landroid/os/Message;
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
const/16 v10, 0x1c
invoke-virtual {v9, v10}, Landroid/media/ToneGenerator;->startTone(I)Z
.line 154
iget-object v9, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mHandler:Landroid/os/Handler;
const-wide/16 v10, 0x1f4
invoke-virtual {v9, v7, v10, v11}, Landroid/os/Handler;->sendMessageDelayed(Landroid/os/Message;J)Z
.line 157
.end local v7 #m:Landroid/os/Message;
:cond_0
return-void
.line 133
:cond_1
move v8, v0
goto :goto_0
.line 138
:cond_2
const-string v9, "StatusBar.LocationController"
const-string v10, "Error getting current volume: Setting volume as max volume"
invoke-static {v9, v10}, Landroid/util/Slog;->e(Ljava/lang/String;Ljava/lang/String;)I
.line 139
move v8, v0
goto :goto_1
.line 145
:catch_0
move-exception v6
.line 147
.local v6, e:Ljava/lang/Exception;
iput-object v12, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
.line 148
sget-object v9, Ljava/lang/System;->err:Ljava/io/PrintStream;
invoke-virtual {v9, v6}, Ljava/io/PrintStream;->println(Ljava/lang/Object;)V
goto :goto_2
.end method
.method static synthetic access$100(Lcom/android/systemui/statusbar/policy/LocationController;)Landroid/media/ToneGenerator;
.locals 1
.parameter "x0"
.prologue
.line 60
iget-object v0, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
return-object v0
.end method
.method static synthetic access$102(Lcom/android/systemui/statusbar/policy/LocationController;Landroid/media/ToneGenerator;)Landroid/media/ToneGenerator;
.locals 0
.parameter "x0"
.parameter "x1"
.prologue
.line 60
iput-object p1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mFocusToneGenerator:Landroid/media/ToneGenerator;
return-object p1
.end method
.method private checkLBSStatus()Z
.locals 1
.prologue
.line 300
const/4 v0, 0x0
return v0
.end method
.method private final updateLBS(Landroid/content/Intent;)V
.locals 0
.parameter "intent"
.prologue
.line 290
return-void
.end method
# virtual methods
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 15
.parameter "context"
.parameter "intent"
.prologue
.line 162
invoke-virtual/range {p2 .. p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v7
.line 163
.local v7, action:Ljava/lang/String;
const-string v1, "enabled"
const/4 v2, 0x0
move-object/from16 v0, p2
invoke-virtual {v0, v1, v2}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v8
.line 171
.local v8, enabled:Z
const/4 v13, 0x0
.line 172
.local v13, valueFromPrefs:Z
const-string v1, "StatusBar.LocationController"
const-string v2, "onReceive: [GPS ICON]"
invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 182
const-string v1, "android.location.GPS_FIX_CHANGE"
invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_0
if-eqz v8, :cond_0
.line 184
const v10, 0x10806c8
.line 185
.local v10, iconId:I
const v12, 0x7f0a0089
.line 186
.local v12, textResId:I
const/4 v14, 0x1
.line 228
.local v14, visible:Z
:goto_0
if-eqz v14, :cond_2
.line 229
:try_start_0
new-instance v9, Landroid/content/Intent;
const-string v1, "android.settings.LOCATION_SOURCE_SETTINGS"
invoke-direct {v9, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 230
.local v9, gpsIntent:Landroid/content/Intent;
const/high16 v1, 0x1000
invoke-virtual {v9, v1}, Landroid/content/Intent;->setFlags(I)Landroid/content/Intent;
.line 231
const/4 v1, 0x0
const/4 v2, 0x0
move-object/from16 v0, p1
invoke-static {v0, v1, v9, v2}, Landroid/app/PendingIntent;->getActivity(Landroid/content/Context;ILandroid/content/Intent;I)Landroid/app/PendingIntent;
move-result-object v11
.line 233
.local v11, pendingIntent:Landroid/app/PendingIntent;
new-instance v1, Landroid/app/Notification$Builder;
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-direct {v1, v2}, Landroid/app/Notification$Builder;-><init>(Landroid/content/Context;)V
invoke-virtual {v1, v10}, Landroid/app/Notification$Builder;->setSmallIcon(I)Landroid/app/Notification$Builder;
move-result-object v1
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-virtual {v2, v12}, Landroid/content/Context;->getText(I)Ljava/lang/CharSequence;
move-result-object v2
invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setContentTitle(Ljava/lang/CharSequence;)Landroid/app/Notification$Builder;
move-result-object v1
const/4 v2, 0x1
invoke-virtual {v1, v2}, Landroid/app/Notification$Builder;->setOngoing(Z)Landroid/app/Notification$Builder;
move-result-object v1
invoke-virtual {v1, v11}, Landroid/app/Notification$Builder;->setContentIntent(Landroid/app/PendingIntent;)Landroid/app/Notification$Builder;
move-result-object v1
invoke-virtual {v1}, Landroid/app/Notification$Builder;->getNotification()Landroid/app/Notification;
move-result-object v5
.line 241
.local v5, n:Landroid/app/Notification;
const/4 v1, 0x0
iput-object v1, v5, Landroid/app/Notification;->tickerView:Landroid/widget/RemoteViews;
.line 242
const/4 v1, 0x0
iput-object v1, v5, Landroid/app/Notification;->tickerText:Ljava/lang/CharSequence;
.line 244
const/4 v1, 0x1
iput v1, v5, Landroid/app/Notification;->priority:I
.line 246
const/4 v1, 0x1
new-array v6, v1, [I
.line 247
.local v6, idOut:[I
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager;
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v2
const/4 v3, 0x0
const v4, 0x3d8d7
invoke-interface/range {v1 .. v6}, Landroid/app/INotificationManager;->enqueueNotificationWithTag(Ljava/lang/String;Ljava/lang/String;ILandroid/app/Notification;[I)V
:try_end_0
.catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0
.line 261
.end local v5 #n:Landroid/app/Notification;
.end local v6 #idOut:[I
.end local v9 #gpsIntent:Landroid/content/Intent;
.end local v11 #pendingIntent:Landroid/app/PendingIntent;
:goto_1
return-void
.line 189
.end local v10 #iconId:I
.end local v12 #textResId:I
.end local v14 #visible:Z
:cond_0
const-string v1, "android.location.GPS_ENABLED_CHANGE"
invoke-virtual {v7, v1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v1
if-eqz v1, :cond_1
if-nez v8, :cond_1
.line 191
const/4 v14, 0x0
.line 192
.restart local v14 #visible:Z
const/4 v12, 0x0
.restart local v12 #textResId:I
move v10, v12
.restart local v10 #iconId:I
goto :goto_0
.line 199
.end local v10 #iconId:I
.end local v12 #textResId:I
.end local v14 #visible:Z
:cond_1
const-string v1, "StatusBar.LocationController"
const-string v2, "onReceive: [GPS ICON] GPS is on, but not receiving fixes"
invoke-static {v1, v2}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 200
const v10, 0x7f0200c7
.line 201
.restart local v10 #iconId:I
const v12, 0x7f0a0088
.line 202
.restart local v12 #textResId:I
const/4 v14, 0x1
.restart local v14 #visible:Z
goto :goto_0
.line 254
:cond_2
:try_start_1
iget-object v1, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mNotificationService:Landroid/app/INotificationManager;
iget-object v2, p0, Lcom/android/systemui/statusbar/policy/LocationController;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getPackageName()Ljava/lang/String;
move-result-object v2
const v3, 0x3d8d7
invoke-interface {v1, v2, v3}, Landroid/app/INotificationManager;->cancelNotification(Ljava/lang/String;I)V
:try_end_1
.catch Landroid/os/RemoteException; {:try_start_1 .. :try_end_1} :catch_0
goto :goto_1
.line 258
:catch_0
move-exception v1
goto :goto_1
.end method

[MOD][GUIDE][JB] Double Tap Statusbar to Sleep

Double Tap Statusbar to Sleep​
In the spirit of open source, i would like to share my HarshJelly ROM's new feature backported from CM11.
What it does : Double tap statusbar anywhere to sleep device.
Requirements :
SystemUI.apk
Apktool
Notepad++
So let's begin
Decompile SystemUI.apk
Open com\android\systemui\statusbar\phone\PhoneStatusBarView.smali
Add following code after #static fields
Code:
.field static c:Landroid/content/Context;
Add this after #instance fields
Code:
.field private mDoubleTapGesture:Landroid/view/GestureDetector;
Now search for .method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSetV and delete
Code:
[COLOR="Red"]const/4 v2, 0x0[/COLOR]
which comes in beginning of this method.
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code
Code:
sput-object p1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
new-instance v0, Landroid/view/GestureDetector;
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
invoke-direct {v0, v1, v2}, Landroid/view/GestureDetector;-><init>(Landroid/content/Context;Landroid/view/GestureDetector$OnGestureListener;)V
iput-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mDoubleTapGesture:Landroid/view/GestureDetector;
const/4 v2, 0x0
Now search for .method public onTouchEvent(Landroid/view/MotionEventZ at the starting of this method add
Code:
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mDoubleTapGesture:Landroid/view/GestureDetector;
invoke-virtual {v0, p1}, Landroid/view/GestureDetector;->onTouchEvent(Landroid/view/MotionEvent;)Z
Download attached file, extract it & put PhoneStatusBarView$1.smali to com\android\systemui\statusbar\phone
Compile back, it is done...
Click to expand...
Click to collapse
And yeah a big thanks goes to CyanogenMod Team...
I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)...
If you found any error then report here along with FULL LOG. I'll ignore posts without logs.
Updated method. Now there won't be FC (i forget to add one line)
BOOTMGR said:
Updated method. Now there won't be FC (i forget to add one line)
Click to expand...
Click to collapse
Working GR8
Thanx
Can you do one zip file , in which we just to flash this zip to have this mod?
Gesendet von meinem GT-I9070 mit Tapatalk
You are really a great developer... @BOOTMGR
Sent from my GT-I9070 using Tapatalk
Thanks, this works on my device JB 4.1.2. Keep on sharing your mods Sir :good:
BOOTMGR said:
Updated method. Now there won't be FC (i forget to add one line)
Click to expand...
Click to collapse
i try this on 4.2.2 rom. it original have the PhoneStatusBarView$1.smali can u help me...
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
.super Landroid/content/BroadcastReceiver;
.source "PhoneStatusBarView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 0
.parameter
.prologue
.line 120
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
[COLOR="Red"].method public onDoubleTap(Landroid/view/MotionEvent;)Z
.locals 3
.parameter "e"
.prologue
.line 24
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 119
.local v0, pm:Landroid/os/PowerManager;
.line 120
if-eqz v0, :cond_0
.line 121
invoke-virtual {p1}, Landroid/view/MotionEvent;->getEventTime()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->goToSleep(J)V
.line 122
:cond_0
const/4 v1, 0x1
return v1
.end method[/COLOR]
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 8
.parameter "context"
.parameter "intent"
.prologue
const/4 v7, 0x1
const/4 v3, 0x0
.line 123
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
.line 124
.local v0, action:Ljava/lang/String;
const-string v2, "com.samsung.cover.OPEN"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 125
const-string v2, "coverOpen"
invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v2
if-ne v7, v2, :cond_1
.line 126
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 127
const-string v2, "PhoneStatusBarView"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "clear cover opened : "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 128
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTicker:Landroid/view/ViewGroup;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingLeft:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$100(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingTop:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$200(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingRight:I
invoke-static {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v5
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
add-int/2addr v5, v6
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingBottom:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$400(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/ViewGroup;->setPadding(IIII)V
.line 134
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->showClockByClearCover(Z)V
.line 135
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBlackBGView:Landroid/view/View;
const/16 v3, 0x8
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
.line 137
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->marqueeStatusBar()V
.line 162
:cond_0
:goto_0
return-void
.line 139
:cond_1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mIndent1:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$500(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
mul-int/lit8 v3, v3, 0x11
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 140
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
.line 141
.local v1, mHandler:Landroid/os/Handler;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;)V
const-wide/16 v3, 0xaa
invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.end method
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code i cant fine it, can you show where shukd chuld it edit it
It looked a bit complicated at first, but IT WORKS.
You just saved my power button!
shazzl said:
i try this on 4.2.2 rom. it original have the PhoneStatusBarView$1.smali can u help me...
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
.super Landroid/content/BroadcastReceiver;
.source "PhoneStatusBarView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 0
.parameter
.prologue
.line 120
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
[COLOR="Red"].method public onDoubleTap(Landroid/view/MotionEvent;)Z
.locals 3
.parameter "e"
.prologue
.line 24
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 119
.local v0, pm:Landroid/os/PowerManager;
.line 120
if-eqz v0, :cond_0
.line 121
invoke-virtual {p1}, Landroid/view/MotionEvent;->getEventTime()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->goToSleep(J)V
.line 122
:cond_0
const/4 v1, 0x1
return v1
.end method[/COLOR]
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 8
.parameter "context"
.parameter "intent"
.prologue
const/4 v7, 0x1
const/4 v3, 0x0
.line 123
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
.line 124
.local v0, action:Ljava/lang/String;
const-string v2, "com.samsung.cover.OPEN"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 125
const-string v2, "coverOpen"
invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v2
if-ne v7, v2, :cond_1
.line 126
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 127
const-string v2, "PhoneStatusBarView"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "clear cover opened : "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 128
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTicker:Landroid/view/ViewGroup;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingLeft:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$100(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingTop:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$200(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingRight:I
invoke-static {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v5
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
add-int/2addr v5, v6
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingBottom:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$400(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/ViewGroup;->setPadding(IIII)V
.line 134
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->showClockByClearCover(Z)V
.line 135
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBlackBGView:Landroid/view/View;
const/16 v3, 0x8
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
.line 137
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->marqueeStatusBar()V
.line 162
:cond_0
:goto_0
return-void
.line 139
:cond_1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mIndent1:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$500(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
mul-int/lit8 v3, v3, 0x11
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 140
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
.line 141
.local v1, mHandler:Landroid/os/Handler;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;)V
const-wide/16 v3, 0xaa
invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.end method
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code i cant fine it, can you show where shukd chuld it edit it
Click to expand...
Click to collapse
If you already have PhoneStatusBarView$1 then don't merge changes. Just rename my file to PhoneStatusBarView$2 & replace all other occurences of PhoneStatusBarView$1 with PhoneStatusBarView$2 apperaring on this tutorial.
Hello BOOTMGR,
I try on 4.2.1 ROM, but my PhoneStatusBarView.smali doesn't have "invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-...". Can you show me how to integrate? My Rom has only PhoneStatusBarView.smali file
Code:
.class public Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.super Lcom/android/systemui/statusbar/phone/PanelBar;
.source "PhoneStatusBarView.java"
# static fields
.field private static final DEBUG:Z = false
.field private static final TAG:Ljava/lang/String; = "PhoneStatusBarView"
# instance fields
.field mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.field mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mFullWidthNotifications:Z
.field mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mScrimColor:I
.field mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.field mSettingsPanelDragzoneFrac:F
.field mSettingsPanelDragzoneMin:F
.field private mShouldFade:Z
# direct methods
.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.locals 7
.parameter "context"
.parameter "attrs"
.prologue
const/4 v3, 0x0
const/4 v6, 0x0
const/4 v2, 0x1
.line 47
invoke-direct {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PanelBar;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
.line 41
iput-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 42
iput-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 49
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getContext()Landroid/content/Context;
move-result-object v3
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v1
.line 50
.local v1, res:Landroid/content/res/Resources;
const v3, 0x7f0a0003
invoke-virtual {v1, v3}, Landroid/content/res/Resources;->getColor(I)I
move-result v3
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
.line 51
const v3, 0x7f0e003c
invoke-virtual {v1, v3}, Landroid/content/res/Resources;->getDimension(I)F
move-result v3
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneMin:F
.line 53
const v3, 0x7f0e003b
const/4 v4, 0x1
const/4 v5, 0x1
:try_start_0
invoke-virtual {v1, v3, v4, v5}, Landroid/content/res/Resources;->getFraction(III)F
move-result v3
iput v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 57
:goto_0
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
cmpg-float v3, v3, v6
if-gtz v3, :cond_0
:goto_1
iput-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
.line 58
return-void
.line 54
:catch_0
move-exception v0
.line 55
.local v0, ex:Landroid/content/res/Resources$NotFoundException;
iput v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
goto :goto_0
.line 57
.end local v0 #ex:Landroid/content/res/Resources$NotFoundException;
:cond_0
const/4 v2, 0x0
goto :goto_1
.end method
# virtual methods
.method public addPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.locals 2
.parameter "pv"
.prologue
.line 77
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->addPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.line 78
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getId()I
move-result v0
const v1, 0x7f090042
if-ne v0, v1, :cond_1
.line 79
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 83
:cond_0
:goto_0
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
if-nez v0, :cond_2
const/4 v0, 0x1
:goto_1
invoke-virtual {p1, v0}, Lcom/android/systemui/statusbar/phone/PanelView;->setRubberbandingEnabled(Z)V
.line 84
return-void
.line 80
:cond_1
invoke-virtual {p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getId()I
move-result v0
const v1, 0x7f090071
if-ne v0, v1, :cond_0
.line 81
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_0
.line 83
:cond_2
const/4 v0, 0x0
goto :goto_1
.end method
.method public hasFullWidthNotifications()Z
.locals 1
.prologue
.line 65
iget-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
return v0
.end method
.method public onAllPanelsCollapsed()V
.locals 2
.prologue
const/4 v1, 0x0
.line 156
invoke-super {p0}, Lcom/android/systemui/statusbar/phone/PanelBar;->onAllPanelsCollapsed()V
.line 158
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->makeExpandedInvisibleSoon()V
.line 159
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 160
iput-object v1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 161
return-void
.end method
.method public onAttachedToWindow()V
.locals 3
.prologue
.line 70
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PanelBar;->mPanels:Ljava/util/ArrayList;
invoke-virtual {v2}, Ljava/util/ArrayList;->iterator()Ljava/util/Iterator;
move-result-object v0
.local v0, i$:Ljava/util/Iterator;
:goto_0
invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z
move-result v2
if-eqz v2, :cond_1
invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;
move-result-object v1
check-cast v1, Lcom/android/systemui/statusbar/phone/PanelView;
.line 71
.local v1, pv:Lcom/android/systemui/statusbar/phone/PanelView;
iget-boolean v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
if-nez v2, :cond_0
const/4 v2, 0x1
:goto_1
invoke-virtual {v1, v2}, Lcom/android/systemui/statusbar/phone/PanelView;->setRubberbandingEnabled(Z)V
goto :goto_0
:cond_0
const/4 v2, 0x0
goto :goto_1
.line 73
.end local v1 #pv:Lcom/android/systemui/statusbar/phone/PanelView;
:cond_1
return-void
.end method
.method public onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 181
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->interceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-nez v0, :cond_0
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->onInterceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method public onPanelFullyOpened(Lcom/android/systemui/statusbar/phone/PanelView;)V
.locals 1
.parameter "openPanel"
.prologue
.line 165
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->onPanelFullyOpened(Lcom/android/systemui/statusbar/phone/PanelView;)V
.line 166
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
if-eq p1, v0, :cond_0
.line 167
const/16 v0, 0x20
invoke-virtual {p1, v0}, Lcom/android/systemui/statusbar/phone/PanelView;->sendAccessibilityEvent(I)V
.line 169
:cond_0
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 170
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mLastFullyOpenedPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 171
const/4 v0, 0x1
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mShouldFade:Z
.line 172
return-void
.end method
.method public onPanelPeeked()V
.locals 2
.prologue
.line 138
invoke-super {p0}, Lcom/android/systemui/statusbar/phone/PanelBar;->onPanelPeeked()V
.line 139
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const/4 v1, 0x1
invoke-virtual {v0, v1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->makeExpandedVisible(Z)V
.line 140
return-void
.end method
.method public onRequestSendAccessibilityEvent(Landroid/view/View;Landroid/view/accessibility/AccessibilityEvent;)Z
.locals 2
.parameter "child"
.parameter "event"
.prologue
.line 93
invoke-super {p0, p1, p2}, Lcom/android/systemui/statusbar/phone/PanelBar;->onRequestSendAccessibilityEvent(Landroid/view/View;Landroid/view/accessibility/AccessibilityEvent;)Z
move-result v1
if-eqz v1, :cond_0
.line 97
invoke-static {}, Landroid/view/accessibility/AccessibilityEvent;->obtain()Landroid/view/accessibility/AccessibilityEvent;
move-result-object v0
.line 98
.local v0, record:Landroid/view/accessibility/AccessibilityEvent;
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->onInitializeAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)V
.line 99
invoke-virtual {p0, v0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->dispatchPopulateAccessibilityEvent(Landroid/view/accessibility/AccessibilityEvent;)Z
.line 100
invoke-virtual {p2, v0}, Landroid/view/accessibility/AccessibilityEvent;->appendRecord(Landroid/view/accessibility/AccessibilityRecord;)V
.line 101
const/4 v1, 0x1
.line 103
.end local v0 #record:Landroid/view/accessibility/AccessibilityEvent;
:goto_0
return v1
:cond_0
const/4 v1, 0x0
goto :goto_0
.end method
.method public onTouchEvent(Landroid/view/MotionEvent;)Z
.locals 1
.parameter "event"
.prologue
.line 176
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v0, p1}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->interceptTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-nez v0, :cond_0
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->onTouchEvent(Landroid/view/MotionEvent;)Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
.method public panelExpansionChanged(Lcom/android/systemui/statusbar/phone/PanelView;F)V
.locals 17
.parameter "panel"
.parameter "frac"
.prologue
.line 186
invoke-super/range {p0 .. p2}, Lcom/android/systemui/statusbar/phone/PanelBar;->panelExpansionChanged(Lcom/android/systemui/statusbar/phone/PanelView;F)V
.line 192
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
move-object/from16 v0, p1
if-ne v0, v5, :cond_0
move-object/from16 v0, p0
iget v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
if-eqz v5, :cond_0
invoke-static {}, Landroid/app/ActivityManager;->isHighEndGfx()Z
move-result v5
if-eqz v5, :cond_0
.line 193
move-object/from16 v0, p0
iget-boolean v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mShouldFade:Z
if-eqz v5, :cond_0
.line 194
move-object/from16 v0, p0
iget v0, v0, Lcom/android/systemui/statusbar/phone/PanelBar;->mPanelExpandedFractionSum:F
move/from16 p2, v0
.line 196
const v5, 0x3f99999a
mul-float v5, v5, p2
const v6, 0x3e4ccccd
sub-float p2, v5, v6
.line 197
const/4 v5, 0x0
cmpg-float v5, p2, v5
if-gtz v5, :cond_3
.line 215
:cond_0
:goto_0
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->getStatusBarHeight()I
move-result v1
.line 216
.local v1, H:I
invoke-virtual/range {p1 .. p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getExpandedHeight()F
move-result v5
invoke-virtual/range {p1 .. p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getPaddingBottom()I
move-result v6
int-to-float v6, v6
add-float v4, v5, v6
.line 217
.local v4, ph:F
const/high16 v2, 0x3f80
.line 218
.local v2, alpha:F
mul-int/lit8 v5, v1, 0x2
int-to-float v5, v5
cmpg-float v5, v4, v5
if-gez v5, :cond_1
.line 219
int-to-float v5, v1
cmpg-float v5, v4, v5
if-gez v5, :cond_4
const/4 v2, 0x0
.line 221
:goto_1
mul-float/2addr v2, v2
.line 223
:cond_1
invoke-virtual/range {p1 .. p1}, Lcom/android/systemui/statusbar/phone/PanelView;->getAlpha()F
move-result v5
cmpl-float v5, v5, v2
if-eqz v5, :cond_2
.line 224
move-object/from16 v0, p1
invoke-virtual {v0, v2}, Lcom/android/systemui/statusbar/phone/PanelView;->setAlpha(F)V
.line 227
:cond_2
move-object/from16 v0, p0
iget-object v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
const/4 v6, 0x0
invoke-virtual {v5, v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->updateCarrierLabelVisibility(Z)V
.line 228
return-void
.line 203
.end local v1 #H:I
.end local v2 #alpha:F
.end local v4 #ph:F
:cond_3
const-wide/high16 v5, 0x3ff0
const-wide/high16 v7, 0x3fe0
const-wide/high16 v9, 0x3ff0
const-wide v11, 0x400921fa00000000L
const/high16 v13, 0x3f80
sub-float v13, v13, p2
float-to-double v13, v13
const-wide/high16 v15, 0x4000
invoke-static/range {v13 .. v16}, Ljava/lang/Math;->pow(DD)D
move-result-wide v13
mul-double/2addr v11, v13
invoke-static {v11, v12}, Ljava/lang/Math;->cos(D)D
move-result-wide v11
sub-double/2addr v9, v11
mul-double/2addr v7, v9
sub-double/2addr v5, v7
double-to-float v3, v5
.line 205
.local v3, k:F
move-object/from16 v0, p0
iget v5, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
ushr-int/lit8 v5, v5, 0x18
int-to-float v5, v5
mul-float/2addr v5, v3
float-to-int v5, v5
shl-int/lit8 v5, v5, 0x18
move-object/from16 v0, p0
iget v6, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mScrimColor:I
const v7, 0xffffff
and-int/2addr v6, v7
or-int/2addr v5, v6
goto :goto_0
.line 220
.end local v3 #k:F
.restart local v1 #H:I
.restart local v2 #alpha:F
.restart local v4 #ph:F
:cond_4
int-to-float v5, v1
sub-float v5, v4, v5
int-to-float v6, v1
div-float v2, v5, v6
goto :goto_1
.end method
.method public panelsEnabled()Z
.locals 2
.prologue
.line 88
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
iget v0, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mDisabled:I
const/high16 v1, 0x1
and-int/2addr v0, v1
if-nez v0, :cond_0
const/4 v0, 0x1
:goto_0
return v0
:cond_0
const/4 v0, 0x0
goto :goto_0
.end method
.method public selectPanelForTouch(Landroid/view/MotionEvent;)Lcom/android/systemui/statusbar/phone/PanelView;
.locals 6
.parameter "touch"
.prologue
const/4 v4, 0x0
.line 108
invoke-virtual {p1}, Landroid/view/MotionEvent;->getX()F
move-result v2
.line 110
.local v2, x:F
iget-boolean v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFullWidthNotifications:Z
if-eqz v3, :cond_2
.line 112
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
if-nez v3, :cond_0
move v3, v4
:goto_0
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
invoke-virtual {v5}, Lcom/android/systemui/statusbar/phone/PanelView;->getExpandedHeight()F
move-result v5
add-float/2addr v3, v5
cmpl-float v3, v3, v4
if-lez v3, :cond_1
const/4 v3, 0x0
.line 133
:goto_1
return-object v3
.line 112
:cond_0
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
invoke-virtual {v3}, Lcom/android/systemui/statusbar/phone/PanelView;->getExpandedHeight()F
move-result v3
goto :goto_0
:cond_1
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_1
.line 122
:cond_2
invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->getMeasuredWidth()I
move-result v3
int-to-float v1, v3
.line 123
.local v1, w:F
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneFrac:F
mul-float v0, v1, v3
.line 131
.local v0, region:F
iget v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneMin:F
cmpg-float v3, v0, v3
if-gez v3, :cond_3
iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanelDragzoneMin:F
.line 133
:cond_3
sub-float v3, v1, v2
cmpg-float v3, v3, v0
if-gez v3, :cond_4
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mSettingsPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_1
:cond_4
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mNotificationPanel:Lcom/android/systemui/statusbar/phone/PanelView;
goto :goto_1
.end method
.method public setBar(Lcom/android/systemui/statusbar/phone/PhoneStatusBar;)V
.locals 0
.parameter "bar"
.prologue
.line 61
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
.line 62
return-void
.end method
.method public startOpeningPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.locals 1
.parameter "panel"
.prologue
.line 144
invoke-super {p0, p1}, Lcom/android/systemui/statusbar/phone/PanelBar;->startOpeningPanel(Lcom/android/systemui/statusbar/phone/PanelView;)V
.line 147
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
if-eqz v0, :cond_0
iget-object v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
invoke-virtual {v0}, Lcom/android/systemui/statusbar/phone/PanelView;->isFullyExpanded()Z
move-result v0
if-eqz v0, :cond_1
:cond_0
const/4 v0, 0x1
:goto_0
iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mShouldFade:Z
.line 151
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mFadingPanel:Lcom/android/systemui/statusbar/phone/PanelView;
.line 152
return-void
.line 147
:cond_1
const/4 v0, 0x0
goto :goto_0
.end method
BOOTMGR said:
Double Tap Statusbar to Sleep​
In the spirit of open source, i would like to share my HarshJelly ROM's new feature backported from CM11.
What it does : Double tap statusbar anywhere to sleep device.
Requirements :
SystemUI.apk
Apktool
Notepad++
And yeah a big thanks goes to CyanogenMod Team...
I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)...
If you found any error then report here along with FULL LOG. I'll ignore posts without logs.
Click to expand...
Click to collapse
will this work on stock roms?
yeshwanthvshenoy said:
will this work on stock roms?
Click to expand...
Click to collapse
If you read whole post you will find this at the end:
"I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)..."
shut_down said:
If you read whole post you will find this at the end:
"I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)..."
Click to expand...
Click to collapse
had this doubt thatz why asked coz some stock roms dont support this feature
BOOTMGR said:
Double Tap Statusbar to Sleep​
In the spirit of open source, i would like to share my HarshJelly ROM's new feature backported from CM11.
What it does : Double tap statusbar anywhere to sleep device.
Requirements :
SystemUI.apk
Apktool
Notepad++
And yeah a big thanks goes to CyanogenMod Team...
I tested this on Touchwiz JB 4.1.2 but it should work on any device with 4.1.2 or any device > 4.1 with some modification (if necessary)...
If you found any error then report here along with FULL LOG. I'll ignore posts without logs.
Click to expand...
Click to collapse
Sir can you help me im using a dual sim phone and it has no phonestatusbarview.smali and I already have phonestatusbarview1.smali
Hope you can help me in this mod thank you sir
shazzl said:
i try this on 4.2.2 rom. it original have the PhoneStatusBarView$1.smali can u help me...
Code:
.class Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;
.super Landroid/content/BroadcastReceiver;
.source "PhoneStatusBarView.java"
# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
value = Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
.end annotation
.annotation system Ldalvik/annotation/InnerClass;
accessFlags = 0x0
name = null
.end annotation
# instance fields
.field final synthetic this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
# direct methods
.method constructor <init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)V
.locals 0
.parameter
.prologue
.line 120
iput-object p1, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-direct {p0}, Landroid/content/BroadcastReceiver;-><init>()V
return-void
.end method
# virtual methods
[COLOR="Red"].method public onDoubleTap(Landroid/view/MotionEvent;)Z
.locals 3
.parameter "e"
.prologue
.line 24
sget-object v1, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->c:Landroid/content/Context;
const-string v2, "power"
invoke-virtual {v1, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v0
check-cast v0, Landroid/os/PowerManager;
.line 119
.local v0, pm:Landroid/os/PowerManager;
.line 120
if-eqz v0, :cond_0
.line 121
invoke-virtual {p1}, Landroid/view/MotionEvent;->getEventTime()J
move-result-wide v1
invoke-virtual {v0, v1, v2}, Landroid/os/PowerManager;->goToSleep(J)V
.line 122
:cond_0
const/4 v1, 0x1
return v1
.end method[/COLOR]
.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V
.locals 8
.parameter "context"
.parameter "intent"
.prologue
const/4 v7, 0x1
const/4 v3, 0x0
.line 123
invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String;
move-result-object v0
.line 124
.local v0, action:Ljava/lang/String;
const-string v2, "com.samsung.cover.OPEN"
invoke-virtual {v0, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_0
.line 125
const-string v2, "coverOpen"
invoke-virtual {p2, v2, v3}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z
move-result v2
if-ne v7, v2, :cond_1
.line 126
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 127
const-string v2, "PhoneStatusBarView"
new-instance v3, Ljava/lang/StringBuilder;
invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V
const-string v4, "clear cover opened : "
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;
move-result-object v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;
move-result-object v3
invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;
move-result-object v3
invoke-static {v2, v3}, Landroid/util/Slog;->d(Ljava/lang/String;Ljava/lang/String;)I
.line 128
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTicker:Landroid/view/ViewGroup;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingLeft:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$100(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
add-int/2addr v3, v4
iget-object v4, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingTop:I
invoke-static {v4}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$200(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v4
iget-object v5, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingRight:I
invoke-static {v5}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$300(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v5
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$000(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
add-int/2addr v5, v6
iget-object v6, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mTickerPaddingBottom:I
invoke-static {v6}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$400(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v6
invoke-virtual {v2, v3, v4, v5, v6}, Landroid/view/ViewGroup;->setPadding(IIII)V
.line 134
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBar:Lcom/android/systemui/statusbar/phone/PhoneStatusBar;
invoke-virtual {v2, v7}, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->showClockByClearCover(Z)V
.line 135
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v2, v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mBlackBGView:Landroid/view/View;
const/16 v3, 0x8
invoke-virtual {v2, v3}, Landroid/view/View;->setVisibility(I)V
.line 137
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
invoke-virtual {v2}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->marqueeStatusBar()V
.line 162
:cond_0
:goto_0
return-void
.line 139
:cond_1
iget-object v2, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
iget-object v3, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;->this$0:Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;
#getter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mIndent1:I
invoke-static {v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$500(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;)I
move-result v3
mul-int/lit8 v3, v3, 0x11
#setter for: Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->mClearCoverMargin:I
invoke-static {v2, v3}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;->access$002(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView;I)I
.line 140
new-instance v1, Landroid/os/Handler;
invoke-direct {v1}, Landroid/os/Handler;-><init>()V
.line 141
.local v1, mHandler:Landroid/os/Handler;
new-instance v2, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;
invoke-direct {v2, p0}, Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1$1;-><init>(Lcom/android/systemui/statusbar/phone/PhoneStatusBarView$1;)V
const-wide/16 v3, 0xaa
invoke-virtual {v1, v2, v3, v4}, Landroid/os/Handler;->postDelayed(Ljava/lang/Runnable;J)Z
goto :goto_0
.end method
Now after invoke-direct {p0, p1, p2}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSetV add following code i cant fine it, can you show where shukd chuld it edit it
Click to expand...
Click to collapse
Hi sir i have the same problm w/ u Im also using 4.2 and i have already phone status view 1 up to 34 .smali what did you do can you help me? hmmm
Does this still work, or is there any updated guide?
shwise said:
Does this still work, or is there any updated guide?
Click to expand...
Click to collapse
It works (at least on my i9070 running Samsung's 4.1.2 firmware).
I added this to my ROM (about a week ago) and it works just like it should.
There is an alternate guide for this too, but I never tried it..
In case you're interested, here's a link to it.
is there any easiest way to install double tap status bar to sleep for JB 4.1.2
masud0869 said:
is there any easiest way to install double tap status bar to sleep for JB 4.1.2
Click to expand...
Click to collapse
Yes. There is.
You can install this Xposed Module: http://forum.xda-developers.com/xposed/modules/mod-doubletaptosleep-v1-0-t2667177
The only requirement is that you need to have Xposed Installer installed on your phone.
Sami Kabir said:
Yes. There is.
You can install this Xposed Module: http://forum.xda-developers.com/xposed/modules/mod-doubletaptosleep-v1-0-t2667177
The only requirement is that you need to have Xposed Installer installed on your phone.
Click to expand...
Click to collapse
Is there required root first?

[MOD][Guide]How to change Dialer background in real time

tested and work perfectly in JB 4.1.2 xwms3 based
Before modding do a Nandroid Backup
To achieve you need:
SecSettings.apk
SecContacts.apk
tool for decompile and compile like apktool 1.5.2;
tool for text edit like notepad++:
Start with SecSettings.apk:
Decompile SecSettings.apk ,go in res/xml ,open with text editor display_settings.xml and add the red line
Code:
<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" />[COLOR="Red"]
<PreferenceCategory android:title="@string/dialer_options">
<ListPreference android:persistent="false" android:entries="@array/dialer_bg_entries" android:title="@string/dialer_bg_chooser" android:key="dialer_chooser" android:summary="@string/dialer_bg_chooser_summary" android:entryValues="@array/dialer_bg_values" />
</PreferenceCategory>[/COLOR]
Go in res/value open with text editor arrays.xml and add at the end the red line
Code:
[COLOR="Red"]
<string-array name="dialer_bg_entries">
<item>Stock Dialer</item>
<item>Anastasia Dialer</item>
<item>BlackGlass Dialer</item>
<item>Chrome Dialer</item>
<item>Orange Dialer</item>
<item>Rainbow Dialer</item>
<item>White Dialer</item>
</string-array>
<string-array name="dialer_bg_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
</string-array>[/COLOR]
</resources>
Go in res/value open with text editor strings.xml and add at the end this line
Code:
[COLOR="Red"]
<string name="dialer_options">Options Dialer</string>
<string name="dialer_bg_chooser">Choose Dialer</string>
<string name="dialer_bg_chooser_summary">Select the background of dialer</string>[/COLOR]
</resources>
Go in smali\com\android\settings\DisplaySettings.smali file and add the following lines in RED
Code:
.field private final mCurConfig:Landroid/content/res/Configuration;
[COLOR="Red"]
.field private mDialerChooser:Landroid/preference/ListPreference;
[/COLOR]
.field private mDirect:I
.field mDirectUri:Landroid/net/Uri;
In the same file find .method public onCreate and add the following lines in RED
Code:
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
.line 424
iget-object v12, p0, Lcom/android/settings/DisplaySettings;->mFontSizePref:Landroid/preference/ListPreference;
invoke-virtual {v12, p0}, Landroid/preference/ListPreference;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[COLOR="Red"]
const-string v12, "dialer_chooser"
invoke-virtual {p0, v12}, Lcom/android/settings/DisplaySettings;->findPreference(Ljava/lang/CharSequence;)Landroid/preference/Preference;
move-result-object v12
check-cast v12, Landroid/preference/ListPreference;
iput-object v12, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
const-string v12, "dialer_chooser"
const/4 v13, 0x0
invoke-static {v8, v12, v13}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v12
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
invoke-static {v12}, Ljava/lang/String;->valueOf(I)Ljava/lang/String;
move-result-object v12
invoke-virtual {v13, v12}, Landroid/preference/ListPreference;->setValue(Ljava/lang/String;)V
iget-object v13, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
invoke-virtual {v13, p0}, Landroid/preference/SwitchPreferenceScreen;->setOnPreferenceChangeListener(Landroid/preference/Preference$OnPreferenceChangeListener;)V
[/COLOR]
In the same file find .method public onPreferenceChange then find this code and add the red lines ,in blue line some explanation
Code:
const-string v2, "contextualpage_settings"
invoke-virtual {v2, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v0
if-eqz v0, :[COLOR="Red"]cond_dialer_chooser[/COLOR] [COLOR="Blue"]change this from cond_2 to cond_dialer_chooser[/COLOR]
.line 1089
check-cast p2, Ljava/lang/Boolean;
invoke-virtual {p2}, Ljava/lang/Boolean;->booleanValue()Z
move-result v0
if-eqz v0, :cond_e
in the same method find this code and add the red lines
Code:
.line 1100
const-string v1, "DisplaySettings"
const-string v3, "CONTEXTUALPAGE_SWITCH_CHANGED changed = false"
invoke-static {v1, v3}, Landroid/util/Log;->secD(Ljava/lang/String;Ljava/lang/String;)I
goto :goto_7
:cond_11
move-wide v0, v4
goto/16 :goto_3
[COLOR="Red"]
:cond_dialer_chooser
iget-object v1, p0, Lcom/android/settings/DisplaySettings;->mDialerChooser:Landroid/preference/ListPreference;
if-ne p1, v1, :cond_2
check-cast p2, Ljava/lang/String;
invoke-static {p2}, Ljava/lang/Integer;->valueOf(Ljava/lang/String;)Ljava/lang/Integer;
move-result-object v1
invoke-virtual {v1}, Ljava/lang/Integer;->intValue()I
move-result v0
invoke-virtual {p0}, Lcom/android/settings/DisplaySettings;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
invoke-static {v1, v2, v0}, Landroid/provider/Settings$System;->putInt(Landroid/content/ContentResolver;Ljava/lang/String;I)Z
goto/16 :goto_4[/COLOR]
.end method
Save all changes and compile SecSettings
SecContacts.apk part
Decompile SecContacts.apk ,download this zip View attachment Dialer_Background.zip and put all the drawable pngs in SecContacts\res\drawable-sw320dp-hdpi
Compile SecContacts and decompile the new SecContacts.apk to obtain the new ids of the new pngs
So open SystemUI\res\value\public and leave it open to check the new ids
Go in SecContacts/smali/com/sec/android/app/dialertab/dialpad and open DialpadFragment.smali file and add the following red lines
Code:
.field private mAddContactsDialog:Landroid/app/AlertDialog;[COLOR="Red"]
.field private mAdditionalButtonBackground:I
.field private mAdditionalButtonBackgroundLand:I[/COLOR]
.field private mAudioManager:Landroid/media/AudioManager;
.field private mButtonAnimLeft:Landroid/view/animation/TranslateAnimation;
.
.
.
.field private mDialButtonSim1:Landroid/view/View;
.field private mDialButtonSim2:Landroid/view/View;[COLOR="Red"]
.field private mDialerBackground:I
.field private mDialerLandBackground:I[/COLOR]
.field private mDialpad:Landroid/view/View;
.field private mDialpadAdditionalButtons:Landroid/view/View;
then add at the end these 4 new methods,
in blue lines some explanation
Code:
.method set_dialer_background(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f02039e [COLOR="Blue"]check this id with dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f02064b [COLOR="Blue"]check this id with anastasia_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f02064c [COLOR="Blue"]check this id with blackglass_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f02064d [COLOR="Blue"]check this id with chrome_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f02064a [COLOR="Blue"]check this id with orange_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f02064e [COLOR="Blue"]check this id with rainbow_dialer_bg_p_01 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f02064f [COLOR="Blue"]check this id with white_dialer_bg_p_01 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerBackground:I
return-void
.end method
.method set_dialerland_background(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f020395 [COLOR="Blue"]check this id with dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f020656 [COLOR="Blue"]check this id with anastasia_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f020658 [COLOR="Blue"]check this id with blackglass_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f02065a [COLOR="Blue"]check this id with chrome_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f02065c [COLOR="Blue"]check this id with orange_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f02065e [COLOR="Blue"]check this id with rainbow_dialer_bg_h_01 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f020660 [COLOR="Blue"]check this id with white_dialer_bg_h_01 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerLandBackground:I
return-void
.end method
.method set_additional_button_background(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f02039f [COLOR="Blue"]check this id with dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f020650 [COLOR="Blue"]check this id with anastasia_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f020651 [COLOR="Blue"]check this id with blackglass_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f020652 [COLOR="Blue"]check this id with chrome_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f020653 [COLOR="Blue"]check this id with orange_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f020654 [COLOR="Blue"]check this id with rainbow_dialer_bg_p_02 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f020655 [COLOR="Blue"]check this id with white_dialer_bg_p_02 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackground:I
return-void
.end method
.method set_additional_button_background_land(Landroid/content/Context;)V
.locals 5
invoke-virtual {p1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
const-string v2, "dialer_chooser"
const v3, 0x0
invoke-static {v1, v2, v3}, Landroid/provider/Settings$System;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v1
const v2, 0x1
if-eq v1, v2, :cond_0
const v2, 0x2
if-eq v1, v2, :cond_1
const v2, 0x3
if-eq v1, v2, :cond_2
const v2, 0x4
if-eq v1, v2, :cond_3
const v2, 0x5
if-eq v1, v2, :cond_4
const v2, 0x6
if-eq v1, v2, :cond_5
const v2, 0x7f020396 [COLOR="Blue"]check this id with dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_0
const v2, 0x7f020657 [COLOR="Blue"]check this id with anastasia_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_1
const v2, 0x7f020659 [COLOR="Blue"]check this id with blackglass_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_2
const v2, 0x7f02065b [COLOR="Blue"]check this id with chrome_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_3
const v2, 0x7f02065d [COLOR="Blue"]check this id with orange_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_4
const v2, 0x7f02065f [COLOR="Blue"]check this id with rainbow_dialer_bg_h_02 in your res/value[/COLOR]
goto :goto_0
:cond_5
const v2, 0x7f020661 [COLOR="Blue"]check this id with white_dialer_bg_h_02 in your res/value[/COLOR]
:goto_0
iput v2, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackgroundLand:I
return-void
.end method
In the same file find .method private showDialpadChooser(Z)V and change at the beginning .locals 5 to .locals 6
In the same method find this code
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialer_background(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerBackground:I
invoke-virtual {v1, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
then find this code
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v1, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v1, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialerland_background(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerLandBackground:I
invoke-virtual {v1, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
then find this code,pay attention this is twice
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackground:I
invoke-virtual {v0, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
then find this code,pay attention this is twice
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v3}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v5
invoke-virtual {p0, v5}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background_land(Landroid/content/Context;)V
iget v5, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackgroundLand:I
invoke-virtual {v0, v5}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
Then find the .method public resetAllLayout()V and change at the beginning .locals 12 to .locals 13
then in the same method find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpad:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialer_background(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerBackground:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_dialerland_background(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialerLandBackground:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtons:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackground:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
find this code, pay attention it appears more than once and you need to add for each
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V
and add the followind red lines
Code:
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {v0, v7}, Landroid/view/View;->setVisibility(I)V[COLOR="Red"]
iget-object v0, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mDialpadAdditionalButtonsLand:Landroid/view/View;
invoke-virtual {p0}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->getActivity()Landroid/app/Activity;
move-result-object v12
invoke-virtual {p0, v12}, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->set_additional_button_background_land(Landroid/content/Context;)V
iget v12, p0, Lcom/sec/android/app/dialertab/dialpad/DialpadFragment;->mAdditionalButtonBackgroundLand:I
invoke-virtual {v0, v12}, Landroid/view/View;->setBackgroundResource(I)V[/COLOR]
Save all changes and compile SecContacts then put SecSettings.apk and SecContacts.apk in your device
reserved .
Nice work mate. Keep it up, hope some more guides to come soon from your hard coded mind. ✌?
Sent from my GT-I9100 using Tapatalk 2
remuntada78 said:
tested and work perfectly in JB 4.1.2 xwms3 based
Save all changes and compile SecContacts then put SecSettings.apk and SecContacts.apk in your device
Click to expand...
Click to collapse
Do we have to sign the apk files?
avirk said:
Nice work mate. Keep it up, hope some more guides to come soon from your hard coded mind. ✌?
Sent from my GT-I9100 using Tapatalk 2
Click to expand...
Click to collapse
Thanks mate
homeboy1956 said:
Do we have to sign the apk files?
Click to expand...
Click to collapse
No need to sign
remuntada78 said:
Thanks mate
No need to sign
Click to expand...
Click to collapse
Thanks mate, will try asap.
Good job man
Sent from my SM-G900F using Tapatalk
Goldie said:
Good job man
Sent from my SM-G900F using Tapatalk
Click to expand...
Click to collapse
Thanks to you and for your guide
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
Thanks mate
No need to sign
Click to expand...
Click to collapse
Nice doing, great work.
I love it. Is there a way to change the color of the number?
homeboy1956 said:
Nice doing, great work.
I love it. Is there a way to change the color of the number?
Click to expand...
Click to collapse
The easiest way to change the color of the number is to edit the pngs in drawables-sw320dp-hdpi, they are call_dial_btn_xx and call_dial_btn_xx_h, you can use a tool for image editor like paint.net or gimp
Inviato dal mio GT-I9100 utilizzando Tapatalk
Well done. I will add to my ROM with your permission.
phenomarc said:
Well done. I will add to my ROM with your permission.
Click to expand...
Click to collapse
Thanks mate , you are free to add
inviato dal mio galaxy s2 con tapatalk
remuntada78 said:
Thanks mate , you are free to add
inviato dal mio galaxy s2 con tapatalk
Click to expand...
Click to collapse
Did you succes with List View Animations in XWMS3?
phenomarc said:
Did you succes with List View Animations in XWMS3?
Click to expand...
Click to collapse
Yes it's all working fine now
inviato dal mio galaxy s2 con tapatalk
I've find your Guide mate! [emoji1]
This is a Great work! You are a Genius! Really! Congratulation 4 Your big work and Your great capacity. [emoji1]
Of course... will try the Mod. [emoji5]
glowerita said:
I've find your Guide mate! [emoji1]
This is a Great work! You are a Genius! Really! Congratulation 4 Your big work and Your great capacity. [emoji1]
Of course... will try the Mod. [emoji5]
Click to expand...
Click to collapse
Thanks mate , trying to learning
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
Thanks mate , trying to learning
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
I think You have to teach.
The learning time is finish 4 you. [emoji1]
glowerita said:
I think You have to teach.
The learning time is finish 4 you. [emoji1]
Click to expand...
Click to collapse
[emoji23] [emoji23] [emoji23]
Inviato dal mio GT-I9100 utilizzando Tapatalk
remuntada78 said:
[emoji23] [emoji23] [emoji23]
Inviato dal mio GT-I9100 utilizzando Tapatalk
Click to expand...
Click to collapse
Don't cry! Be happy to be a Great and Good Android's Teacher. [emoji1]
Congratulation again mate! [emoji1]
About Kk
Great job man
But the question is I can't do in a ROM KK 4.4.2 . Sorry my bad English.
Avanti Italia y la Roma. Salute di Argentina.

[GUIDE] [TUT] GUIDE Omni Switch

GUIDE Omni Switch
Work and Tested - CM 12.1 & LP Based
​
1. Decompile settings.apk
At the files:
Settings\res\xml\Display_Settings.xml
Looking for:
Add this line
<PreferenceScreen android:title="@string/omniswitch_settings_title" android:fragment="com.android.settings.ahmednhk.RecentsPanel.OmniSwitch" />
Click to expand...
Click to collapse
ADD ALL THIS LINES.
Settings\res\values\strings.xml
<string name="omniswitch_settings_title">OmniSwitch</string>
<string name="recents_use_omniswitch_title">Use for recents</string>
<string name="recents_use_omniswitch_summary">Use OmniSwitch instead of default recents view</string>
<string name="omniswitch_start_settings_title">Settings</string>
<string name="omniswitch_start_settings_summary">Open OmniSwitch settings</string>
<string name="omniswitch_first_time_title">Information</string>
<string name="omniswitch_first_time_message">Make sure you have enabled OmniSwitch. You can do this by using "Settings" below</string>
Click to expand...
Click to collapse
*compile and decompile again to assign the ID to a file*
PHP:
Settings\smali\com\android\settings\ahmednhk\RecentsPanel\OmniSwitch.smali
<public type="string" name="omniswitch_first_time_title"
LINE 73
<public type="string" name="omniswitch_first_time_message"
LINE 87
0x104000a
LINE 97
<public type="xml" name="ahmednhk_recents_omniswitch"
LINE 126>
*Compile Settings.apk DONE*
2. Decompile framework.jar in files u will download i make misatke and forget this part
framework.jar.out\smali\android\provider\Settings$System.smali
PHP:
Looking for:
.field public static final RECENTS_SHOW_SEARCH_BAR:Ljava/lang/String; = "recents_show_search_bar"
following inserted :
.field public static final RECENTS_USE_OMNISWITCH:Ljava/lang/String; = "recents_use_omniswitch"
** Now proceed to complex of instructions **
3. Decompile SystemUI.apk
SystemUI\smali\com\android\systemui\statusbar\BaseStatusBar.smali
PHP:
Looking for:
.method static sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
following inserted :
.method private isOmniSwitchEnabled()Z
.locals 6
.prologue
const/4 v1, 0x1
const/4 v2, 0x0
.line 1196
iget-object v3, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v3
const-string v4, "recents_use_omniswitch"
const/4 v5, -0x2
invoke-static {v3, v4, v2, v5}, Landroid/provider/Settings$System;->getIntForUser(Landroid/content/ContentResolver;Ljava/lang/String;II)I
move-result v0
.line 1199
.local v0, "settingsValue":I
if-ne v0, v1, :cond_0
:goto_0
return v1
:cond_0
move v1, v2
goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
.method protected cancelPreloadingRecents()V
Changing it completely with:
.method protected cancelPreloadingRecents()V
.locals 1
.prologue
.line 1246
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1247
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1248
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->cancelPreloadingRecents()V
.line 1251
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected hideRecents(ZZ)V
Changing it completely with:
.method protected hideRecents(ZZ)V
.locals 3
.param p1, "triggeredFromAltTab" # Z
.param p2, "triggeredFromHomeKey" # Z
.prologue
.line 1215
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v1
if-eqz v1, :cond_1
.line 1216
new-instance v0, Landroid/content/Intent;
const-string v1, "org.omnirom.omniswitch.ACTION_HIDE_OVERLAY"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 1217
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
.line 1223
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void
.line 1219
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v1, :cond_0
.line 1220
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v1, p1, p2}, Lcom/android/systemui/RecentsComponent;->hideRecents(ZZ)V
goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
.method protected preloadRecents()V
Changing it completely with:
.method protected preloadRecents()V
.locals 1
.prologue
.line 1238
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1239
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1240
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->preloadRecents()V
.line 1243
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected showRecents(Z)V
Changing it completely with:
.method protected showRecents(Z)V
.locals 3
.param p1, "triggeredFromAltTab" # Z
.prologue
.line 1203
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v1
if-eqz v1, :cond_1
.line 1204
new-instance v0, Landroid/content/Intent;
const-string v1, "org.omnirom.omniswitch.ACTION_SHOW_OVERLAY"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 1205
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
.line 1212
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void
.line 1207
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v1, :cond_0
.line 1208
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
const-string v2, "recentapps"
invoke-static {v1, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
.line 1209
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->getStatusBarView()Landroid/view/View;
move-result-object v2
invoke-interface {v1, p1, v2}, Lcom/android/systemui/RecentsComponent;->showRecents(ZLandroid/view/View;)V
goto :goto_0
.end method
----------------------------------------------------------------
Looking for:
.method protected showRecentsNextAffiliatedTask()V
Changing it completely with:
.method protected showRecentsNextAffiliatedTask()V
.locals 1
.prologue
.line 1254
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1255
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1256
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->showNextAffiliatedTask()V
.line 1259
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected showRecentsPreviousAffiliatedTask()V
Changing it completely with:
.method protected showRecentsPreviousAffiliatedTask()V
.locals 1
.prologue
.line 1262
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v0
if-nez v0, :cond_0
.line 1263
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v0, :cond_0
.line 1264
iget-object v0, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
invoke-interface {v0}, Lcom/android/systemui/RecentsComponent;->showPrevAffiliatedTask()V
.line 1267
:cond_0
return-void
.end method
----------------------------------------------------------------
Looking for:
.method protected toggleRecents()V
Changing it completely with:
.method protected toggleRecents()V
.locals 5
.prologue
.line 1226
invoke-direct {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->isOmniSwitchEnabled()Z
move-result v1
if-eqz v1, :cond_1
.line 1227
new-instance v0, Landroid/content/Intent;
const-string v1, "org.omnirom.omniswitch.ACTION_TOGGLE_OVERLAY"
invoke-direct {v0, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V
.line 1228
.local v0, "showIntent":Landroid/content/Intent;
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
sget-object v2, Landroid/os/UserHandle;->CURRENT:Landroid/os/UserHandle;
invoke-virtual {v1, v0, v2}, Landroid/content/Context;->sendBroadcastAsUser(Landroid/content/Intent;Landroid/os/UserHandle;)V
.line 1235
.end local v0 # "showIntent":Landroid/content/Intent;
:cond_0
:goto_0
return-void
.line 1230
:cond_1
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
if-eqz v1, :cond_0
.line 1231
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mContext:Landroid/content/Context;
const-string v2, "recentapps"
invoke-static {v1, v2}, Lcom/android/systemui/statusbar/BaseStatusBar;->sendCloseSystemWindows(Landroid/content/Context;Ljava/lang/String;)V
.line 1232
iget-object v1, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mRecents:Lcom/android/systemui/RecentsComponent;
iget-object v2, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mDisplay:Landroid/view/Display;
iget v3, p0, Lcom/android/systemui/statusbar/BaseStatusBar;->mLayoutDirection:I
invoke-virtual {p0}, Lcom/android/systemui/statusbar/BaseStatusBar;->getStatusBarView()Landroid/view/View;
move-result-object v4
invoke-interface {v1, v2, v3, v4}, Lcom/android/systemui/RecentsComponent;->toggleRecents(Landroid/view/Display;ILandroid/view/View;)V
goto :goto_0
.end method
*Compile framework.jar DONE*
DON'T FORGET TO DRAG THE APK FILE GIVING U IN FOLDER SYSTEM.
DON'T FORGET TO TRANSFER ALL FILES (framework.jar).
Files and Compare Press Me​

Categories

Resources