History log of /frameworks/base/core/java/android/view/Surface.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b35c9602cf5c628c621e4fe102a461505f302bfe 14-Nov-2014 John Reck <jreck@google.com> Wire up surface width/height to lockHardwareCanvas

Bug: 18338026
Change-Id: I6c37774ef1312278ae81280561060662fef923fb
/frameworks/base/core/java/android/view/Surface.java
ea4e76f68a60a02e175755d22e88894f11282850 07-Nov-2014 John Reck <jreck@google.com> Merge "Fix finalizer ordering/double-free issue" into lmp-mr1-dev
c298f9c9170b9e8721cfb616f784ec22734f22f4 07-Nov-2014 John Reck <jreck@google.com> Fix finalizer ordering/double-free issue

Bug: 18289984

If Surface:finalize() happens after HwuiContext:finalize()
it would try to manipulate a destroyed object. However, as
Surface:finalize() always calls HwuiContext:destroy() this
can be fixed by simply getting rid of HwuiContext's finalizer

Change-Id: I7c912214417ab32891b1c58d045c9721e5f01965
/frameworks/base/core/java/android/view/Surface.java
2d42f484494e4183c42114ce5918fc4592a33fb6 06-Nov-2014 Justin Koh <justinkoh@google.com> am b8038d58: Merge "Hide Surface#lockHardwareCanvas DO NOT MERGE" into lmp-sprout-dev

* commit 'b8038d58da04456e9e7b6e264af69226bf21592c':
Hide Surface#lockHardwareCanvas DO NOT MERGE
7c1ad0cac642dc9a2e84499d7503b7804e0552fe 04-Nov-2014 Justin Koh <justinkoh@google.com> Hide Surface#lockHardwareCanvas DO NOT MERGE

Hide this for now, will be public in a later release.

Change-Id: Ie13438ed10918df8b044103ef04016494aed1d10
/frameworks/base/core/java/android/view/Surface.java
43a5328c8377aa29acd51098d915503e87f13a9a 23-Oct-2014 John Reck <jreck@google.com> Improve documentation

Bug: 17440886

Change-Id: I3f5c0dab6e08c0097fe60eb269e7fffe7b48b563
/frameworks/base/core/java/android/view/Surface.java
2615de920be16de6c7fe49e85fc65923074c2041 21-Oct-2014 John Reck <jreck@google.com> Surface:lockHardwareCanvas DO NOT MERGE

Bug: 17440886

Cherry pick of bb2d0cc7e1d487f7021b1f9ec0c6740e41b535f2

Change-Id: I78f25cdcfc49cc6a142a51b8aab009c37be8e6de
/frameworks/base/core/java/android/view/Surface.java
bb2d0cc7e1d487f7021b1f9ec0c6740e41b535f2 21-Oct-2014 John Reck <jreck@google.com> Surface:lockHardwareCanvas

Bug: 17440886

Change-Id: I1f2d98c63ec1a2814c2258cf7e0096139263770a
/frameworks/base/core/java/android/view/Surface.java
d7e559675c96071b6ee46c3b45aa3c9e7216a9c4 13-Oct-2014 Jesse Hall <jessehall@google.com> Surface: Leave object in unlocked state when unlockCanvasAndPost fails

If nativeUnlockCanvasAndPost() throws, Surface was maintaining a
reference to the native Surface, and assuming it was still locked.
That would cause future lockCanvas() calls to throw without even
trying to lock the native Surface, even though in some cases the
native lock was actually released before the exception was thrown.

Now Surface treats the native object as unlocked even if
nativeUnlockCanvasAndPost() throws, so it will attempt the native lock
on lockCanvas() rather than assuming it would fail.

This change also changes an IllegalStateException to
IllegalArgumentException in unlockCanvasAndPost(). That exception was
added in KitKat, and was never documented or added to the throws
declaration. This was essentially a silent public API change. Quite a
bit of code in the framework (and likely in applications) catches
IAE from this method, but didn't attempt to handle ISE. Although ISE
is more correct here, it's not worth breaking code (and it did -- in
this bug it changed a problem that should have been silently and
perfectly recovered from into a fatal exception in system_server.)

Bug: 17684556
Change-Id: Ia8d3e5d33eaa690d16c7d0f557390c7bb4e1e32e
/frameworks/base/core/java/android/view/Surface.java
5795d6408d8bf44ffe2f49a25f9f333069b59a49 20-Jun-2014 Dan Stoza <stoza@google.com> Surface: Add allocateBuffers to avoid render delay

This plumbs up a new call on the native Surface object that allows
the client to request that BufferQueue pre-allocate all of the buffers
that it might need for rendering. This hopefully prevents allocation
delays during dequeuing and reduces jank.

Bug: 11792166
Change-Id: Ibeaa7475492d4ac2bcacb107ef60c6240081d8b7
/frameworks/base/core/java/android/view/Surface.java
36bef0bf30d6bae48cf3837df351075ca4fce654 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Id5793fa0ebc17ee8b1eecf4b3f327977fdccff71
/frameworks/base/core/java/android/view/Surface.java
7023df08f14ec5dee76ac54c03e870f84e297636 27-Jan-2014 Narayan Kamath <narayan@google.com> Revert "AArch64: Make graphics classes 64-bit compatible"

This reverts commit 18b4cbeedef21c1fa666a110a157bab66edff976.

Change-Id: I0c52983a3ab1ace3ff743de546a43eca28e5cb0e
/frameworks/base/core/java/android/view/Surface.java
18b4cbeedef21c1fa666a110a157bab66edff976 20-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make graphics classes 64-bit compatible

This a merger of two commits submitted to AOSP by
the following authors:

ashok.bhat@arm.com, david.butcher@arm.coma
craig.barber@arm.com, kevin.petit@arm.com and
marcus.oakland@arm.com

