[Android General] tdunham:
__________________________________________________

[Guide How-to] Remove Last Spoke & Last Message from the InCall Screen with Toggle Android L

This will allow you to remove last spoke and last message from the incall screen.

LegacyInCallUI.apk smali edits:

Remove last spoke item from call card

- static change, no toggle

New or changed lines are in BLUE

\smali\com\android\incallui\callerinfocard\item\LastCallLogItem.smali

.method protected setItem(Landroid/content/Context;Landroid/net/Uri;Landroid/database/Cursor;Ljava/lang/Object;)V
[COLOR="blue"].locals 0
goto :goto_td[/COLOR]
.
.
.
[COLOR="blue"]:goto_td[/COLOR]
return-void
.end method

Remove last message item from call card

- static change, no toggle

New or changed lines are in BLUE

\smali\com\android\incallui\callerinfocard\item\MessageItem.smali

.method protected setItem(Landroid/content/Context;Landroid/net/Uri;Landroid/database/Cursor;Ljava/lang/Object;)V
[COLOR="blue"].locals 0
goto :goto_td[/COLOR]
.
.
.
[COLOR="blue"]:goto_td[/COLOR]
return-void
.end method

Adding a toggle for the same two items

Remove last spoke item from call card

New or changed lines are in BLUE

\smali\com\android\incallui\callerinfocard\item\LastCallLogItem.smali

.method protected setItem(Landroid/content/Context;Landroid/net/Uri;Landroid/database/Cursor;Ljava/lang/Object;)V
[COLOR="Blue"].locals 12

iget-object v9, p0, Lcom/android/incallui/callerinfocard/item/CallerInfoCardItem;->mContext:Landroid/content/Context;

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

move-result-object v9

const-string v10, "last_spoke"

const/4 v11, 0x0

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

move-result v9

if-nez v9, :cond_td[/COLOR]
.
.
.
[COLOR="Blue"]:cond_td
[/COLOR] return-void
.end method

CustomSettings line for the toggle:

<SwitchPreference android:title="Remove Last spoke" android:key="last_spoke" android:summaryOn="Option will not be shown" android:summaryOff="Option is shown" />

Remove last message item from call card

New or changed lines are in BLUE

\smali\com\android\incallui\callerinfocard\item\MessageItem.smali

.method protected setItem(Landroid/content/Context;Landroid/net/Uri;Landroid/database/Cursor;Ljava/lang/Object;)V
[COLOR="Blue"].locals 9

iget-object v6, p0, Lcom/android/incallui/callerinfocard/item/CallerInfoCardItem;->mContext:Landroid/content/Context;

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

move-result-object v6

const-string v7, "last_message"

const/4 v8, 0x0

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

move-result v6

if-nez v6, :cond_td[/COLOR]
.
.
.
[COLOR="Blue"]:cond_td
[/COLOR] return-void
.end method

CustomSettings line for the toggle:

<SwitchPreference android:title="Remove Last message" android:key="last_message" android:summaryOn="Option will not be shown" android:summaryOff="Option is shown" />

__________________________________________________

[Guide How-to] Remove Sfind/Quickconnect panel properly Android L

This will allow you to remove the sfind/quickconnect panel from the pulldown.

The guide for the toggle for this is located here --> Toggle

SystemUI.apk smali edits:

\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali

Find the section below. Change the condition number in BLUE as the edit.

Make certain your changed cond number matches the one further on down in the method in GREEN.

(there is no edit for the Green condition, just make sure your condition number matches that one)

.method private showHideQConnectLayout()V
.
.
.
iget-boolean v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mShowSFinderQConnectView:Z

if-eqz v8, :cond_5

iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQconnectSfinderView:Lcom/android/systemui/statusbar/QconnectSfinderView;

if-nez v8, [COLOR="Blue"]:cond_5[/COLOR]

iget-object v8, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mQsQConnectView:Landroid/view/View;

if-eqz v8, :cond_5
.
.
.
[COLOR="Green"]:cond_5
:goto_2
return-void
[/COLOR]

Credits [MENTION=4714483]daxgirl[/MENTION] for this one too :D

__________________________________________________

