Yadnesh Phadke
unread,May 8, 2012, 7:01:58 AM5/8/12Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to android-...@googlegroups.com
Hi All,
I have built android ICS (Maguro) from source, and experimenting with using the SurfaceFlinger service for capturing current screen shot, on the rooted phone that has the locally built OS.
I do have the necessary permissions (READ_FRAME_BUFFER and ACCESS_SURFACE_FLINGER) set on the Manifest. Also using the tag android:sharedUserId="android.uid.system", in the manifest.
I have written java code to get the "surfaceFlinger" system service, and then calling the "transact" function of the remote service with the code "7" for screen capture as seen in "ISurfaceComposer.h".
I see that the SurfaceFlinger::captureScreen() function is correctly getting called and i do receive the size, format, and fd for the allocated memory, from the reply parcel. Now when I try to use the data at the file descriptor to create a bitmap (Bitmap.Config.ARGB_8888), it seems to work, but i always get a complete black image.
Can anyone help to point out what i may be missing here?
Regards,
Yadnesh