Due to the very large number of internal conflicts, I
have chosen to cherry-pick this change instead
of letting it merge through AOSP because the merge
conflict resolution would be very hard to review.

Commit messages below:

================================================
AArch64: Make graphics classes 64-bit compatible

Changes in this patch include

[x] Long is used to store native pointers as they can
be 64-bit.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

[x] AssetAtlasManager is not completely 64-bit compatible
yet. Specifically mAtlasMap member has to be converted
to hold native pointer using long. Added a TODO to
AssetAtlasManager.java to indicate the change required.

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

==================================================================

AArch64: Use long for pointers in graphics/Camera

For storing pointers, long is used in
android/graphics/Camera class, as native
pointers can be 64-bit.

In addition, some minor changes have been done
to conform with standard JNI practice (e.g. use of
jint instead of int in JNI function prototypes)

Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

===================================================================

Change-Id: Ib3eab85ed97ea3e3c227617c20f8d213f17d4ba0
/frameworks/base/core/java/android/view/Surface.java
b6a3ef18342e6671d9674312b66a015d6caa80ed 13-Sep-2013 Tor Norbye <tnorbye@google.com> Merge "Add typedefs and nullness annotations."
d9273d6f289d9b55da3fd0db2f659fdfb48106a8 31-May-2013 Tor Norbye <tnorbye@google.com> Add typedefs and nullness annotations.

This changeset adds in typedef annotations (custom annotations
marked with @IntDef) for various int parameters and return values
in the API. It also adds nullness annotations for cases where the
documentation explicitly mentioned null policy, or where it was
blindingly obvious from the context. Also fixed some typos in the
documentation.

Change-Id: Ica27c01368895818e26237544edd8483007155bb
/frameworks/base/core/java/android/view/Surface.java
a86ab640f7bb0bf3cb4eaed80473ca8c5d131903 30-Aug-2013 Igor Murashkin <iam@google.com> Surface: Change OutOfResourcesException to be a runtime exception

- Deprecates SurfaceTexture.OutOfResourcesException, it wasn't used
- Make all JNI code throw only Surface.OutOfResourcesException
- Get rid of redundant SurfaceControl.OutOfResourcesException

Bug: 10566539
Change-Id: I58126260771b9ccff6a69c672ce7719b9f98138d
/frameworks/base/core/java/android/view/Surface.java
ed55c8db1c0d47492423fc54f4b0dd5cd585e593 20-Aug-2013 Andy McFadden <fadden@android.com> Avoid crashing in unlockCanvasAndPost

It's possible to update the native surface pointer while the
surface is locked (via lockCanvas). This leads to a surprise when
the surface is unlocked. Avoid the surprise by tracking the
locked surface separately.

Bug 10289713

Change-Id: I84346c952be859bbd91ceae7df07b91dabe0948e
/frameworks/base/core/java/android/view/Surface.java
fc0ebd7d379ff63c00ebf78ca252fab5070213da 01-May-2013 Jeff Brown <jeffbrown@google.com> Really make Surface thread-safe.

There were many places where the native object was being
accessed improperly. Also some places where CloseGuard might
not be acquired or released correctly or where the generation
count might not be updated.

Fixed them all.

That said, Surface isn't intended to be used concurrently
so please don't do it. This is only intended to make
hard to find crashes less likely.

Bug: 8328715
Change-Id: I981ef33425823e0fd7ad6b64443f2ec9b0c8335e
/frameworks/base/core/java/android/view/Surface.java
9ddf32aa8ac5aa8c29a8063f0528838f1436e5dd 18-Apr-2013 Mathias Agopian <mathias@google.com> add javadoc for SurfaceView {unL|l}ockCanvas{AndPost}()

Bug: 8593591
Change-Id: I152281ddca8716aee97147cb1b3fb483ed46b053
/frameworks/base/core/java/android/view/Surface.java
7c116b54b743cc3e92ac42abdbbe324d63b50a81 19-Mar-2013 Mathias Agopian <mathias@google.com> make Surface.java internal state thread-safe

it's still incorrect to use Surface from different
threads, however this shouldn't result to native crashes
anymore.

Bug: 8328715
Change-Id: I89ac5cc1218dc5aa0e35f8e6d4737879a442f0c6
/frameworks/base/core/java/android/view/Surface.java
86e1bc730570765355dc8789b5c6de6962a053cc 14-Mar-2013 Mathias Agopian <mathias@google.com> fix CloseGuard usage in Surface

Bug: 8375415
Change-Id: I03e9f318c2ad586f4bd93b280557ada66121d275
/frameworks/base/core/java/android/view/Surface.java
8b5aa4846939975adacd6ea1d2a57a2493ac0216 01-Mar-2013 Romain Guy <romainguy@google.com> Restore the ability to track native Surface changes
Bug #8230990

ViewRootImpl needs to know when the native Surface objects changes
to recreate the EGL surface. A recent refactoring in Surface broke
the behavior of getGenerationId(). This simply restores the old
behavior (every change increments the generation ID by 1.)

Change-Id: Ife1df1ffb2ee7a373b8ebf2431192702ba10f344
/frameworks/base/core/java/android/view/Surface.java
76f56dd598045dadae6dee5e8547bd077b980d5c 15-Feb-2013 Mathias Agopian <mathias@google.com> am ceec31b7: Merge changes I5a218ca1,I853a76d9

* commit 'ceec31b7dab6a23e443d5dcbcfac4a23b720cfde':
Refactoring: Rename SurfaceTextureClient to Surface
clean-up following Surface split
52800617946c456e78ed010c82d0ec4358368164 15-Feb-2013 Mathias Agopian <mathias@google.com> Refactoring: Rename SurfaceTextureClient to Surface