[Guide How-to] Colorize main dialpad letters & digits Android L

This will allow you to provide custom colors to the main dialers dialpad digits & letters.

SecContacts_Phone_FLAGSHIP_USA.apk smali edits

Your filename may be a little different.

Find the public ID in GREEN to find this area of the smali, new code is in BLUE and the v9 value must match surrounding code in the first edit and the v8 must match in the second edit.

To find the second edit, search for setAccessibilityDelegate, I have highlighted it in GREEN in the edit.

\smali\com\android\dialer\dialpad\a.smali:

.method protected c(Landroid/view/View;)V
.
.
.
const v3, 0x[COLOR="Green"]7f0c01e0[/COLOR] ## type="id" name="dialpad_key_number"

invoke-virtual {v2, v3}, Lcom/android/dialer/dialpad/DialpadKeyButton;->findViewById(I)Landroid/view/View;

move-result-object v3

check-cast v3, Landroid/widget/TextView;

move-object v9, v3

:cond_4
if-eqz v9, :cond_5

invoke-virtual {v9, v15}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

[COLOR="Blue"]move-object/from16 v0, p0

invoke-virtual {v0, v9}, Lcom/android/dialer/dialpad/a;->setDialerDigit(Landroid/widget/TextView;)V
[/COLOR]
const/4 v3, 0x0

invoke-virtual {v9, v3}, Landroid/widget/TextView;->setHoverPopupType(I)V
.
.
.
invoke-virtual {v2, v3}, Lcom/android/dialer/dialpad/DialpadKeyButton;->[COLOR="green"]setAccessibilityDelegate[/COLOR](Landroid/view/View$AccessibilityDelegate;)V

:cond_6
if-eqz v8, :cond_7

aget v3, v10, v7

invoke-virtual {v13, v3}, Landroid/content/res/Resources;->getString(I)Ljava/lang/String;

move-result-object v3

invoke-virtual {v8, v3}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

[COLOR="Blue"]move-object/from16 v0, p0

invoke-virtual {v0, v8}, Lcom/android/dialer/dialpad/a;->setDialerLetter(Landroid/widget/TextView;)V
[/COLOR]
sget-object v3, Lcom/android/contacts/ContactsApplication;->m:Landroid/graphics/Typeface;

invoke-virtual {v8, v3}, Landroid/widget/TextView;->setTypeface(Landroid/graphics/Typeface;)V

Add new methods to the end of this smali:

.method setDialerDigit(Landroid/widget/TextView;)V
.locals 3

invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

move-result-object v0

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

move-result-object v0

const-string v1, "main_digit_color"

const v2, -0x1000000

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

move-result v0

invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V

return-void
.end method

.method setDialerLetter(Landroid/widget/TextView;)V
.locals 3

invoke-virtual {p1}, Landroid/view/View;->getContext()Landroid/content/Context;

move-result-object v0

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

move-result-object v0

const-string v1, "main_letter_color"

const v2, -0x1000000

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

move-result v0

invoke-virtual {p1, v0}, Landroid/widget/TextView;->setTextColor(I)V

return-void
.end method

CustomSettings lines:

<com.ficeto.colorpicker.ColorPickerPreference android:title="Dialpad Digits" android:key="main_digit_color" android:summary="Choose dialpad digit color" />
<com.ficeto.colorpicker.ColorPickerPreference android:title="Dialpad Letters" android:key="main_letter_color" android:summary="Choose dialpad letter color" />

_________________________________________________

[Guide How-to] Multiple InCall backgrounds Android L

This will allow you to have multiple customized InCall backgrounds.

While I really made this for the FullScreen Caller mod, it works fine with stock too. There are all sorts of variations for this but at least this is a starting point.

LegacyInCallUI.apk smali edits:

Search for this public value and make a note of it, we will need it later.

In mine the value is 7f020417, just as shown in the stock code below.

type="drawable" name="picture_unknown"

\smali\com\android\incallui\CallCardPresenter.smali

Add the new code in BLUE.

Once you add this, go back and make sure the v6 value for the construct matches, all of the v6's in the new code. If it does not, change ALL of the v6's in the NEW code to your value.

