[Q] DEV REQUEST: In-Call Screen Rotation

samuri28

Member
Feb 14, 2011
34
26
0
Hello There
I have P6200 with PAC-Man milestone1 (JB 4.2.1) , and I'm tired to make InCall in Portrait mode post here (http://forum.xda-developers.com/showthread.php?t=2544636)
I follow this post and I can't find SecPhone.apk
is there any help ???
Since the P6200 is a tablet I am not sure if the phone program is implemented in the same way as touchwiz on a phone. But you can check the /system/app/phone.apk file and see if that has something similar in it.
 
  • Like
Reactions: akha666

samuri28

Member
Feb 14, 2011
34
26
0
can you help me
I attached my "InCallScreen.smali, CallCard.smali" from Phone.apk
I need to disable rotate InCall Srceen
Take a look at the method "onConfigurationChanged" from lines 7953 - 8101
This is the only method in the two files you posted that have the key word "orientation" line 8026
The word setOrientation is in another method "createWildPromptView" lines 853 - 978 but I do not think it is relevant for what you are trying to do (I could be wrong)


Code:
    sget-boolean v3, Lcom/android/phone/InCallScreen;->DBG:Z

    if-eqz v3, :cond_1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "  - isKeyboardOpen = "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/android/phone/InCallScreen;->log(Ljava/lang/String;)V

    .line 4741
    :cond_1
    iget v0, p1, Landroid/content/res/Configuration;->orientation:I

    const/4 v3, 0x2

    if-ne v0, v3, :cond_5
What I basically did for the Note2 was force the in call app to assume I was connected to a docking station and there for pay attention to my phone orientation even though I was not attached to a docking station. This code already existed I just deleted two "if" statements to perform the opposite action of the if statements.

If the rotation code and layout exists in your platform that you can probably do the same thing by tweaking the code, recompiling, then testing. If the rotation code and layout don't exist then you may want to see if you can talk to a developer of your platform to see if they can build something...

My best guess taking a look at the code snip it is that if you either delete out or change the if statement from if equals zero to if not equals zero (if-eqz to if-nez) at line 8002. you MIGHT have some luck, this is a pure guess though and I don't actually know what will happen if you make those changes. Just as a comparison while there were 2 hits for the word orientation in your smali, the note 2 has 38 hits for the word orientation in its smali.
Code:
    if-eqz v3, :cond_1
 

akha666

Member
Nov 25, 2013
34
2
0
Take a look at the method "onConfigurationChanged" from lines 7953 - 8101
This is the only method in the two files you posted that have the key word "orientation" line 8026
The word setOrientation is in another method "createWildPromptView" lines 853 - 978 but I do not think it is relevant for what you are trying to do (I could be wrong)


Code:
    sget-boolean v3, Lcom/android/phone/InCallScreen;->DBG:Z

    if-eqz v3, :cond_1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "  - isKeyboardOpen = "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/android/phone/InCallScreen;->log(Ljava/lang/String;)V

    .line 4741
    :cond_1
    iget v0, p1, Landroid/content/res/Configuration;->orientation:I

    const/4 v3, 0x2

    if-ne v0, v3, :cond_5
What I basically did for the Note2 was force the in call app to assume I was connected to a docking station and there for pay attention to my phone orientation even though I was not attached to a docking station. This code already existed I just deleted two "if" statements to perform the opposite action of the if statements.

If the rotation code and layout exists in your platform that you can probably do the same thing by tweaking the code, recompiling, then testing. If the rotation code and layout don't exist then you may want to see if you can talk to a developer of your platform to see if they can build something...

My best guess taking a look at the code snip it is that if you either delete out or change the if statement from if equals zero to if not equals zero (if-eqz to if-nez) at line 8002. you MIGHT have some luck, this is a pure guess though and I don't actually know what will happen if you make those changes. Just as a comparison while there were 2 hits for the word orientation in your smali, the note 2 has 38 hits for the word orientation in its smali.
Code:
    if-eqz v3, :cond_1
thank you samuri28
I have no luck I did what you said and recompile the apk and add "AndroidManifest,META_INF and Classes.dex" from original apk and replace in system/app permissions "rw-r--r--" and then wipe dalvik cache from recovery mode
still the tab rotating when Incoming call or dialling
 

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
TW 4.4.2

