WindowManager --> SurfaceFlinger

622 views
Skip to first unread message

Kokki

unread,
Jan 7, 2010, 5:11:52 AM1/7/10
to android-platform
Hi,

Trying to understand , how the window is being finally rendered to the
screen through SurfaceFlinger.

I understood/assume that the particular window to be drawn in the
screen is being pushed by the window manager service to the
SurfaceFlinger.
If this understanding is correct, Can any one tell me where this is
been done in the window manager service level.

If my understanding is wrong, please correct me.

With Regards
abthul razeeth.

Dianne Hackborn

unread,
Jan 7, 2010, 11:03:00 AM1/7/10
to android-...@googlegroups.com
No, the window manager just creates and positions the surface.  The application draws directly in to the surface without the window manager being involved at all.  The window manager doesn't know anything about the contents of the surface: what is drawn, the view hierarchy, nothing.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To post to this group, send email to android-...@googlegroups.com.
To unsubscribe from this group, send email to android-platfo...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.






--
Dianne Hackborn
Android framework engineer
hac...@android.com

Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails.  All such questions should be posted on public forums, where I and others can see and answer them.

p. yog

unread,
Jan 7, 2010, 11:30:37 AM1/7/10
to android-...@googlegroups.com
Hi,

can any one please help me , iam working to collect frame buffer data from Java App, Iooking for ApI r interfaces to grab the frame buffer data.

1) Are there any API's to Java App which collects frame bufferdata (r) changes happening on surface?
2) can we by-pass frame buffer data from surface flinger to Java App?
3) what are services with respective to surface flinger running in back ground?

Thanks in advance,
Yog

Kokki

unread,
Jan 14, 2010, 11:30:39 PM1/14/10
to android-platform
Hi,
Thanks,
I understand that the window manager maitains the different surfaces
required for different windows available in the system. I am curios to
know why the application windows always takes the full screen space,
can we resize the application window to occupy only half the screen.
Is window manager responsible for doing this?.

With Regards
Abthul.

On Jan 7, 9:03 pm, Dianne Hackborn <hack...@android.com> wrote:
> No, the window manager just creates and positions the surface.  The
> application draws directly in to the surface without the window manager
> being involved at all.  The window manager doesn't know anything about the
> contents of the surface: what is drawn, the view hierarchy, nothing.
>
>
>
>
>
> On Thu, Jan 7, 2010 at 2:11 AM, Kokki <abthulraze...@gmail.com> wrote:
> > Hi,
>
> > Trying to understand , how the window is being finally rendered to the
> > screen through SurfaceFlinger.
>
> > I understood/assume that the particular window to be drawn in the
> > screen is being pushed by the window manager service to the
> > SurfaceFlinger.
> > If this understanding is correct, Can any one tell me where this is
> > been done in the window manager service level.
>
> > If my understanding is wrong, please correct me.
>
> > With Regards
> > abthul razeeth.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to

> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib­e...@googlegroups.com>


> > .
> > For more options, visit this group at
> >http://groups.google.com/group/android-platform?hl=en.
>
> --
> Dianne Hackborn
> Android framework engineer

> hack...@android.com


>
> Note: please don't send private questions to me, as I don't have time to
> provide private support, and so won't reply to such e-mails.  All such
> questions should be posted on public forums, where I and others can see and

> answer them.- Hide quoted text -
>
> - Show quoted text -

Dianne Hackborn

unread,
Jan 15, 2010, 2:41:33 AM1/15/10
to android-...@googlegroups.com
The window manager works with the application to decide on the size of the screen.  Most activities are full-screen because that is what they request...  but if they are displaying a dialog, for example, they will ask to be smaller and overlapping and that is what the window manager will give (without appropriate constraints).

To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.






--
Dianne Hackborn
Android framework engineer
hac...@android.com

Kokki

unread,
Jan 15, 2010, 6:41:10 AM1/15/10
to android-platform
Thanks,
From you answer, i understand that if the application request for
different size for the window, then it is possible to display window
in different size. The same way, is it possible to specify the
poistion of the window where the window should be displayed in the
screen.

