Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

UG802 force screen rotation to vertical

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    UG802 force screen rotation to vertical

    Hi,
    Does anybody knows how can i configure UG802 for rotating screen to vertical resolution permanently?
    I would like to use a TV like a picture in 720(H)x1280(V) resolution.
    Thanks.

    #2
    Yes I know how to do this. It rquires editing .smali files in services.jar. Are you capable of doing that? If so I can tell you what to change.

    Bob
    "Pzebacz im, bo nie wiedzą, co czynią"
    "Прости им, они не ведают, что творят"
    "Perdona loro perché non sanno quello che fanno"
    "Vergib ihnen, denn sie wissen nicht, was sie tun"
    "Vergeef hen want ze weten niet wat ze doen"
    "Pardonne-leur car ils ne savent pas ce qu'ils font"
    "Perdónalos porque no saben que lo que hacen"
    "Oprosti im, jer ne znaju što čine"
    "Forgive them as they know not what they do"





    Comment


      #3
      Hi Bob,

      Please tell me what i must change at smali. I'll try to do it.
      Thanks.

      Originally posted by Finless View Post
      Yes I know how to do this. It rquires editing .smali files in services.jar. Are you capable of doing that? If so I can tell you what to change.

      Bob

      Comment


        #4
        If possible, could I also get instructions on how to do this. I have a ug802 V2 (don't know if that matters) and I would like to for the device to boot into portrait mode and remain in portrait mode. (For my intended purposes, I would not need landscape at all) I know some fundamentals but I don't know smali but I'm willing to try and test things to get it to work. Please and thank you.

        Comment


          #5
          Originally posted by justice View Post
          If possible, could I also get instructions on how to do this.
          I managed to get it working successfully myself by piecing together a few guides, some common sense and probably a little luck. Here's a link to my services.jar file: services.zip Just unzip, copy the services.jar into /system/framework (replacing the one that's there) and make sure you set both the permissions and owner to match the original services.jar.

          This doesn't do the rotation itself, it just enables the screen to be rotated. You'll have to use an app to handle the actual rotation, and I found Ultimate Screen Rotation to be the best one.

          Now, this is for Bob's 1.7 rom for the UG802/MK802-III. If that's what you're using, this should work. If you're applying it to another rom/version, all bets are off. It might work, or it might not.

          And as always, be prepared to re-flash if anything goes wrong. In the process of getting this to work, I messed up (I didn't rebuild the jar correctly the first time) and ended up in a boot loop. Had to short those two pads to get it back into flash mode. But all has been working perfectly for the past month or so. I'm using the stick on a secondary monitor I keep in portrait mode, so being able to enable this rotation was critical.

          Hope it works for 'ya.

          Comment


            #6
            Cool. glad you got it. I bet the ug802 did it the same way as the MK808?

            In the WindowManagerService.smali

            Way down in this file under the method
            .method public updateRotationUncheckedLocked(Z)Z

            I changed this code:
            .line 5810
            :cond_3
            const-string v0, "ro.sf.hwrotation"

            const/4 v2, 0x0

            invoke-static {v0, v2}, Landroid/os/SystemProperties;->getInt(Ljava/lang/String;I)I

            move-result v1

            .line 5812


            To this code:
            .line 5810
            :cond_3
            iget v0, p0, Lcom/android/server/wm/WindowManagerService;->mRotation:I

            if-ne v0, v1, :cond_5

            iget-boolean v0, p0, Lcom/android/server/wm/WindowManagerService;->mAltOrientation:Z

            if-ne v0, v8, :cond_5

            .line 5812



            Was the ug802 about the same here?

            Also Apex launcher has a full set of rotation controls. You can force boot a orientation and lock it so APPs will not rotate the screen. Once you make this code change, APPs can rotate the screen which is not always desirable.

            Bob
            "Pzebacz im, bo nie wiedzą, co czynią"
            "Прости им, они не ведают, что творят"
            "Perdona loro perché non sanno quello che fanno"
            "Vergib ihnen, denn sie wissen nicht, was sie tun"
            "Vergeef hen want ze weten niet wat ze doen"
            "Pardonne-leur car ils ne savent pas ce qu'ils font"
            "Perdónalos porque no saben que lo que hacen"
            "Oprosti im, jer ne znaju što čine"
            "Forgive them as they know not what they do"





            Comment


              #7
              Originally posted by Finless View Post
              Cool. glad you got it. I bet the ug802 did it the same way as the MK808?
              Overall, it was very similar, but some of the condition and line numbers were different. I just made sure to use the original numbers in place of the ones in the guide (which I believe was yours). I wasn't expecting it to, but it all worked.

              Originally posted by Finless View Post
              Also Apex launcher has a full set of rotation controls. You can force boot a orientation and lock it so APPs will not rotate the screen. Once you make this code change, APPs can rotate the screen which is not always desirable.
              Cool, I didn't know that, I'll have to give it a try. Yea, occasionally an app will rotate the screen back to landscape, but the rotation app I'm using kicks it back to portrait after a second or two. Maybe that won't even happen with Apex.

              Comment


                #8
                Originally posted by The Onceler View Post
                Overall, it was very similar, but some of the condition and line numbers were different. I just made sure to use the original numbers in place of the ones in the guide (which I believe was yours). I wasn't expecting it to, but it all worked.
                Ah, you must have seen the convo I was having about this on ArmTVtech forum?

                FYI, I think I solved a better problem. Even with this patch it will not honor build.prop ro.fs.fakerotation settings. In fact if you change them it will bootloop. I recently played with policy.jar as well and got it to honor build.prop settings for rotation. This means without any APPs you can boot into a specific rotation and APPs will not cause a rotation. But I have some other bugs now that I need to work on around this.

                Bob
                "Pzebacz im, bo nie wiedzą, co czynią"
                "Прости им, они не ведают, что творят"
                "Perdona loro perché non sanno quello che fanno"
                "Vergib ihnen, denn sie wissen nicht, was sie tun"
                "Vergeef hen want ze weten niet wat ze doen"
                "Pardonne-leur car ils ne savent pas ce qu'ils font"
                "Perdónalos porque no saben que lo que hacen"
                "Oprosti im, jer ne znaju što čine"
                "Forgive them as they know not what they do"





                Comment


                  #9
                  Originally posted by Finless View Post
                  Ah, you must have seen the convo I was having about this on ArmTVtech forum?
                  I think that was probably it, it was a while back, but I know it wasn't on this site. So yea, credit goes to you on this one, I just hacked it together.

                  Originally posted by Finless View Post
                  ....But I have some other bugs now that I need to work on around this.
                  Bob
                  Sounds good. At least this solution works acceptably for now. My neck was getting awefully stiff using it in landscape on a portrait display!! On the other hand, my hand-eye translation/coordination while using it like that was improving greatly. Really strange at first when up/down and left/right are swapped!!

                  Comment


                    #10
                    Hi guys,

                    Sorry for reopening this post , but as I am a newbie with these things it is a bit hard for me to follow what you sayed.

                    I need to do just as you mention in your first post : being able to rotate dynamically the screen using an android tv box.

                    Could you explain for an stupid newbie like me how to accomplish this by modifying service.jar ?

                    Thank you in advance!

                    Comment

                    Working...
                    X