Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cde5bb45 authored by Michael Wright's avatar Michael Wright
Browse files

Change callback methods from add to register.

Also changes intent returning method from get to create. Both changes
are in response to API council feedback.

Bug: 17389882
Change-Id: I3b57e3fc202148e3bbb24ac61229f04e8b4ac41e
parent 969e543b
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -16345,10 +16345,10 @@ package android.media.effect {
package android.media.projection {
  public final class MediaProjection {
    method public void addCallback(android.media.projection.MediaProjection.Callback, android.os.Handler);
    method public android.hardware.display.VirtualDisplay createVirtualDisplay(java.lang.String, int, int, int, int, android.view.Surface, android.hardware.display.VirtualDisplay.Callback, android.os.Handler);
    method public void removeCallback(android.media.projection.MediaProjection.Callback);
    method public void registerCallback(android.media.projection.MediaProjection.Callback, android.os.Handler);
    method public void stop();
    method public void unregisterCallback(android.media.projection.MediaProjection.Callback);
  }
  public static abstract class MediaProjection.Callback {
@@ -16357,8 +16357,8 @@ package android.media.projection {
  }
  public final class MediaProjectionManager {
    method public android.content.Intent createScreenCaptureIntent();
    method public android.media.projection.MediaProjection getMediaProjection(int, android.content.Intent);
    method public android.content.Intent getScreenCaptureIntent();
  }
}
+2 −2
Original line number Diff line number Diff line
@@ -26,6 +26,6 @@ interface IMediaProjection {
    boolean canProjectVideo();
    boolean canProjectSecureVideo();
    int applyVirtualDisplayFlags(int flags);
    void addCallback(IMediaProjectionCallback callback);
    void removeCallback(IMediaProjectionCallback callback);
    void registerCallback(IMediaProjectionCallback callback);
    void unregisterCallback(IMediaProjectionCallback callback);
}
+5 −5
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ import java.util.Map;
 *
 * <p>
 * A screen capture session can be started through {@link
 * MediaProjectionManager#getScreenCaptureIntent}. This grants the ability to
 * MediaProjectionManager#createScreenCaptureIntent}. This grants the ability to
 * capture screen contents, but not system audio.
 * </p>
 */
@@ -70,9 +70,9 @@ public final class MediaProjection {
     * @param handler The handler on which the callback should be invoked, or
     * null if the callback should be invoked on the calling thread's looper.
     *
     * @see #removeCallback
     * @see #unregisterCallback
     */
    public void addCallback(Callback callback, Handler handler) {
    public void registerCallback(Callback callback, Handler handler) {
        if (callback == null) {
            throw new IllegalArgumentException("callback should not be null");
        }
@@ -83,9 +83,9 @@ public final class MediaProjection {
     *
     * @param callback The callback to unregister.
     *
     * @see #addCallback
     * @see #registerCallback
     */
    public void removeCallback(Callback callback) {
    public void unregisterCallback(Callback callback) {
        if (callback == null) {
            throw new IllegalArgumentException("callback should not be null");
        }
+1 −1
Original line number Diff line number Diff line
@@ -75,7 +75,7 @@ public final class MediaProjectionManager {
     * the user whether to allow screen capture.  The result of this
     * activity should be passed to getMediaProjection.
     */
    public Intent getScreenCaptureIntent() {
    public Intent createScreenCaptureIntent() {
        Intent i = new Intent();
        i.setClassName("com.android.systemui",
                "com.android.systemui.media.MediaProjectionPermissionActivity");
+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {

        try {
            if (projection != null) {
                projection.addCallback(new MediaProjectionCallback(appToken));
                projection.registerCallback(new MediaProjectionCallback(appToken));
            }
            appToken.linkToDeath(device, 0);
        } catch (RemoteException ex) {
Loading