Lets say something like , i have two applications A1 and A2, Is it
possible to display A1 in the upper half of the screen and A2 in the
lower half of the screen and focus will be in any of these two
applications according to user selection. Is it possible to achieve
the above one by doing some changes in the android framework level or
do you think some changes is required in middleware also to achive
this.

With Regards
abthul.

Dianne Hackborn

unread,
Jan 15, 2010, 6:46:45 AM1/15/10
to android-...@googlegroups.com
I'm not sure what the difference is between the android framework and "middleware."  Right now there are a lot of assumptions backed into the framework well beyond the window manager of one application window being on top at a time; there has been discussion about this in the past that you can search for.

To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.






--
Dianne Hackborn
Android framework engineer
hac...@android.com

ABTHUL RAZEETH

unread,
Jan 15, 2010, 6:59:35 AM1/15/10
to android-...@googlegroups.com
I referred android framework as the managed code layer and the middleware as the code written in C/CPP, eg) SurfaceFlinger Implementation.
I will search the older posts also.
To keep it simple, My goal is to have two applications visible to the user simultaneously on the screen and one of the two applications will have the focus. user should be able to switch between the applications just by touching the application window. so basically i am looking for resizing and respositioning the window, hence i can acheive the above requirement. I am now trying to understand the current flow in android and trying to tweak it. It would be of great help, if you can give some pointers in the work involved to achive this.
 
With Regards
abthul.

Pradeep Reddy

unread,
Jan 15, 2010, 9:12:28 AM1/15/10
to android-...@googlegroups.com
I think, current window manager type is tiling window manager, in whiich you cant resize,reposition and cant display two application at once. Looking into tiling window managers and its merits and demerits gives you more clarity.

Kokki

unread,
Jan 15, 2010, 9:37:21 AM1/15/10
to android-platform
Hey thank you very much for your continous replies.
If android follows tilling window manger concept, then we should be
able to atleast tile two applications either horizontally or
vertically right. what is your opinion. is it logical to proceed, is
there a hope in android to achive this or should we adopt desktop
window manager concept in android, if so what would be the magnitude
of that work. i just want to get your opinion on this as you have
already worked for android framework, you will be the right person to
tell , how much effort is required to do such changes. Thanks in
advance.

With regards
abthul.

On Jan 15, 7:12 pm, Pradeep Reddy <pradeep....@gmail.com> wrote:
> I think, current window manager type is tiling window manager, in whiich you
> cant resize,reposition and cant display two application at once. Looking
> into tiling window managers and its merits and demerits gives you more
> clarity.
>

> On Fri, Jan 15, 2010 at 8:59 PM, ABTHUL RAZEETH <abthulraze...@gmail.com>wrote:
>
>
>
> > I referred android framework as the managed code layer and the middleware
> > as the code written in C/CPP, eg) SurfaceFlinger Implementation.
> > I will search the older posts also.
> > To keep it simple, My goal is to have two applications visible to the user
> > simultaneously on the screen and one of the two applications will have the
> > focus. user should be able to switch between the applications just by
> > touching the application window. so basically i am looking for resizing and
> > respositioning the window, hence i can acheive the above requirement. I am
> > now trying to understand the current flow in android and trying to tweak it.
> > It would be of great help, if you can give some pointers in the work
> > involved to achive this.
>
> > With Regards
> > abthul.
>

> >   On Fri, Jan 15, 2010 at 5:16 PM, Dianne Hackborn <hack...@android.com>wrote:
>
> >>  I'm not sure what the difference is between the android framework and
> >> "middleware."  Right now there are a lot of assumptions backed into the
> >> framework well beyond the window manager of one application window being on
> >> top at a time; there has been discussion about this in the past that you can
> >> search for.
>

> >> answer them.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> To post to this group, send email to android-...@googlegroups.com.
> >> To unsubscribe from this group, send email to

