Loading apex/media/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -28,5 +28,8 @@ package { sdk { name: "media-module-sdk", bootclasspath_fragments: ["com.android.media-bootclasspath-fragment"], java_sdk_libs: ["service-media-s"], java_sdk_libs: [ "framework-media", "service-media-s", ], } core/java/android/hardware/display/DisplayManagerGlobal.java +7 −5 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ public final class DisplayManagerGlobal { // Guarded by mLock private boolean mDispatchNativeCallbacks = false; private float mNativeCallbackReportedRefreshRate; private final Object mLock = new Object(); @UnsupportedAppUsage Loading Loading @@ -404,10 +405,11 @@ public final class DisplayManagerGlobal { // We can likely save a binder hop if we attach the refresh rate onto the // listener. DisplayInfo display = getDisplayInfoLocked(displayId); if (display != null) { float refreshRate = display.getRefreshRate(); if (display != null && mNativeCallbackReportedRefreshRate != display.getRefreshRate()) { mNativeCallbackReportedRefreshRate = display.getRefreshRate(); // Signal native callbacks if we ever set a refresh rate. nSignalNativeCallbacks(refreshRate); nSignalNativeCallbacks(mNativeCallbackReportedRefreshRate); } } } Loading Loading @@ -1055,8 +1057,8 @@ public final class DisplayManagerGlobal { if (display != null) { // We need to tell AChoreographer instances the current refresh rate so that apps // can get it for free once a callback first registers. float refreshRate = display.getRefreshRate(); nSignalNativeCallbacks(refreshRate); mNativeCallbackReportedRefreshRate = display.getRefreshRate(); nSignalNativeCallbacks(mNativeCallbackReportedRefreshRate); } } } Loading core/java/android/hardware/display/DisplayManagerInternal.java +6 −0 Original line number Diff line number Diff line Loading @@ -286,6 +286,12 @@ public abstract class DisplayManagerInternal { */ public abstract void ignoreProximitySensorUntilChanged(); /** * Returns the refresh rate switching type. */ @DisplayManager.SwitchingType public abstract int getRefreshRateSwitchingType(); /** * Describes the requested power state of the display. * Loading core/java/android/view/ViewDebug.java +5 −7 Original line number Diff line number Diff line Loading @@ -953,8 +953,7 @@ public class ViewDebug { private final Callable<OutputStream> mCallback; private final Executor mExecutor; private final ReentrantLock mLock = new ReentrantLock(false); private final ArrayDeque<byte[]> mQueue = new ArrayDeque<>(3); private final ByteArrayOutputStream mByteStream = new ByteArrayOutputStream(); private final ArrayDeque<Picture> mQueue = new ArrayDeque<>(3); private boolean mStopListening; private Thread mRenderThread; Loading Loading @@ -990,9 +989,7 @@ public class ViewDebug { mQueue.removeLast(); needsInvoke = false; } picture.writeToStream(mByteStream); mQueue.add(mByteStream.toByteArray()); mByteStream.reset(); mQueue.add(picture); mLock.unlock(); if (needsInvoke) { Loading @@ -1003,7 +1000,7 @@ public class ViewDebug { @Override public void run() { mLock.lock(); final byte[] picture = mQueue.poll(); final Picture picture = mQueue.poll(); final boolean isStopped = mStopListening; mLock.unlock(); if (Thread.currentThread() == mRenderThread) { Loading @@ -1024,7 +1021,8 @@ public class ViewDebug { } if (stream != null) { try { stream.write(picture); picture.writeToStream(stream); stream.flush(); } catch (IOException ex) { Log.w("ViewDebug", "Aborting rendering commands capture " + "due to IOException writing to output stream", ex); Loading core/java/android/widget/RemoteViews.java +3 −1 Original line number Diff line number Diff line Loading @@ -814,7 +814,9 @@ public class RemoteViews implements Parcelable, Filter { // The PendingIntent template is stored in the view's tag. OnItemClickListener listener = (parent, view, position, id) -> { RemoteResponse response = findRemoteResponseTag(view); if (response != null) { response.handleViewInteraction(view, handler); } }; av.setOnItemClickListener(listener); av.setTag(pendingIntentTemplate); Loading Loading
apex/media/Android.bp +4 −1 Original line number Diff line number Diff line Loading @@ -28,5 +28,8 @@ package { sdk { name: "media-module-sdk", bootclasspath_fragments: ["com.android.media-bootclasspath-fragment"], java_sdk_libs: ["service-media-s"], java_sdk_libs: [ "framework-media", "service-media-s", ], }
core/java/android/hardware/display/DisplayManagerGlobal.java +7 −5 Original line number Diff line number Diff line Loading @@ -94,6 +94,7 @@ public final class DisplayManagerGlobal { // Guarded by mLock private boolean mDispatchNativeCallbacks = false; private float mNativeCallbackReportedRefreshRate; private final Object mLock = new Object(); @UnsupportedAppUsage Loading Loading @@ -404,10 +405,11 @@ public final class DisplayManagerGlobal { // We can likely save a binder hop if we attach the refresh rate onto the // listener. DisplayInfo display = getDisplayInfoLocked(displayId); if (display != null) { float refreshRate = display.getRefreshRate(); if (display != null && mNativeCallbackReportedRefreshRate != display.getRefreshRate()) { mNativeCallbackReportedRefreshRate = display.getRefreshRate(); // Signal native callbacks if we ever set a refresh rate. nSignalNativeCallbacks(refreshRate); nSignalNativeCallbacks(mNativeCallbackReportedRefreshRate); } } } Loading Loading @@ -1055,8 +1057,8 @@ public final class DisplayManagerGlobal { if (display != null) { // We need to tell AChoreographer instances the current refresh rate so that apps // can get it for free once a callback first registers. float refreshRate = display.getRefreshRate(); nSignalNativeCallbacks(refreshRate); mNativeCallbackReportedRefreshRate = display.getRefreshRate(); nSignalNativeCallbacks(mNativeCallbackReportedRefreshRate); } } } Loading
core/java/android/hardware/display/DisplayManagerInternal.java +6 −0 Original line number Diff line number Diff line Loading @@ -286,6 +286,12 @@ public abstract class DisplayManagerInternal { */ public abstract void ignoreProximitySensorUntilChanged(); /** * Returns the refresh rate switching type. */ @DisplayManager.SwitchingType public abstract int getRefreshRateSwitchingType(); /** * Describes the requested power state of the display. * Loading
core/java/android/view/ViewDebug.java +5 −7 Original line number Diff line number Diff line Loading @@ -953,8 +953,7 @@ public class ViewDebug { private final Callable<OutputStream> mCallback; private final Executor mExecutor; private final ReentrantLock mLock = new ReentrantLock(false); private final ArrayDeque<byte[]> mQueue = new ArrayDeque<>(3); private final ByteArrayOutputStream mByteStream = new ByteArrayOutputStream(); private final ArrayDeque<Picture> mQueue = new ArrayDeque<>(3); private boolean mStopListening; private Thread mRenderThread; Loading Loading @@ -990,9 +989,7 @@ public class ViewDebug { mQueue.removeLast(); needsInvoke = false; } picture.writeToStream(mByteStream); mQueue.add(mByteStream.toByteArray()); mByteStream.reset(); mQueue.add(picture); mLock.unlock(); if (needsInvoke) { Loading @@ -1003,7 +1000,7 @@ public class ViewDebug { @Override public void run() { mLock.lock(); final byte[] picture = mQueue.poll(); final Picture picture = mQueue.poll(); final boolean isStopped = mStopListening; mLock.unlock(); if (Thread.currentThread() == mRenderThread) { Loading @@ -1024,7 +1021,8 @@ public class ViewDebug { } if (stream != null) { try { stream.write(picture); picture.writeToStream(stream); stream.flush(); } catch (IOException ex) { Log.w("ViewDebug", "Aborting rendering commands capture " + "due to IOException writing to output stream", ex); Loading
core/java/android/widget/RemoteViews.java +3 −1 Original line number Diff line number Diff line Loading @@ -814,7 +814,9 @@ public class RemoteViews implements Parcelable, Filter { // The PendingIntent template is stored in the view's tag. OnItemClickListener listener = (parent, view, position, id) -> { RemoteResponse response = findRemoteResponseTag(view); if (response != null) { response.handleViewInteraction(view, handler); } }; av.setOnItemClickListener(listener); av.setTag(pendingIntentTemplate); Loading