I am coming back to this thread. I recently updated my N7105 to 4.4.2, and I am trying to do this mod.

This mod was working well with N7105 when it had 4.1.2. So, I tried to do the same sort of change in smalis, but for the moment none works.

As I have no basic knowledge about smalis, I am stuck!!

It would be nice, if some developer could shed light on this modification for KitKat.

Thank you.

PS: After a lot of testing, finally this mod seems to be working for me. So, for those who are interested, I am attaching the smalis which show the lines I deleted as well as the screen shots of my N7105. The lines I deleted are preceded by (-) in the attached smalis.
I don't understand smali codes. So,this may not be the right way to do this, but at least my incall screens are in landscape.
 

Attachments

Last edited:
  • Like
Reactions: millo1978

millo1978

Senior Member
Mar 28, 2008
625
436
0
Milano / Horb am Neckar
...
PS: After a lot of testing, finally this mod seems to be working for me. So, for those who are interested, I am attaching the smalis which show the lines I deleted as well as the screen shots of my N7105. The lines I deleted are preceded by (-) in the attached smalis.
I don't understand smali codes. So,this may not be the right way to do this, but at least my incall screens are in landscape.
It works perfect!

Thanks a lot :)

http://www.androidiani.com/forum/mo...0t-touchwiz-rom-millo1978-46.html#post6972901

edit: @3to4
with rotation toggle disabled the screen always rotate...do you have same issue?
 
Last edited:

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
  • Like
Reactions: millo1978

millo1978

Senior Member
Mar 28, 2008
625
436
0
Milano / Horb am Neckar
@3to4

Maybe we have the solution!!!

smali/com/android/phone/InCallScreen.smali
Original method without conditional "if" deleted!

Code:
.method private isScreenTypeSensor(Landroid/content/res/Configuration;)Z
    .locals 2
    .parameter "config"

    .prologue
    const/4 v0, 0x1

    .line 12719
    const-string v1, "tablet_device"

    invoke-static {v1}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z

    move-result v1

    if-nez v1, :cond_2

    sget-boolean v1, Lcom/android/phone/PhoneGlobals;->mIsDockConnected:Z

    if-nez v1, :cond_1

    const-string v1, "hardkeyboardhidden_no"

    invoke-static {v1}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_0

    iget v1, p1, Landroid/content/res/Configuration;->hardKeyboardHidden:I

    if-eq v1, v0, :cond_1

    :cond_0
    const-string v1, "support_incomingcall_multi_window"

    invoke-static {v1}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z

    move-result v1

    if-eqz v1, :cond_2

    invoke-virtual {p0}, Lcom/android/phone/InCallScreen;->isMultiWindowMode()Z

    move-result v1

    if-eqz v1, :cond_2

    :cond_1
    :goto_0
    return v0

    :cond_2
    [COLOR="Red"]const/4 v0, 0x0[/COLOR]

    goto :goto_0
.end method
Change RED LINE to const/4 v0, 0x1

Code:
.method private updateScreenType(Landroid/content/res/Configuration;)V
    .locals 5
    .parameter

    .prologue
    [COLOR="red"]const/4 v1, 0x4[/COLOR]

    const/4 v3, 0x0

    const/4 v2, 0x1

[...]
Change RED LINE to const/4 v1, 0x2