Change-Id: I5a218ca11abeeec05e3a4c3cfc581bcc788814ea
/frameworks/base/core/java/android/view/Surface.java
29479ebe1007361222bf6ab4d5e2a27927d4b8e8 14-Feb-2013 Mathias Agopian <mathias@google.com> clean-up following Surface split

Change-Id: I853a76d92d957ee38a36fcdd280d6407ec316987
/frameworks/base/core/java/android/view/Surface.java
0233b6ee33e743602198cef7fb80f1e4619bb035 15-Feb-2013 Mathias Agopian <mathias@google.com> am 30d7ab9a: fix docs build

# Via Mathias Agopian
* commit '30d7ab9a10fcde397bae7bed5f16d1094fded8b2':
fix docs build
14567588028d0d70f7313251bda86ace2090f2ba 15-Feb-2013 Kristian Monsen <kristianm@google.com> resolved conflicts for merge of 58a1ca66 to master-chromium

Change-Id: I06b61e6d7d52b584eae03a95220381475b8bff0e
30d7ab9a10fcde397bae7bed5f16d1094fded8b2 15-Feb-2013 Mathias Agopian <mathias@google.com> fix docs build

Change-Id: I9819693cfa9ad5b8b15b62eab60ddd35a53c5531
/frameworks/base/core/java/android/view/Surface.java
ab31d3574997eb3a628e80929e13c4d8d7d9c2cc 14-Feb-2013 Mathias Agopian <mathias@google.com> am a41b23d5: Merge "get rid of Surface.getIdentity()"

# Via Android (Google) Code Review (1) and Mathias Agopian (1)
* commit 'a41b23d55da1bd8e68eb784f28e2c3fe9ded080e':
get rid of Surface.getIdentity()
3866f0d581ceaa165710feeee9f37fe1b0d7067d 12-Feb-2013 Mathias Agopian <mathias@google.com> split Surface in two classes: SurfaceControl and Surface

SurfaceControl is the window manager side; it can
control the attributes of a surface but cannot push buffers
to it. Surface on the other hand is the application (producer)
side and is used to push buffers to the surface.

Change-Id: Ib6754c968924e87e8dd02a2073c7a447f729f4dd
/frameworks/base/core/java/android/view/Surface.java
f9136fd9692158574d187af8d4031fa4b1e2b6e6 12-Feb-2013 Mathias Agopian <mathias@google.com> get rid of Surface.getIdentity()

Change-Id: I8b70d77cc1b38009ad71d92025c3beb481a18866
/frameworks/base/core/java/android/view/Surface.java
7c1a49f5f5ed6613d736464bf5001b777e89ced2 13-Feb-2013 Chris Craik <ccraik@google.com> Revert "Merge remote-tracking branch 'goog/master-chromium' into 'goog/master'" DO NOT MERGE

This reverts commit 6c0307dd0aefe9a08794b155fc03ee60ebd14f25, reversing
changes made to a2cd828b749c444d55c2c41c7dbb85088ff94b9f.

Conflicts:
packages/SystemUI/res/values-sv/strings.xml

Change-Id: Ia178efe8b14751583d47b2826bfe3d3d5463dd2e
/frameworks/base/core/java/android/view/Surface.java
fc615a0f643408956fc0dc1b997871e2b27cee7e 20-Dec-2012 Derek Sollenberger <djsollen@google.com> Remove calls to SkCanvas::setBitmapDevice()

Change-Id: Ib0aa2f65b77802b105c0e8a9d7cdde2e863d3673
/frameworks/base/core/java/android/view/Surface.java
545252f4fde6fbb70b07e97a120c7d1405758017 11-Dec-2012 Svetoslav Ganov <svetoslavganov@google.com> Refactoring of the screen magnification feature.

1. This patch takes care of the case where a magnified window is covering an unmagnigied
one. One example is a dialog that covers the IME window.

bug:7634430

2. Ensuring that the UI automator tool can connect and correctly dump the screen.

bug:7694696

3. Removed the partial implementation for multi display magnification. It adds
unnecessary complexity since it cannot be implemented without support for
input from multiple screens. We will revisit when necessary.

4. Moved the magnified border window as a surface in the window manager.

5. Moved the mediator APIs on the window manager and the policy methods on the
WindowManagerPolicy.

6. Implemented batch event processing for the accessibility input filter.

Change-Id: I4ebf68b94fb07201e124794f69611ece388ec116
/frameworks/base/core/java/android/view/Surface.java
152e9bb81aa5b2ab4637f4b2dae04b3ce89fa891 13-Oct-2012 Svetoslav Ganov <svetoslavganov@google.com> Refactoring of the screen magnification feature.

1. The screen magnification feature was implemented entirely as a part of the accessibility
manager. To achieve that the window manager had to implement a bunch of hooks for an
external client to observe its internal state. This was problematic since it dilutes
the window manager interface and allows code that is deeply coupled with the window
manager to reside outside of it. Also the observer callbacks were IPCs which cannot
be called with the window manager's lock held. To avoid that the window manager had
to post messages requesting notification of interested parties which makes the code
consuming the callbacks to run asynchronously of the window manager. This causes timing
issues and adds unnecessary complexity.

Now the magnification logic is split in two halves. The first half that is responsible
to track the magnified portion of the screen and serve as a policy which windows can be
magnified and it is a part of the window manager. This part exposes higher level APIs
allowing interested parties with the right permissions to control the magnification
of a given display. The APIs also allow a client to be registered for callbacks on
interesting changes such as resize of the magnified region, etc. This part servers
as a mediator between magnification controllers and the window manager.

The second half is a controller that is responsible to drive the magnification
state based on touch interactions. It also presents a highlight when magnified to
suggest the magnified potion of the screen. The controller is responsible for auto
zooming out in case the user context changes - rotation, new actitivity. The controller
also auto pans if a dialog appears and it does not interesect the magnified frame.

