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
This commit is contained in:
Michael Wright
2014-09-08 13:26:34 -07:00
parent 969e543b32
commit cde5bb45cc
6 changed files with 15 additions and 15 deletions

View File

@@ -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();
}
}

View File

@@ -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);
}

View File

@@ -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");
}

View File

@@ -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");

View File

@@ -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) {

View File

@@ -389,7 +389,7 @@ public final class MediaProjectionManagerService extends SystemService
throw new IllegalStateException(
"Cannot start already started MediaProjection");
}
addCallback(callback);
registerCallback(callback);
try {
mToken = callback.asBinder();
mDeathEater = new IBinder.DeathRecipient() {
@@ -424,7 +424,7 @@ public final class MediaProjectionManagerService extends SystemService
}
@Override
public void addCallback(IMediaProjectionCallback callback) {
public void registerCallback(IMediaProjectionCallback callback) {
if (callback == null) {
throw new IllegalArgumentException("callback must not be null");
}
@@ -432,7 +432,7 @@ public final class MediaProjectionManagerService extends SystemService
}
@Override
public void removeCallback(IMediaProjectionCallback callback) {
public void unregisterCallback(IMediaProjectionCallback callback) {
if (callback == null) {
throw new IllegalArgumentException("callback must not be null");
}