.method public onStateChange(Lcom/android/incallui/InCallPresenter$InCallState;Lcom/android/incallui/CallList;)V
.
.
.
const v6, 0x7f020417 ## type="drawable" name="picture_unknown"

[COLOR="Blue"]invoke-virtual/range {p0 .. p0}, Lcom/android/incallui/CallCardPresenter;->getContext()Landroid/content/Context;

move-result-object v1

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

move-result-object v1

const-string v2, "incall_background"

const/4 v3, 0x0

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

move-result v1

const v2, 0x1

if-eq v1, v2, :cond_td

const v2, 0x2

if-eq v1, v2, :cond_td1

const v2, 0x3

if-eq v1, v2, :cond_td2

const v2, 0x4

if-eq v1, v2, :cond_td3

const v2, 0x5

if-eq v1, v2, :cond_td4

const v2, 0x6

if-eq v1, v2, :cond_td5

const v2, 0x7

if-eq v1, v2, :cond_td6

const v2, 0x8

if-eq v1, v2, :cond_td7

const v2, 0x9

if-eq v1, v2, :cond_td8

const v6, 0x7f020417 ## type="drawable" name="picture_unknown"

goto :goto_td

:cond_td
const v6, 0x7f0205de ## type="drawable" name="call_bg_2"

goto :goto_td

:cond_td1
const v6, 0x7f0205df ## type="drawable" name="call_bg_3"

goto :goto_td

:cond_td2
const v6, 0x7f0205e0 ## type="drawable" name="call_bg_4"

goto :goto_td

:cond_td3
const v6, 0x7f0205e1 ## type="drawable" name="call_bg_5"

goto :goto_td

:cond_td4
const v6, 0x7f0205e2 ## type="drawable" name="call_bg_6"

goto :goto_td

:cond_td5
const v6, 0x7f0205e3 ## type="drawable" name="call_bg_7"

goto :goto_td

:cond_td6
const v6, 0x7f0205e4 ## type="drawable" name="call_bg_8"

goto :goto_td

:cond_td7
const v6, 0x7f0205e5 ## type="drawable" name="call_bg_9"

goto :goto_td

:cond_td8
const v6, 0x7f0205dd ## type="drawable" name="call_bg_10"

:goto_td[/COLOR]

\smali\com\android\incallui\ContactInfoCache.smali

Same thing here, search for YOUR public value in the following method, it only occurs once in the method.

Add the new code in BLUE.

Once you add this, go back and make sure the v5 value for the construct matches, all of the v5's in the new code. If it does not, change ALL of the v5's in the NEW code to your value.

.method private getDefaultPhotoDrawable(Landroid/content/Context;)Landroid/graphics/drawable/Drawable;
.locals 8

const v5, 0x7f020417 ## type="drawable" name="picture_unknown"

[COLOR="blue"]iget-object v1, p0, Lcom/android/incallui/ContactInfoCache;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "incall_background"

const/4 v3, 0x0

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

move-result v1

const v2, 0x1

if-eq v1, v2, :cond_td

const v2, 0x2

if-eq v1, v2, :cond_td1

const v2, 0x3

if-eq v1, v2, :cond_td2

const v2, 0x4

if-eq v1, v2, :cond_td3

const v2, 0x5

if-eq v1, v2, :cond_td4

const v2, 0x6

if-eq v1, v2, :cond_td5

const v2, 0x7

if-eq v1, v2, :cond_td6

const v2, 0x8

if-eq v1, v2, :cond_td7

const v2, 0x9

if-eq v1, v2, :cond_td8

const v5, 0x7f020417 ## type="drawable" name="picture_unknown"

goto :goto_td

:cond_td
const v5, 0x7f0205de ## type="drawable" name="call_bg_2"

goto :goto_td

:cond_td1
const v5, 0x7f0205df ## type="drawable" name="call_bg_3"

goto :goto_td

:cond_td2
const v5, 0x7f0205e0 ## type="drawable" name="call_bg_4"

goto :goto_td

:cond_td3
const v5, 0x7f0205e1 ## type="drawable" name="call_bg_5"

goto :goto_td

:cond_td4
const v5, 0x7f0205e2 ## type="drawable" name="call_bg_6"