bug:7410464

2. By design screen magnification and touch exploration work separately and together. If
magnification is enabled the user sees a larger version of the widgets and a sub section
of the screen content. Accessibility services use the introspection APIs to "see" what
is on the screen so they can speak it, navigate to the next item in response to a
gesture, etc. Hence, the information returned to accessibility services has to reflect
what a sighted user would see on the screen. Therefore, if the screen is magnified
we need to adjust the bounds and position of the infos describing views in a magnified
window such that the info bounds are equivalent to what the user sees.

To improve performance we keep accessibility node info caches in the client process.
However, when magnification state changes we have to clear these caches since the
bounds of the cached infos no longer reflect the screen content which just got smaller
or larger.

This patch propagates not only the window scale as before but also the X/Y pan and the
bounds of the magnified portion of the screen to the introspected app. This information
is used to adjust the bounds of the node infos coming from this window such that the
reported bounds are the same as the user sees not as the app thinks they are. Note that
if magnification is enabled we zoom the content and pan it along the X and Y axis. Also
recomputed is the isVisibleToUser property of the reported info since in a magnified
state the user sees a subset of the window content and the views not in the magnified
viewport should be reported as not visible to the user.

bug:7344059

Change-Id: I6f7832c7a6a65c5368b390eb1f1518d0c7afd7d2
/frameworks/base/core/java/android/view/Surface.java
95429c3d1b8113c23b0aad3b74d724dccfad7fa9 23-Oct-2012 Jamie Gennis <jgennis@google.com> Surface: add the PhysicalDisplayInfo#secure field

Bug: 7368436
Change-Id: I38bf7bbfca354380c30da7516f628cf40416d350
/frameworks/base/core/java/android/view/Surface.java
7bbf8163fb83afc54b353a8def52bfb87ecce047 20-Oct-2012 Jamie Gennis <jgennis@google.com> Set the secureness when creating displays

This change makes use of the new 'secure' argument to the
ISurfaceComposer::createDisplay method. In this change both the overlay and
wifi displays are hard-coded to be non-secure displays.

Bug: 7368436
Change-Id: Ib65312f2adab5104d8deefbfc32af9dc106a9129
/frameworks/base/core/java/android/view/Surface.java
b6ce6e42cc89864354c7ecb9ae80504a6c9dddcf 16-Oct-2012 Jamie Gennis <jgennis@google.com> Flag window animation transactions as animations.

This change makes WindowManager use the new eAnimation flag when animating
windows. This prevents some of the window updates from being combined with
updates from prior animation frames.

Bug: 7353840
Change-Id: I5a9f8fa2c1a2f5f08363a45cd9f28bb97cd77080
/frameworks/base/core/java/android/view/Surface.java
9e316a1a2a8d734315bbd56a85308f9657a92913 09-Oct-2012 Jeff Brown <jeffbrown@google.com> Blank or unblank all displays as need.

Ensures that both the internal display and HDMI are blanked
or unblanked in tandem.

Bug: 7309812
Change-Id: Ie8b96d393e8bb20d23c92f3320142d9f7cf42aff
/frameworks/base/core/java/android/view/Surface.java
cbad976b2a36a0895ca94510d5208a86f66cf596 05-Sep-2012 Jeff Brown <jeffbrown@google.com> Add support for Wifi display.

Change-Id: I99693786cf9d07d07d3400046c55eb4933730b80
/frameworks/base/core/java/android/view/Surface.java
63f1c43fbef157397869475ef30d23e631b88bbe 05-Sep-2012 Mathias Agopian <mathias@google.com> update to new SurfaceComposerClient API

Change-Id: I8f2c96df56fe3a851b8ec03bb8734db0b6bea3d5
/frameworks/base/core/java/android/view/Surface.java
4ed8fe75e1dde1a2b9576f3862aecc5a572c56b5 31-Aug-2012 Jeff Brown <jeffbrown@google.com> More improvements to the display manager.

Added more complete support for logical displays with
support for mirroring, rotation and scaling.

Improved the overlay display adapter's touch interactions.

A big change here is that the display manager no longer relies
on a single-threaded model to maintain its synchronization
invariants. Unfortunately we had to change this so as to play
nice with the fact that the window manager wants to own
the surface flinger transaction around display and surface
manipulations. As a result, the display manager has to be able
to update displays from the context of any thread.

It would be nice to make this process more cooperative.
There are already several components competing to perform
surface flinger transactions including the window manager,
display manager, electron beam, overlay display window,
and mouse pointer. They are not manipulating the same surfaces
but they can collide with one another when they make global
changes to the displays.

Change-Id: I04f448594241f2004f6f3d1a81ccd12c566bf296
/frameworks/base/core/java/android/view/Surface.java
64a55af0ac700baecb0877235eb42caac59a3560 26-Aug-2012 Jeff Brown <jeffbrown@google.com> Add plumbing for new surface flinger display API.

Cleaned up the implementation of Surface and SurfaceSession
to use more consistent naming and structure.

Added JNI for all of the new surface flinger display API calls.

Enforced the requirement that all Surfaces created by
the window manager be named.

Updated the display manager service to use the new methods.

Change-Id: I2a658f1bfd0437e1c6f9d22df8d4ffcce7284ca2
/frameworks/base/core/java/android/view/Surface.java
0b722fe9ce98d97dbcb6fefd170b85ab7037e528 25-Aug-2012 Jeff Brown <jeffbrown@google.com> Use new surface flinger API.

Change-Id: Ic888577408a59a36481a48010e19c5e77c24e211
/frameworks/base/core/java/android/view/Surface.java
b47bbc3d80badb94229bc4ce7a2d5006faa9ef15 23-Aug-2012 Craig Mautner <cmautner@google.com> Clean up displayId and layerStack usage.

