summaryrefslogtreecommitdiff
path: root/core/java/android/view/DisplayEventReceiver.java
Commit message (Collapse)AuthorAgeFilesLines
* Use getLatestVsyncEventData for late frame.Rachel Lee2022-03-151-0/+8
| | | | | | | | | Then the vsync ID will be valid. Bug:205721584 Test: atest ChoreographerTest Change-Id: I4098b40ef3e79af40d6accc300b410b17f759ad8
* Implement Java Choreographer multi frame timeline.Rachel Lee2022-01-141-14/+39
| | | | | | Bug: 198191703 Test: atest ChoreographerTest Change-Id: I822782874bc7167be9ad016681ce31b91a38b7ed
* Merge "Change hwui jank detection to use deadline & gpu completion (1/2)" ↵Jorim Jaggi2021-04-131-3/+12
|\ | | | | | | into sc-dev
| * Change hwui jank detection to use deadline & gpu completion (1/2)Jorim Jaggi2021-04-131-3/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Use GPU finish time as well as actual deadline to determine jank rate. - Use dynamic interval to adjust for 60/90hz switching - Move frame metrics reporting into JankTracker to adjust the deadline communicated to the app when in stuffing scenario. - Adjust double-stuffing detection to be a bit more readable. Test: GraphicsStatsValidationTest.java Test: adb shell dumpsys gfxinfo Test: FrameMetricsListenerTest Test: Log output of FrameMetricsObserver Bug: 169858044 Change-Id: I3a6b8ed163e2cf9cf2b67667110340ebe35f98a1
* | Remove CloseGuard from DisplayEventReceiverJohn Reck2021-04-131-12/+0
|/ | | | | | | | | | | | Majority usage of DisplayEventReceiver is with Choreographer, which is a thread-local. As such, it cannot have dispose() called on it easily and dispose is also @hide. Since apps can't do anything about this, and aren't really supposed to, remove the CloseGuard as it just generates false-positive errors for 3p devs. Fixes: 154358085 Test: none Change-Id: I5e9e5324644967897f2b37a19f4fb1485b8ae5bb
* Tracking changes to renaming DisplayConfig to DisplayModeMarin Shalamanov2021-02-041-7/+7
| | | | | | Bug: 159590486 Test: presubmit Change-Id: I64e57fe4d73c22bbbe0a1767cadf8648259e9beb
* Handle DISPLAY_EVENT_FRAME_RATE_OVERRIDEAdy Abraham2020-11-231-10/+54
| | | | | | | | | | | | | | When getting DISPLAY_EVENT_FRAME_RATE_OVERRIDE from SurfaceFlinger, expose the overridden frame rate to the relevant application if the current refresh rate allows that. Bug: 169271059 Bug: 169271062 Bug: 170503758 Test: manual test using SF backdoor adb shell service call SurfaceFlinger 1039 i32 <uid> f <refresh rate> Change-Id: I6ae1a98e6ca13e9d3d095a5713a6b0ca99652256
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-291-1/+2
| | | | | | | | | | | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. This is a resubmit of ag/12929664 with some APIs excluded that caused test failures; see bugs 171886397, 171888296, 171864568. APIs excluded: Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/os/Process;->myPpid()I Landroid/os/SharedMemory;->getFd()I Landroid/hardware/input/InputManager;->INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH:I Bug: 170729553 Test: Treehugger Change-Id: I8285daa8530260251ecad6f3f38f98e263629ca7
* Revert "Add maxTargetSdk restriction to unused APIs."Hongwei Wang2020-10-281-2/+1
| | | | | | | | | This reverts commit 72f07d6a8a32db4a0dedd7682a0b3385be2b9cd6. Reason for revert: Droidcop-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?testMethod=testAppZygotePreload&testClass=android.app.cts.ServiceTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6936597&lkbb=6936969&lkgb=6936551&testResults=true&branch=git_master&target=cf_x86_phone-userdebug>, bug b/171886397 Bug: 171886397 Change-Id: Ibe0f0430a3451477c1ee8ef56a596e91ea1e7672
* Add maxTargetSdk restriction to unused APIs.Mathew Inwood2020-10-271-1/+2
| | | | | | | | | | These are APIs that have @UnsupportedAppUsage but for which we don't have any evidence of them currently being used, so should be safe to remove from the unsupported list. Bug: 170729553 Test: Treehugger Change-Id: I4c8fd0006f950de9955242e93968fb0996ceb372
* pass frame deadline to ChoreographerAdy Abraham2020-10-091-5/+26
| | | | | | | | | | Pass the frame deadline calculated by SF to Choreographer so hwui would be able to improve its stats by knowing if a frame is likely to be late. Bug: 169858174 Test: manual Change-Id: Ib9fd93638b54f08d8dc72fa6b023e2dd7c276dc7
* Removing the UnsupportedAppUsage annotation from ChoreographerAdy Abraham2020-09-291-5/+0
| | | | | | | | | | | Removing the UnsupportedAppUsage annotation according to https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/12517216/11/core/java/android/view/DisplayEventReceiver.java#158 Test: build Bug: 162890382 Bug: 162888881 Bug: 162890407 Change-Id: I1bf8edceb52e9f4cf3f24bf9f6b9e3eb8d8ef01b
* Adding publicAlternatives to UnsupportedAppUsage on ChoreographerAdy Abraham2020-09-291-0/+5
| | | | | | | | | | | | Adding back the UnsupportedAppUsage annotation together with publicAlternatives according to https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/12517216/11/core/java/android/view/DisplayEventReceiver.java#158 Test: build Bug: 162890382 Bug: 162888881 Bug: 162890407 Change-Id: I7b895978ec61290c5320ccb2472b0bf1addc914b
* Shared timeline plumbingSteven Thomas2020-09-161-5/+7
| | | | | | | | | | | | Add plumbing to get shared timeline data from Surface Flinger to HWUI and back. Bug: 162890382 Bug: 162888881 Bug: 162890407 Test: manual using ALOG messages in SF Change-Id: I85c5eb56d2fa933889518854e7b79b1e65e29af3
* Use new UnsupportedAppUsage annotation.Artur Satayev2019-12-181-1/+1
| | | | | | | | Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library. Bug: 145132366 Test: m && diff unsupportedappusage_index.csv Change-Id: I5be7335b23a92b8ac80d2fd890198273b66ad644
* DisplayEventDispatcher: use eConfigChangedDispatchAdy Abraham2019-06-071-4/+20
| | | | | | | | | | In order to get DISPLAY_EVENT_CONFIG_CHANGED, eConfigChangedDispatch needs to be used when creating DisplayEventDispatcher. Bug: 131688378 Test: adb shell /data/nativetest64/libsurfaceflinger_unittest/libsurfaceflinger_unittest Test: trigger config change and observe logcat Change-Id: I0de8037ee5b024b7d9729750f582be919087be41
* DisplayEventDispatcher: add DISPLAY_EVENT_CONFIG_CHANGEDAdy Abraham2019-02-221-0/+18
| | | | | | | | | Add a new event for display configuration change. This event will be sent by SF anytime it changes the display config. Test: Generate DISPLAY_EVENT_CONFIG_CHANGED and observe the log Bug: 122905403 Change-Id: Ifa473a34d7b313501e5e4e8a67186fb82754fdcd
* Generalize physical display managementDominik Laskowski2019-02-041-10/+8
| | | | | | | | | | | | | This CL enables the framework to manage an arbitrary number of physical displays. It also surfaces physical display IDs, which are stable across reboots and encode (model, port) information that will be propagated further up in a follow-up CL. Bug: 116025192 Test: Boot with more than two displays Test: Hotplug works with any number of displays Test: Verify stable display IDs with "dumpsys display" Change-Id: Idb2eaff66b2e0873be6ad27d337ff18b730d1331
* Add @UnsupportedAppUsage annotationsMathew Inwood2018-08-201-0/+8
| | | | | | | | | | | | | | | | | | | | | | For packages: android.view.textservice android.view.textclassifier.logging android.view.textclassifier android.view.inputmethod android.view.autofill android.view.accessibility android.view This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: I4147b038ed7adf0311ee9918b44766f82a057eaf
* Added back removed ctor from DisplayEventReceiverWale Ogunwale2017-06-191-0/+9
| | | | | | | | ...because some app can't help but access hidden APIs... Test: builds Change-Id: Ia1d4a71b46a53b44e3ebe5844e446009785a90ac Fixes: 62719884
* Properly run window animations at vsync-sf (1/2)Jorim Jaggi2017-06-081-3/+22
| | | | | | | | | | | | - Add new Choreographer instance that runs on vsync-sf - Use this new Choreographer for WindowAnimator, and remove all the hacks around it Test: Open apps and close apps, notice no stutter Test: Screen zoom animations Test: go/wm-smoke Bug: 36631902 Change-Id: I988ae25645effc3ac20efa7cb9b68f23444da0d0
* Fix import statement in view|transition|animation packages.Aurimas Liutikas2016-10-121-3/+3
| | | | | | | This change also remove trailing whitespace. Test: code still compiles Change-Id: I7eff4546320d67d2bae58d31bad0625ea0791b8f
* DisplayEventReceiver -> @FastNativeJohn Reck2016-10-031-0/+2
| | | | | Test: make && boot Change-Id: Id75648a2398a13c5af24eabc217bdef778618872
* Fix leaks due to GC circular references.Jeff Brown2015-04-171-2/+4
| | | | | | | | | | | | | | The DisplayEventReceiver and SensorManager event queue both get leaked when the Looper thread they are attached to dies because the Java object holds a strong reference to its native peer and meanwhile the native peer holds a strong reference to the Java object through JNI. Fixed the issue by indirecting through a weak reference as was done for InputEventReceiver some time ago. Bug: 12455729 Change-Id: I3d80a2a190192d1a2981bf5ae0cad30f0f7688a5
* AArch64: Use long for pointers in DisplayEventReceiverAshok Bhat2014-01-071-4/+4
| | | | | | | | | | | | For storing pointers, long is used 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) Change-Id: I3c0855373c0e4bedc172adb82b103586de9219dc Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
* split Surface in two classes: SurfaceControl and SurfaceMathias Agopian2013-02-141-2/+2
| | | | | | | | | 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
* Support HDMI hotplug.Jeff Brown2012-09-211-3/+23
| | | | | Bug: 7206678 Change-Id: Ia5212b16658a5f5a2ccf8528eca7bebd45ca857a
* Fix improper use of CloseGuard.Jeff Brown2012-08-271-1/+9
| | | | Change-Id: I37131a86e27a4be55956384a3566de9dcfd90fe5
* Fix possible races in vsync infrastructure.Jeff Brown2012-02-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications sometimes crashed on exit due to the display event receiver pipe apparently being closed while still a member of the Looper's epoll fd set. This patch fixes a few different possible races related to the display event receiver lifecycle. 1. The receiver used to play a little dance with the Looper, registering and unregistering its callback after each vsync request. This code was a holdover from a time before the surface flinger supported one-shot vsync requests, so we can get rid of it and make things a lot simpler. 2. When the Choreographer is being accessed from outside the UI thread, it needs to take great care that it does not touch the display event receiver. Bad things could happen if the receiver is handling a vsync event on the Looper and the receiver is disposed concurrently. 3. It was possible for the Choreographer to attempt to dispose the receiver while handling a vsync message. Now we defer disposing the receiver for a little while, which is also nice because we may be able to avoid disposing the receiver altogether if we find that we need it again a little while later. Bug: 5974105 Change-Id: I77a158f51b0b689af34d07aee4245b969e6260d6
* Add a new class to receive vsync events.Jeff Brown2011-12-051-0/+115
Change-Id: I4e384336d2813752a6d65fda6a77e86113a4510c