smali/com/android/phone/CallCard.smali
Code:
.method private updateCallInfoLayout(Lcom/android/internal/telephony/PhoneConstants$State;)V
    .locals 8
    .parameter

    .prologue
    const/16 v7, 0xb

    const/16 v6, 0x9

    const/4 v5, -0x1

    const/4 v2, 0x0

    const/4 v1, 0x1

    .line 1655
    sget-object v0, Lcom/android/internal/telephony/PhoneConstants$State;->RINGING:Lcom/android/internal/telephony/PhoneConstants$State;

    if-ne p1, v0, :cond_1

    move v0, v1

    .line 1656
    :goto_0
    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string v4, "updateCallInfoLayout()...  ringing = "

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3, v0}, Ljava/lang/StringBuilder;->append(Z)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    invoke-direct {p0, v0}, Lcom/android/phone/CallCard;->log(Ljava/lang/String;)V

    .line 1657
    invoke-static {}, Lcom/android/phone/PhoneUtilsCommon;->isMirrorLinkModeOn()Z

    move-result v0

    if-eqz v0, :cond_2

    .line 1658
    const-string v0, "Do not update Call Info Layout because mirrorlink is on"

    invoke-direct {p0, v0}, Lcom/android/phone/CallCard;->log(Ljava/lang/String;)V

    .line 1753
    :cond_0
    :goto_1
    return-void

    :cond_1
    move v0, v2

    .line 1655
    goto :goto_0

    .line 1670
    :cond_2
    invoke-virtual {p0}, Landroid/view/View;->getResources()Landroid/content/res/Resources;

    move-result-object v0

    invoke-virtual {v0}, Landroid/content/res/Resources;->getConfiguration()Landroid/content/res/Configuration;

    move-result-object v3

    .line 1675
    if-eqz v3, :cond_f

    .line 1676
    sget-boolean v0, Lcom/android/phone/PhoneGlobals;->mIsDockConnected:Z

    if-eqz v0, :cond_3

    const-string v0, "phone_kk_tablet_gui"

    invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_4

    :cond_3
    const-string v0, "hardkeyboardhidden_no"

    invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z

    move-result v0

[COLOR="red"]    if-eqz v0, :cond_e[/COLOR]

    iget v0, v3, Landroid/content/res/Configuration;->hardKeyboardHidden:I

[COLOR="Red"]    if-ne v0, v1, :cond_e[/COLOR]

    .line 1678
    :cond_4
    iget v0, v3, Landroid/content/res/Configuration;->orientation:I

[...]
Delete RED LINES

All seem working good! :)

With Auto Rotation Toggle

Tested on my i9300 4.4.4 ported rom (from back-to-n00t by arter97).

What do you think about?
 
Last edited:
  • Like
Reactions: 3to4

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
After many days I can confirm that this solution is working very good... as expected

Inviato dal mio GT-I9300 utilizzando Tapatalk
Sorry for my late reaction. I was not following this thread, and thank you for your post.

I tried, but my InCallScreen.smali is a little different from yours, especially in the second part. Actually my InCallScreen.smali goes like below.

Code:
.method private updateScreenType(Landroid/content/res/Configuration;)V
    .locals 4

    .prologue
    const/4 v1, 0x1

    .line 12010
    .line 12012
    const-string v0, "tablet_device"

    invoke-static {v0}, Lcom/android/phone/PhoneFeature;->hasFeature(Ljava/lang/String;)Z

    move-result v0

    if-eqz v0, :cond_0
So, I changed const/4 v1, 0x1 to const/4 v1, 0x2, but as expected it did not work, and SecPhone.apk does FC.

Can you suggest what I can try?
 

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
Isn't there , somewhere in this method, 0x4?

0x4 is sensor rotation

0x2 is user rotation.

Inviato dal mio GT-I9300 utilizzando Tapatalk
Thank you so much for your advice!!

I replaced 0x4 with 0x2, and voila!! It seems to be working for me, too!!!
 

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
Isn't there , somewhere in this method, 0x4?

0x4 is sensor rotation

0x2 is user rotation.

Inviato dal mio GT-I9300 utilizzando Tapatalk

@millo1978,
Thank you your help last time. I am coming back to you, because I bought a Galaxy Note 3, and I am trying to this mod. I have tried a lot, but I have not been successful. Could you please give me some advice?

I am attaching my smalis, in which I marked the lines I deleted or changed. For IncallScreen.smali, I followed you advice above, and changed 0x0 to 0x1 and 0x4 to 0x4. For CallCard.smali, my smali is so different. So, I just deleted by analogy.

With these smalis, my incall screen rotates as in the picture, but the buttons are too big. I think CallCard.smali is the cause. Could you please help me??
 

Attachments

millo1978

Senior Member
Mar 28, 2008
625
436
0
Milano / Horb am Neckar
@millo1978,
Thank you your help last time. I am coming back to you, because I bought a Galaxy Note 3, and I am trying to this mod. I have tried a lot, but I have not been successful. Could you please give me some advice?

I am attaching my smalis, in which I marked the lines I deleted or changed. For IncallScreen.smali, I followed you advice above, and changed 0x0 to 0x1 and 0x4 to 0x4. For CallCard.smali, my smali is so different. So, I just deleted by analogy.