Make better use of Display object by saving it in DisplayContent.
Only use layerStack when referring to Surfaces. Get displayId from
default Display or default DisplayContent. Remove warnings.

Fixes bug 7038151.

Change-Id: Ie493f0f5e755dc9b91ee969ff561c2a098283ead
/frameworks/base/core/java/android/view/Surface.java
98365d7663cbd82979a5700faf0050220b01084d 20-Aug-2012 Jeff Brown <jeffbrown@google.com> Refactor for multi-display support.

Split WindowManagerImpl into two parts, the WindowManager
interface implementation remains where it is but the global
communications with the window manager are now handled by
the WindowManagerGlobal class. This change greatly simplifies
the challenge of having separate WindowManager instances
for each Context.

Removed WindowManagerImpl.getDefault(). This represents the
bulk of this change. Most of the usages of this method were
either to perform global functions (now handled by WindowManagerGlobal)
or to obtain the default display (now handled by DisplayManager).

Explicitly associate each new window with a display and make
the Display object available to the View hierarchy.

Add stubs for some new display manager API features.

Start to split apart the concepts of display id and layer stack.
since they operate at different layers of abstraction.
While it's true that each logical display uniquely corresponds to a
surface flinger layer stack, it is not necessarily the case that
they must use the same ids. Added Display.getLayerStack()
and started using it in places where it was relatively easy to do.

Change-Id: I29ed909114dec86807c4d3a5059c3fa0358bea61
/frameworks/base/core/java/android/view/Surface.java
9de4936c99b979f6010440b043edc6d6142d1980 02-Aug-2012 Craig Mautner <cmautner@google.com> Add features to DisplayManager.

Added Surface.setDisplayId().
Added callbacks to DisplayManagerService.

Change-Id: Idd3f85f8ca1f1208962f1196efd6a3ab51c8c259
/frameworks/base/core/java/android/view/Surface.java
6881a10557acf3b0270de54799d6f19437acf584 27-Jul-2012 Craig Mautner <cmautner@google.com> Small step towards supporting multiple displays

Change-Id: I353449c2b464394988c7e0203656b5851a0c9127
/frameworks/base/core/java/android/view/Surface.java
fa25bf5382467b1018bd9af7f1cb30a23d7d59f7 24-Jul-2012 Jeff Brown <jeffbrown@google.com> Add display manager skeleton.

The purpose of this change is to remove direct reliance on
SurfaceFlinger for describing the size and characteristics of
displays.

This patch also starts to make a distinction between logical displays
and physical display devices. Currently, the window manager owns
the concept of a logical display whereas the new display
manager owns the concept of a physical display device.

Change-Id: I7e0761f83f033be6c06fd1041280c21500bcabc0
/frameworks/base/core/java/android/view/Surface.java
3cc321ecf505d87850740ad3c63849e6793a8ef6 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove dithering support.

The dithering flag is no longer implemented in Surface Flinger
so this is all dead code.

Change-Id: I74c0e452923207e5b7cfe0eeca9457e5cb990947
/frameworks/base/core/java/android/view/Surface.java
ef4e817ad642303509da1cb28ce5a265e1ac3e17 17-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freeze(), unfreeze() and setFreezeTint().

This is all dead code.

Change-Id: Ia8a3068606bfe277a16cde5690f47996657863e8
/frameworks/base/core/java/android/view/Surface.java
55e395ab33f24b009d87a4d45a5566394260fff7 16-Jul-2012 Jeff Brown <jeffbrown@google.com> Remove freezeDisplay(), which is no-op.

Change-Id: I981ee49e6e2d41a09feaee4b384392e83f7faf3d
/frameworks/base/core/java/android/view/Surface.java
78b8ef3f3ad8ab935f677d8d672db0d97bff8119 07-May-2012 Jamie Gennis <jgennis@google.com> Surface: replace active rect with window crop

This change replaces the setActiveRectCrop method on Surface, which was called
from app processes, with the setWindowCrop method that is to be called from the
window manager.

Bug: 6299171
Change-Id: Ica51efcd8c488a526e7013b83d80df4856694519
/frameworks/base/core/java/android/view/Surface.java
b40696cc216f6a5874189fe83055ddaa7b428ce0 01-May-2012 Jamie Gennis <jgennis@google.com> Surface: add JNI plumbing for setActiveRect.

Bug: 6299171
Change-Id: If26e63ebe7def645626af251bed899ff9389f8e5
/frameworks/base/core/java/android/view/Surface.java
c14bacf1fb511472138eeb5dc84a9423fc003214 24-Apr-2012 Mathias Agopian <mathias@google.com> add a (hidden) api on Surface to query if the consumer is running behind the producer

Change-Id: I71ec1602f66a4850b130893fc7017b5b1ac1b647
/frameworks/base/core/java/android/view/Surface.java
b85c933d850286874005f97a9764c9b22e49a597 09-Mar-2012 Kevin Hester <khester@google.com> Do not allow Surface creation on machines without SurfaceFlinger
We will fail later anyways, but this change makes it much easier to track
down places where we are inadvertently doing operations that depend on the
flinger.

Change-Id: If38a1a10061a594dba5c220a86b32eec7b5ec901
/frameworks/base/core/java/android/view/Surface.java
61566cc1932468720a831ad5cbc68ee080d613c9 03-Dec-2011 Dianne Hackborn <hackbod@google.com> Fix issue #5614559: Registering surface error in...

...Background Replacement on Stingray

This is how I should have done it in the first place. We get the
new surface from the window manager, and then just copy it in to
the constant Surface object we have for the holder.

Change-Id: I537a9e413829a18f689dfb46687014676b27156e
/frameworks/base/core/java/android/view/Surface.java
0ab84ef507f23505a72798fbe25cf4bb2c507ea3 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Make sure to call compositionComplete() after rendering into a FBO.