goto :goto_td

:cond_td5
const v5, 0x7f0205e3 ## type="drawable" name="call_bg_7"

goto :goto_td

:cond_td6
const v5, 0x7f0205e4 ## type="drawable" name="call_bg_8"

goto :goto_td

:cond_td7
const v5, 0x7f0205e5 ## type="drawable" name="call_bg_9"

goto :goto_td

:cond_td8
const v5, 0x7f0205dd ## type="drawable" name="call_bg_10"

:goto_td
[/COLOR]

From the bottom of this post, download the attached file Multiple_incall_background.default_pic.zip and place the picture_unknown.png into the res/drawable-sw360dp-xxhdpi folder.

This is going to be replacing the stock (if your apk hasn't already had all of the .pkm files converted) picture_unknown.pkm file.

Now go into that folder and find picture_unknown.pkm and delete it so we can use the new .png instead.

We now need to create 9 new backgrounds. Wallpapers work just fine. You can worry about what you will use in the final product later and if they don't display very well, you can deal with that later as well. We are going to make all of these .jpg files. Do NOT use .pngs, if you do it's best just to rename them to .jpg as apktool wont check jpg files; it will just store them.

call_bg_2.jpg

call_bg_3.jpg

call_bg_4.jpg

call_bg_5.jpg

call_bg_6.jpg

call_bg_7.jpg

call_bg_8.jpg

call_bg_9.jpg

call_bg_10.jpg

Place the 9 new files also into the res/drawable-sw360dp-xxhdpi folder.

Important Step:

As you can see in the two new sections above, we have a lot of new public values to deal with. To find these, recompile your newly modified LegacyInCallUI.apk, decompile and open the new res/values/public.xml and search for all the new drawables, beginning with call_bg_2 and go through and match up all these public values in the original code.

Recompile your final apk and let's move on to the customsettings toggle.

Customsettings:

res/values/arrays.xml

Add new lines, before resources. You can rename the items later when you know what the pics will be:

[COLOR="Blue"]<string-array name="incall_background_entries">
<item>Stock</item>
<item>Custom 1</item>
<item>Custom 2</item>
<item>Custom 3</item>
<item>Custom 4</item>
<item>Custom 5</item>
<item>Custom 6</item>
<item>Custom 7</item>
<item>Custom 8</item>
<item>Custom 9</item>
</string-array>
<string-array name="incall_background_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
<item>6</item>
<item>7</item>
<item>8</item>
<item>9</item>
</string-array>
[/COLOR]</resources>

The new line for res/xml/preferences.xml

<ListPreference android:entries="@array/incall_background_entries" android:title="InCall Backgrounds" android:key="incall_background" android:entryValues="@array/incall_background_values"/>

_________________________________________________

[Guide How-to] Lockscreen Carrier Text Android L

This will allow you to modify the lockscreen carrier text and text color.

SystemUI.apk smali edits:

\smali\com\android\keyguard\CarrierText.smali

Add new code in BLUE

# instance fields
.field private mCallback:Lcom/android/keyguard/KeyguardUpdateMonitorCallback;

[COLOR="blue"].field private mCarrierColor:I

[/COLOR].field private mLockPatternUtils:Lcom/android/internal/widget/LockPatternUtils;

Add new code in BLUE.

Note the .locals was increased by 3.

Also, make sure the values in ORANGE match in your code.

.method protected updateCarrierText(Lcom/android/internal/telephony/IccCardConstants$State;Ljava/lang/CharSequence;Ljava/lang/CharSequence;)V
[COLOR="blue"].locals 6

iget-object v1, p0, Lcom/android/keyguard/CarrierText;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "custom_carrier"

const v3, 0x0

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

move-result v4

if-eqz v4, :cond_td

const-string v5, "custom_carrier_text"

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

move-result-object [COLOR="darkorange"]v0
[/COLOR]
goto :goto_td

:cond_td[/COLOR]
.
.
.
invoke-virtual {v0, v1}, Landroid/content/res/Resources;->getText(I)Ljava/lang/CharSequence;

move-result-object v0

[COLOR="Blue"]:goto_td[/COLOR]
invoke-virtual {p0, [COLOR="DarkOrange"]v0[/COLOR]}, Lcom/android/keyguard/CarrierText;->setText(Ljava/lang/CharSequence;)V

[COLOR="blue"]invoke-virtual {p0}, Lcom/android/keyguard/CarrierText;->updateCarrierTextColor()V

iget v1, p0, Lcom/android/keyguard/CarrierText;->mCarrierColor:I

invoke-virtual {p0, v1}, Landroid/widget/TextView;->setTextColor(I)V
[/COLOR]
return-void

:cond_1
invoke-virtual {p0, p1, p2, p3}, Lcom/android/keyguard/CarrierText;->getCarrierTextForSimState(Lcom/android/internal/telephony/IccCardConstants$State;Ljava/lang/CharSequence;Ljava/lang/CharSequence;)Ljava/lang/CharSequence;

move-result-object v0

goto :goto_0
.end method

Add new method:

.method updateCarrierTextColor()V
.locals 4

iget-object v1, p0, Lcom/android/keyguard/CarrierText;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "carrier_color"

const v3, -0x1

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

move-result v1

iput v1, p0, Lcom/android/keyguard/CarrierText;->mCarrierColor:I

return-void
.end method

CustomSettings lines:

<PreferenceScreen android:title="Carrier Text" android:summary="Text options and settings">
<SwitchPreference android:title="Use Custom Carrier Text" android:key="custom_carrier" android:summaryOn="Enabled" android:summaryOff="Disabled" />
<EditTextPreference android:title="Carrier Custom Text" android:key="custom_carrier_text" android:summary="Leave BLANK to remove" android:dependency="custom_carrier" android:dialogTitle="Set Custom Text" />
<com.ficeto.colorpicker.ColorPickerPreference android:title="Carrier Text" android:key="carrier_color" android:summary="Choose carrier color" />
<Preference android:title="Restart SystemUI" android:key="tool#restartsystemui" android:summary="Press for instant changes" />
</PreferenceScreen>

Credits [MENTION=1167171]rompnit[/MENTION] for this mod

__________________________________________________

[Guide How-to] Add a toggle for StatusBar Ticker Android L

This will allow you to add a toggle to enable/disable the statusbar ticker.

SystemUI.apk smali edits:

\smali\com\android\systemui\statusbar\phone\PhoneStatusBar.smali

This is for a standard toggle, it requires a UI restart.

Search for public value that matches the text highlighted in RED, there is only one occurrence. Add the new code in BLUE, making sure the v3 value matches the surrounding code.

const v3, 0x7f090025 ## [COLOR="red"]type="bool" name="enable_ticker"[/COLOR]

move-object/from16 v0, v32

invoke-virtual {v0, v3}, Landroid/content/res/Resources;->getBoolean(I)Z

move-result v3

[COLOR="Blue"]move-object/from16 v0, p0

iget-object v1, v0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

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

move-result-object v1

const-string v2, "ticker_toggle"

const/4 v3, 0x1

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

move-result v1

if-eqz v1, :cond_td

const/4 v3, 0x0

:cond_td[/COLOR]

move-object/from16 v0, p0

iput-boolean v3, v0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerEnabled:Z

Use this instead if you want are using a PhoneStatusBar$SettingsObserver to invoke this new method on changes.

Add new method to bottom of smali.

.method setTickerToggle()V
.locals 3

const/4 v0, 0x1

iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerEnabled:Z

iget-object v0, p0, Lcom/android/systemui/SystemUI;->mContext:Landroid/content/Context;

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

move-result-object v0

const-string v1, "ticker_toggle"

const/4 v2, 0x0

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

move-result v0

if-eqz v0, :cond_td

const/4 v0, 0x0

iput-boolean v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar;->mTickerEnabled:Z

:cond_td

return-void
.end method

CustomSettings lines.

Leave out the UI restart if using the observer method.

<SwitchPreference android:title="Statusbar Ticker" android:key="ticker_toggle" android:summaryOn="Ticker is hidden" android:summaryOff="Ticker is shown" />
<Preference android:title="Restart SystemUI" android:key="tool#restartsystemui" android:summary="Tap to set ticker toggle" />