开发者

Android setRotation usage

开发者 https://www.devze.com 2023-03-21 10:03 出处:网络
I am wondering if I can change the device\'s orienation (respecting respective app policies) using IWindowManager service\'s setRotation. I am not going to issue this from application layer, instead t

I am wondering if I can change the device's orienation (respecting respective app policies) using IWindowManager service's setRotation. I am not going to issue this from application layer, instead there is a requirement to change the device orientation (to either lands开发者_如何学JAVAcape / portrait) from frameworks layer itself.

Therefore in order to achieve this, I have written a C utility daemon which calls my java code using Binder IPC mechanism to invoke my service's exposed method (lets call it myfunc() )

In myfunc, I have something as follows:-

IWindowManager.Stub.asInterface(ServiceManager.getService
("window")).setRotation(0,true,0)

But it looks like the device orientation is not changed. Any suggestions please / inputs?

Thanks,

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号