Bug: 5446982, 5467587, 5466259
Change-Id: I5d8a1b4c327f9973d950cd4f4c0bca7f62825cd4
/frameworks/base/core/java/android/view/Surface.java
840b8a678537519c27ddf2f818494eaa20a135d4 17-Oct-2011 Mathias Agopian <mathias@google.com> Revert "Add a LayerScreenshot"

This reverts commit d6809f40cf61203573ec5dbc437f695cd132cc18.
/frameworks/base/core/java/android/view/Surface.java
d6809f40cf61203573ec5dbc437f695cd132cc18 14-Oct-2011 Mathias Agopian <mathias@google.com> Add a LayerScreenshot

A LayerScreenshot is a special type of layer that contains a screenshot of
the screen acquired when its created. It works just like LayerDim.

Bug: 5446982
Change-Id: I7814aff2380e7e146937f2b641907be2a30c76cc
/frameworks/base/core/java/android/view/Surface.java
01a98ddbdfbaf1f0d2bc602537e6e314364902a3 21-Sep-2011 Jeff Brown <jeffbrown@google.com> Handle orientation changes more systematically.
Bug: 4981385

Simplify the orientation changing code path in the
WindowManager. Instead of the policy calling setRotation()
when the sensor determined orientation changes, it calls
updateRotation(), which figures everything out. For the most
part, the rotation actually passed to setRotation() was
more or less ignored and just added confusion, particularly
when handling deferred orientation changes.

Ensure that 180 degree rotations are disallowed even when
the application specifies SCREEN_ORIENTATION_SENSOR_*.
These rotations are only enabled when docked upside-down for
some reason or when the application specifies
SCREEN_ORIENTATION_FULL_SENSOR.

Ensure that special modes like HDMI connected, lid switch,
dock and rotation lock all cause the sensor to be ignored
even when the application asks for sensor-based orientation
changes. The sensor is not relevant in these modes because
some external factor (or the user) is determining the
preferred rotation.

Currently, applications can still override the preferred
rotation even when there are special modes in play that
might say otherwise. We could tweak this so that some
special modes trump application choices completely
(resulting in a letter-boxed application, perhaps).
I tested this sort of tweak (not included in the patch)
and it seems to work fine, including transitions between
applications with varying orientation.

Delete dead code related to animFlags.

Handle pausing/resuming orientation changes more precisely.
Ensure that a deferred orientation change is performed when
a drag completes, even if endDragLw() is not called because the
drag was aborted before the drop happened. We pause
the orientation change in register() and resume in unregister()
because those methods appear to always be called as needed.

Change-Id: If0a31de3d057251e581fdee64819f2b19e676e9a
/frameworks/base/core/java/android/view/Surface.java
c21843a8b5c395cbaae6db0f786bdee556075f5d 31-Aug-2011 Mathias Agopian <mathias@google.com> Merge "fix Surface positions are not floats"
34cb9f2a960c4173bdafb4b8a2444c1bca4c5f0d 31-Aug-2011 Mathias Agopian <mathias@google.com> fix Surface positions are not floats

Added Surface.setPosition(float, float) which allows to set a surface's
position in float.

Bug: 5239859
Change-Id: I903aef4ad5b5999142202fb8ea30fe216d805711
/frameworks/base/core/java/android/view/Surface.java
0db3aef9f81b056c57b2331dd2750958c9341fdf 29-Aug-2011 Jamie Gennis <jgennis@google.com> Surface: unhide the SurfaceTexture ctor

This change unhides the Surface constructor that creates a Surface that
pushes frames to a SurfaceTexture.

Change-Id: I2e587afc52c9838d25b8681cae7421734b3e7b6e
/frameworks/base/core/java/android/view/Surface.java
df0c84f90894c677c50bdc967a0598f516ac86d7 29-Aug-2011 Jamie Gennis <jgennis@google.com> Surface: move the SurfaceTexture ctor

This change moves the Surface ctor that takes a SurfaceTexture to the
portion of the file containing the public APIs.

Change-Id: I192df7bf5c0e6d0d0607bd577d72646312b2f717
/frameworks/base/core/java/android/view/Surface.java
67403e096e6f59b7cd18a90d0d3f5c3d17c31407 23-Aug-2011 Mathias Agopian <mathias@google.com> BLUR_BEHIND flag is not supported anymore

Bug: 5185650
Change-Id: I56541d4967b90b150a734be1bbeff696eb6a4fb3
/frameworks/base/core/java/android/view/Surface.java
b923066deeffbbaad14a117bd56259bd6ee20a08 03-Aug-2011 Mathias Agopian <mathias@google.com> Mark Window-Manager-specific APIs on android.view.Surface as @hide

Bug: 5063337
Change-Id: I096032186acfc6b6a032636188e4d44907e46233
/frameworks/base/core/java/android/view/Surface.java
0de171b0d490a5928d54d2fb67c912d140aac643 16-Jul-2011 Ted Bonkenburg <tedbo@google.com> Add support for creating a Surface from a a SurfaceTexture.

The Surface is already using SurfaceTexture internally and it is parcelable. This
is intended to replace and phase out ParcelSurfaceTexture in favor of creating a
new Surface.java object from an existing SurfaceTexture.

Change-Id: I8e2dd86614523da6abed6403e1d705a68fa19fdf
/frameworks/base/core/java/android/view/Surface.java
5be8de3420ba4c9d816b98e29bdec11715f6b626 25-May-2011 Dianne Hackborn <hackbod@google.com> More compatibility mode improvements.

We now correctly adjust display metrics, fixing for example issues
seen in Barcode Scanner. In addition the decision about when to use
compatibility mode has a bug fixed where certain apps would not go
out of compatibility mode even though they should be able to.

