Android Tv Forces App In Portrait Mode
Solution 1:
I think it is not about your application orientation configurations. Many Android-tv producers force the orientation as landscape. If you have access, you may check system properties and find about x.forceorientation:landscape
and change it.
Some producers have also put a settings menu option such as System Settings > Display > Rotate.
Another way, this application can work on some devices
Solution 2:
I had the same problem but with a real TV device - the system ignored rotation at all (everything worked fine on tablets and phones). I found solution for my case but it can be inappropriate for you. So, the short answer is "impossible" the long answer goes here:
Firmware for TV devices often tweaked by their manufacturers, in my case it was /system/framework/services.jar that contained services\com\android\server\wm\WindowManagerService.java in which the following code handled the rotation case:
if ("box".equals(SystemProperties.get("ro.target.product", "tablet"))) {
rotation = 0;
}
of course the /system/build.prop has setting ro.target.product=box, when I tried to patch this file (I had root and possibility to reflash firmware) the system went into the kind of boot loop. The parameter ro.target.product was used several times inside system applications so I think that final firmware in my case lacks some additional code to handle other target modes. Because of this I was forced to patch classes.dex directly in order to turn this checking off.
Another set of options that controls rotation are persist.demo.hdmirotates and persist.demo.hdmirotation, by default they were turned off. When I added them via the command line:
setprop persist.demo.hdmirotates true
setprop persist.demo.hdmirotation landscape
I got desired behavior: my application chooses necessary orientation and it works! In my case the rotation of TV depends upon cabling requirements, i.e. the relative position of TV and its corresponding socket outlet on the wall.
So, no free lunch :-( each device should be handled separately.
Post a Comment for "Android Tv Forces App In Portrait Mode"