> >> android-platfo...@googlegroups.com<android-platform%2Bunsubscrib­e...@googlegroups.com>
> >> .
> >> For more options, visit this group at
> >>http://groups.google.com/group/android-platform?hl=en.
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "android-platform" group.
> > To post to this group, send email to android-...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > android-platfo...@googlegroups.com<android-platform%2Bunsubscrib­e...@googlegroups.com>
> > .
> > For more options, visit this group at

> >http://groups.google.com/group/android-platform?hl=en.- Hide quoted text -

Dianne Hackborn

unread,
Jan 15, 2010, 2:19:38 PM1/15/10
to android-...@googlegroups.com
If you are planning on running existing applications and/or shipping with Market, I very strongly recommend you not go down this path.  The changes needed for this are extremely likely to break existing applications in subtle ways; there is a good chance that you wouldn't end up being compatible so not able to have Market.

At whatever point this kind of feature is added to the platform, it is going to require months and months of compatibility testing and fixing to ensure everything ends up working again as it should, much like the effort needed to implement support for different screen sizes ands densities.

Kokki

unread,
Jan 17, 2010, 11:50:49 PM1/17/10
to android-platform
I am not planning for any market release, i am basically trying to add
this feature to the android application framework.
When i go through the code, i can realize that many of the design
patterns are applied across all framework components.
I guess, the android framework code is very much extensible for custom
designs.
One more point i would like to get it clarified from you.
As you said, the WindowManager service co-works with the application
to decide the size of the surface.
Likewise, Does SurfaceFlinger co-works with the windowManagerservice
to decide on the extends of the surface or SurfaceFlinger just
compoistes the Surfaces and generates the final frame?

with regards
kokki

On Jan 16, 12:19 am, Dianne Hackborn <hack...@android.com> wrote:
> If you are planning on running existing applications and/or shipping with
> Market, I very strongly recommend you not go down this path.  The changes
> needed for this are extremely likely to break existing applications in
> subtle ways; there is a good chance that you wouldn't end up being
> compatible so not able to have Market.
>
> At whatever point this kind of feature is added to the platform, it is going
> to require months and months of compatibility testing and fixing to ensure
> everything ends up working again as it should, much like the effort needed
> to implement support for different screen sizes ands densities.
>

> On Fri, Jan 15, 2010 at 3:59 AM, ABTHUL RAZEETH <abthulraze...@gmail.com>wrote:
>
>
>
>
>
> > I referred android framework as the managed code layer and the middleware
> > as the code written in C/CPP, eg) SurfaceFlinger Implementation.
> > I will search the older posts also.
> > To keep it simple, My goal is to have two applications visible to the user
> > simultaneously on the screen and one of the two applications will have the
> > focus. user should be able to switch between the applications just by
> > touching the application window. so basically i am looking for resizing and
> > respositioning the window, hence i can acheive the above requirement. I am
> > now trying to understand the current flow in android and trying to tweak it.
> > It would be of great help, if you can give some pointers in the work
> > involved to achive this.
>
> > With Regards
> > abthul.
>

> > On Fri, Jan 15, 2010 at 5:16 PM, Dianne Hackborn <hack...@android.com>wrote:
>
> >> I'm not sure what the difference is between the android framework and
> >> "middleware."  Right now there are a lot of assumptions backed into the
> >> framework well beyond the window manager of one application window being on
> >> top at a time; there has been discussion about this in the past that you can
> >> search for.
>

> >> answer them.
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "android-platform" group.
> >> To post to this group, send email to android-...@googlegroups.com.
> >> To unsubscribe from this group, send email to

Dianne Hackborn

unread,
Jan 18, 2010, 2:30:58 AM1/18/10
to android-...@googlegroups.com
No, WindowManagerService is entirely in control of telling surface flinger when to create surfaces, where to place them, etc.

To unsubscribe from this group, send email to android-platfo...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/android-platform?hl=en.






--
Dianne Hackborn
Android framework engineer
hac...@android.com
Reply all
Reply to author
Forward
0 new messages