Change-Id: I5971206323df0f11ce653d1c790c700f457f0582
/frameworks/base/core/java/android/view/Surface.java
d6f5bde96b2fe82bc7e5d4e64266d585108c4648 20-Jan-2011 Glenn Kasten <gkasten@google.com> Protected surface API

To be used by DRM framework, implemented by display HAL

Change-Id: I054a07a94f4d5dbe792f3a597e2e49a100d90eb2
/frameworks/base/core/java/android/view/Surface.java
2a83f001fdb189f945e82e81e717ba204824b112 19-Jan-2011 Romain Guy <romainguy@google.com> Recreate the EGL surface when ViewRoot's surface changes.
Bug #3306150

Change-Id: Ifbf0ab9deca7a34eff7d844ea7276d12d7284788
/frameworks/base/core/java/android/view/Surface.java
334031cd07c3bd09d23fce0ebaf946fc6ecfee26 10-Nov-2010 Glenn Kasten <gkasten@google.com> Fix documentation errors

Fix typos.
Fix javadoc error.
Fix wrong instructions about new returning null.

Change-Id: I76bca22e386839007fc99667b07649a4ced4180f
/frameworks/base/core/java/android/view/Surface.java
d2835935d2df8be70d1b37d3ef3b2fe0155b3422 14-Dec-2010 Dianne Hackborn <hackbod@google.com> Fix issue #3258849: Grab thumbnail when exiting an app via back

Also issue #3281400: Rotating a retained instance fragment leaks the fragment manager

And turn off fragment debug logging.

Change-Id: Ibdd7db82bb35618021bcba421ba92ced7cd691c2
/frameworks/base/core/java/android/view/Surface.java
d2112306330ce0c162bee4b864991962ca2b655a 08-Dec-2010 Mathias Agopian <mathias@google.com> remove support for PUSH_BUFFER surfaces and overlays

the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
/frameworks/base/core/java/android/view/Surface.java
a111187a5b4dc5d287e29ced7d65e8d20edca140 24-Nov-2010 Dianne Hackborn <hackbod@google.com> Change rotation freeze to all be implemented in window manager.

Lots of work for no visible change in behavior, but now we can
do some fancier stuff...

Also allow rotation in all 4 directions.

Change-Id: I7e5e9537c5e359f69b83c10f65cc1ce95f371461
/frameworks/base/core/java/android/view/Surface.java
d10cd5765a2b706fc174f16b951d6b0a5d3740d3 10-Oct-2010 Romain Guy <romainguy@google.com> Always create OpenGL accelerated windows in RGBA 8888.

Bug #3081600

The OpenGL renderer in libhwui uses a single EGL context per process and
thus create it with an RGBA 8888 EGL configuration. To ensure that all
windows are compatible with this configuration, this change modifies
the window manager and SurfaceFlinger.

The window manager now checks the window's flags and if the window is
hardware accelerated, it forces the window's pixel format to be
translucent when creating the surface. The window itself is still
marked as opaque if we know that the window will be opaque on screen.
This keeps existing optimizations in place.

Similarly in SurfaceFlinger, a translucent Surface can now be created
with the Surface.OPAQUE flag, indicating SurfaceFlinger that the surface
does not require blending, despite its RGBA 8888 configuration.

Change-Id: Ic747b6b12564ba064412d842117880fcc199eb7c
/frameworks/base/core/java/android/view/Surface.java
55fb51aa411b574646cc3068ce36e73789b81616 27-Apr-2010 Marco Nelissen <marcone@google.com> resolved conflicts for merge of 86303198 to kraken

Change-Id: Idd921c7108e4c2cd4a861ee1fb8b43e5d56f8f2f
8138cb49e47f9a9905a316a217757710185c66aa 27-Apr-2010 Marco Nelissen <marcone@google.com> Make Surface.toString() show more useful info to help debug bug 2594388.

Change-Id: I005d3388503d8886e11a26fece30b87572934f15
/frameworks/base/core/java/android/view/Surface.java
e30b9ce2621b74365828d3ae76a0ac13b044904c 23-Apr-2010 Jeff Hamilton <jham@android.com> Attempt to fix the build.
/frameworks/base/core/java/android/view/Surface.java
0c1be50ffa256d7b4d39034f90633f33b059c799 23-Apr-2010 Dianne Hackborn <hackbod@google.com> am dc14dc6d: am bf73bbff: Merge "Some debugging help for issue #2594388" into froyo

Merge commit 'dc14dc6d60675be688c333bbc60a315d2c658054' into kraken

* commit 'dc14dc6d60675be688c333bbc60a315d2c658054':
Some debugging help for issue #2594388
ba3e31d9eed67291a51b501d12fdc27625af688e 23-Apr-2010 Dianne Hackborn <hackbod@google.com> Some debugging help for issue #2594388

WallpaperService doesn't always call onSurfaceDestroyed()

Just helps us see a little better what is going on.

Change-Id: Ibe8efd9e343e880ca31df446c8b36c7fa3722e87
/frameworks/base/core/java/android/view/Surface.java
8b138323d54e36fd66b22a634494648e20c53373 13-Apr-2010 Mathias Agopian <mathias@google.com> don't hardcode "mSurface" throughout our source code

this is used in a few places to get access to the android.view.Surface
native surface. use a macro instead. Also rename the field to mNativeSurface.

Change-Id: I1c6dea14abd6b8b1392c7f97b304115999355094
/frameworks/base/core/java/android/view/Surface.java
f5e32f33eddc6e22edee1df486b38294ddc76cc3 24-Mar-2010 Mathias Agopian <mathias@google.com> another small step towards fixing [2501808] sapphire: OOM in GPU Surface area

release the Surface in SurfaceView when it's not visible, after it comes back from relayout(),
it should not be holding buffers at this point, but it's cleaner to have it in the released state.

