PDA

View Full Version : HTC Surface Flinger Permission



abhi
11-17-2009, 12:47 AM
Hi,

My project involves streaming H.263 content from one dev1 phone to another and displaying it. I am using htc dream images for the dev1 phones. For this i am decoding the received frames using M4V decoder present in the opencore OMX library and displaying them using surface flinger.

I am currently stuck with the place where my application needs permission to access the surface flinger. I got the following error..

W/ServiceManager( 176): Permission failure: android.permission.ACCESS_SURFACE_FLINGER from uid= 1080 pid= 10020

E/SurfaceFlinger( 176): Permission Denial: can't access SurfaceFlinger pid=1080, uid=10020

Applications signed with system keys only can access the surface flinger.

When i tested the application in Android 1.5 SDK the same permission issue was encountered. I solved the issue by signing the application with the platform certificate(platform.x509.pem) and private key(platform.pk8) using a utility tool(signapk.jar). All these were available in the SDK. I also added the permission in my application's manifest file.

But there are no such certificates or keys available for the dev1 phone.

I can follow two approaches..

1. I have found a keystore - cacerts.bks in the /etc/security folder in the phone. My doubt is, does this keystore contain the platform certificate and the private key in it. If it contains,i can sign the application using that keystore. Even then i need the password for that particular private key if at all there is one. Without the signing thing my application cant access the surface flinger.

2. Or can i use only the sink node (MIO node to display) of the open core to display my decoded data. Can i pass the output buffer from my decoder to the sink node. Can i isolate the sink node from the node graph. If i use the sink node i think this node wont be messed up with the permission issues.

If anyone has faced the same problem and solved it please help..
Thank You..
abhi