SurfaceFlinger: Add support for non-privileged clients.
Allow clients without privilege to create child layers through scoped
connections. We enable this in preparation for allowing SurfaceView
to bypass the WindowManager. We include support for reparenting of
all of a layer's children for the WindowManager to use in cases where
one surface is replacing another (while keeping its children around).
Test: Tested with corresponding SurfaceView modifications.
Change-Id: I9920e6730d719113522a68788e63fb59f70d3406
diff --git a/services/surfaceflinger/Client.h b/services/surfaceflinger/Client.h
index 2a9825c..7328c22 100644
--- a/services/surfaceflinger/Client.h
+++ b/services/surfaceflinger/Client.h
@@ -38,8 +38,9 @@
class Client : public BnSurfaceComposerClient
{
public:
- explicit Client(const sp<SurfaceFlinger>& flinger);
- ~Client();
+ explicit Client(const sp<SurfaceFlinger>& flinger);
+ Client(const sp<SurfaceFlinger>& flinger, const sp<Layer>& parentLayer);
+ ~Client();
status_t initCheck() const;
@@ -50,6 +51,8 @@
sp<Layer> getLayerUser(const sp<IBinder>& handle) const;
+ void setParentLayer(const sp<Layer>& parentLayer);
+
private:
// ISurfaceComposerClient interface
virtual status_t createSurface(
@@ -76,6 +79,8 @@
// protected by mLock
DefaultKeyedVector< wp<IBinder>, wp<Layer> > mLayers;
+ wp<Layer> mParentLayer;
+
// thread-safe
mutable Mutex mLock;
};