also log a warning in Surface.finalize() when there is work to do, as it means Surface.release() wasn't
called when it should have.

Change-Id: Id637d4ec2916d8fd800b0344d8dec6cecce02051
/frameworks/base/core/java/android/view/Surface.java
5d26c1e38dabb3ad8b4b6e1000375f3b1a6b7693 02-Mar-2010 Mathias Agopian <mathias@google.com> Added a name to Surface created by SurfaceFlinger

Updated the window manager to use this new facility.
Surfaces name are now printed by "dumpsys".
/frameworks/base/core/java/android/view/Surface.java
0586a1b77a788a119166a37fccd909bf9ed65f23 07-Sep-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2095422: Some fades from opaque to transparent don't work

ViewRoot was using Surface.clear(), which has different behavior
in different processes -- in the system process it would kill the
surface, causing all windows in that process to immediately disappear
instead of animating away.

This change makes Surface.release() public and uses that instead. It
also renames Surface.clear() to Surface.destroy().

Also fixed some issues in the window manager that were causing the
wallpaper to not get immediately resized when the orientation changes
and its target window is removed and re-added.

Change-Id: I2a992e365cf5747511f0bf1193db32dc2525b218
/frameworks/base/core/java/android/view/Surface.java
b2f8450db8dfbc05724624f93d9ec5e65f0b7e54 20-Aug-2009 Mathias Agopian <mathias@google.com> fix [2063336] Surface.lockSurface throws IllegalArgumentException when out of memory
/frameworks/base/core/java/android/view/Surface.java
317a6280cc109e873646e4652be1582d870eedfd 14-Aug-2009 Mathias Agopian <mathias@google.com> Surface::GPU and Surface::HARDWARE are now deprecated; they will be set automatically if needed.

this also ripples into the window manager API by making some constant there deprecated as well.
/frameworks/base/core/java/android/view/Surface.java
a5d7b1b7f7b75d5adf9802f341b22509195c77d5 29-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 159e1a9a: Merge change 8883 into donut

Merge commit '159e1a9a13ccfa4d99941e21068994366e2bbc7b'

* commit '159e1a9a13ccfa4d99941e21068994366e2bbc7b':
fix [1973755] Surface.SURACE_FROZEN spelled SURACE_FROZEN
c87c4a3e3b3c3949ae3c6f8fd245b71691d5ca3b 29-Jul-2009 Mathias Agopian <mathias@google.com> fix [1973755] Surface.SURACE_FROZEN spelled SURACE_FROZEN
/frameworks/base/core/java/android/view/Surface.java
08f89ed9a44ae9262a6c2063878bde44bedb0e37 24-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am e0ef973b: Merge change 8323 into donut

Merge commit 'e0ef973b1358585d039989ee5572e16751078aaf'

* commit 'e0ef973b1358585d039989ee5572e16751078aaf':
* a best effort fix for apps that uses get/set Matrix API on canvas.
240f8a7532a024e36998bdbe87cff2ef080d75de 23-Jul-2009 Mitsuru Oshima <oshima@google.com> * a best effort fix for apps that uses get/set Matrix API on canvas.
- scale the matrix
- but don't scale if the matrix *looks* like obtained from the canvas itself. (typically to set it back to original matrix)

This is best effort change and not perfect (not even close), but works for one game,
and hopes it can handle many other apps that uses set/get Matrix. If you have an alternative idea, please let me know.
/frameworks/base/core/java/android/view/Surface.java
d5d967fbd9753396e908899d8ad2a169d6095d02 22-Jul-2009 Mitsuru Oshima <oshima@google.com> am 38ed7d77: * Adjust canvas size under compatibility mode.

Merge commit '38ed7d7701514ee7127d0430e952930854608c4f'

* commit '38ed7d7701514ee7127d0430e952930854608c4f':
* Adjust canvas size under compatibility mode.
38ed7d7701514ee7127d0430e952930854608c4f 21-Jul-2009 Mitsuru Oshima <oshima@google.com> * Adjust canvas size under compatibility mode.
/frameworks/base/core/java/android/view/Surface.java
17f638b39f2e8b610ecfa1290e5bc42ab7700c98 17-Apr-2009 Mathias Agopian <mathias@google.com> more splitting of Surface/SurfaceControl. Surface.java is now implemented in terms of Surface and SurfaceControl.

The WindowManager side of Surface.java holds a SurfaceControl, while the client-side holds a Surface. When the client is in the system process, Surface.java holds both (which is a problem we'll try to fix later).
/frameworks/base/core/java/android/view/Surface.java
402c34649f514669517c2208e35caa58ff8bb2b9 15-Apr-2009 Mathias Agopian <mathias@google.com> fix some issues with Surface's lifetime management.

To deal with Java's lack of destructors and delayed garbage collection, we used to duplicate Surface.cpp objects in some case; this caused some issues because Surface is supposed to be reference-counted and unique.
/frameworks/base/core/java/android/view/Surface.java
eb0c86e18b7d620b679ff2a45a0233867a53a334 28-Mar-2009 Mathias Agopian <> AI 143320: am: CL 143171 am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias
Merged from: //branches/cupcake/...
Original author: android-build
Merged from: //branches/donutburger/...

Automated import of CL 143320
/frameworks/base/core/java/android/view/Surface.java
66b8ec99c5fc505877b3711a52e284bbb451f836 28-Mar-2009 Mathias Agopian <> AI 143171: am: CL 142873 fix [1732012] Only show screen rotation animation when triggered by sensor
Original author: mathias
Merged from: //branches/cupcake/...

Automated import of CL 143171
/frameworks/base/core/java/android/view/Surface.java
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/view/Surface.java
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/java/android/view/Surface.java
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/java/android/view/Surface.java