With these smalis, my incall screen rotates as in the picture, but the buttons are too big. I think CallCard.smali is the cause. Could you please help me??
The same happends if I take S5 Dialer for my S3...
I have big Buttons...

I think the problem is in layout.

Check if there is a correct /res/layout-land ...
 
  • Like
Reactions: 3to4

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
The same happends if I take S5 Dialer for my S3...
I have big Buttons...

I think the problem is in layout.

Check if there is a correct /res/layout-land ...
Dear millo1978,
Thank you very much for your advice. Although I don't know much about xml neither, by trial and error, I finally succeeded!! The smalis (InCallScreen.smali and CallCard.smali) are as I modified earlier. In fact, by playing around I discovered that when I activated one hand operation for keypad, the buttons were small!! So, I made a copy of "endcall_buttons_view_onehand.xml" in res\layout-sw360dp-land-xxhdpi and renamed it to "incall_button_view.xml", replacing the original. Then, the buttons were small, but, to my surprise, they were on the left side of the screen. So, I modified the paddingLeft to bring the buttons to the correct position.
By the way I noticed that when I activated one hand operation, in end call screen, the position of "view contact" was wrong. So, I adjusted its position by modifying paddingTop and marginLeft in "endcall_buttons_view_onehand". Maybe this is not the best way, but my screen stays horizontal during calls.
 
Last edited:
  • Like
Reactions: millo1978

3to4

Senior Member
Aug 13, 2009
366
33
58
Lyon
Landscape InCall Screen for Lollipop?

The same happends if I take S5 Dialer for my S3...
I have big Buttons...

I think the problem is in layout.

Check if there is a correct /res/layout-land ...
Hello, you helped me solve the solution for 4.4.2. and I saw your post in another thread.
https://forum.xda-developers.com/showthread.php?p=63023672&highlight=rotation#post63023672

Now, I am trying to upgrade my Galaxy Note 3 to Lollipop and I don't know what to start.
Could you or could someone give me some guidance? This feature is very important for me, as I use my Phone as GPS in landscape.

In my phone there is no SecPhone, but I found Telecom.apk, TeleService.apk and LegacyInCallUI.apk. I suppose LegacyInCallUI.apk is the apk to work on. Is this correct?

I have no customsettings.apk, but only SecSettings.apk. Can I edit SecSettings.apk?

But, first of all, is this mod possible for Lollipop?

Thank you in advance.

PS: I have been doing some testing, and when I modify LegacyInCallUI.apk, the incall screen crashes. So, I am almost sure LegacyInCallUI.apk is the apk to mod. By the way, I don't need to have a toggle. If someone can help me, I will really appreciate.

PS2: Although I don't understand smali coding, I have tried a lot of times, and I finally have a landscape in-call screen as per attached. But, the buttons are too big!! I am now trying to solve this problem, but I have not yet found the solution. I have tried changing, in layout_land, end_call_button_fragment, end_call_button_qvga_fragment, and end_call_eazy_fragment, in_call_button_voice_fragment, etc,. but these changes have no effect on my buttons. Maybe, there is something in the smali, which is preventing this... As I don't know much about smalis, I stuck!! Is threre someone more knowledgeable than me interested in this mod to hel me? I am attaching original and modded smali to have the incall screen in landscape. Thank you.

PS3: I finally found out that "layout-sw360dp-xxhdpi/"in_call_button_voice_fragment" controls both portrait and landscape layouts. As one and the same file controls both portrait and landscape, it seems very difficult to arrange layouts.

PS4:
I finally succeeded more or less to have a landscape incall screen.
One and the same "in_call_button_voice_fragment" in "layout-sw360dp-xxhdpi-v13" was controlling portrait and landscape, and that was the reason I could not change the layout in landscape without affecting the layout in landscape.
So, I created a folder "drawable-sw360dp-land-xxhdpi-v13" and placed the file "in_call_button_voice_fragment" there. Then, this file controls the layout in landscape without affecting the layout in portrait. So, I tried to arrange what I can, and almost everything is looking corretly in landscape.
Landscape incall screen is an essential feature for me. So, it is a little surprising that there doesn't seem to be much interest.
Anyway, I almost succeeded just by trial and error, without much programming knowledge. It will be great if someone more knowledgeable can make it better.
 

Attachments

Last edited: