Merge "VirtualDisplay.Callbacks -> Callback" into lmp-dev
diff --git a/Android.mk b/Android.mk
index 35bb66c..419b1ed 100644
--- a/Android.mk
+++ b/Android.mk
@@ -150,7 +150,7 @@
core/java/android/hardware/ISerialManager.aidl \
core/java/android/hardware/display/IDisplayManager.aidl \
core/java/android/hardware/display/IDisplayManagerCallback.aidl \
- core/java/android/hardware/display/IVirtualDisplayCallbacks.aidl \
+ core/java/android/hardware/display/IVirtualDisplayCallback.aidl \
core/java/android/hardware/hdmi/IHdmiControlCallback.aidl \
core/java/android/hardware/hdmi/IHdmiControlService.aidl \
core/java/android/hardware/hdmi/IHdmiDeviceEventListener.aidl \
diff --git a/api/current.txt b/api/current.txt
index 20454bf..5e14236 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -13234,7 +13234,7 @@
public final class DisplayManager {
method public android.hardware.display.VirtualDisplay createVirtualDisplay(java.lang.String, int, int, int, android.view.Surface, int);
- method public android.hardware.display.VirtualDisplay createVirtualDisplay(java.lang.String, int, int, int, android.view.Surface, int, android.hardware.display.VirtualDisplay.Callbacks, android.os.Handler);
+ method public android.hardware.display.VirtualDisplay createVirtualDisplay(java.lang.String, int, int, int, android.view.Surface, int, android.hardware.display.VirtualDisplay.Callback, android.os.Handler);
method public android.view.Display getDisplay(int);
method public android.view.Display[] getDisplays();
method public android.view.Display[] getDisplays(java.lang.String);
@@ -13262,11 +13262,11 @@
method public void setSurface(android.view.Surface);
}
- public static abstract class VirtualDisplay.Callbacks {
- ctor public VirtualDisplay.Callbacks();
- method public void onDisplayPaused();
- method public void onDisplayResumed();
- method public void onDisplayStopped();
+ public static abstract class VirtualDisplay.Callback {
+ ctor public VirtualDisplay.Callback();
+ method public void onPaused();
+ method public void onResumed();
+ method public void onStopped();
}
}
@@ -16312,7 +16312,7 @@
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.Callbacks, 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 stop();
}
diff --git a/core/java/android/hardware/display/DisplayManager.java b/core/java/android/hardware/display/DisplayManager.java
index 51b7229..b077e06 100644
--- a/core/java/android/hardware/display/DisplayManager.java
+++ b/core/java/android/hardware/display/DisplayManager.java
@@ -472,7 +472,7 @@
/**
* Creates a virtual display.
*
- * @see #createVirtualDisplay(String, int, int, int, Surface, int, VirtualDisplay.Callbacks)
+ * @see #createVirtualDisplay(String, int, int, int, Surface, int, VirtualDisplay.Callback)
*/
public VirtualDisplay createVirtualDisplay(@NonNull String name,
int width, int height, int densityDpi, @Nullable Surface surface, int flags) {
@@ -513,7 +513,7 @@
* {@link #VIRTUAL_DISPLAY_FLAG_PUBLIC}, {@link #VIRTUAL_DISPLAY_FLAG_PRESENTATION},
* {@link #VIRTUAL_DISPLAY_FLAG_SECURE}, {@link #VIRTUAL_DISPLAY_FLAG_OWN_CONTENT_ONLY},
* or {@link #VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR}.
- * @param callbacks Callbacks to call when the state of the {@link VirtualDisplay} changes
+ * @param callback Callback to call when the state of the {@link VirtualDisplay} changes
* @param handler The handler on which the listener should be invoked, or null
* if the listener should be invoked on the calling thread's looper.
* @return The newly created virtual display, or null if the application could
@@ -524,17 +524,17 @@
*/
public VirtualDisplay createVirtualDisplay(@NonNull String name,
int width, int height, int densityDpi, @Nullable Surface surface, int flags,
- @Nullable VirtualDisplay.Callbacks callbacks, @Nullable Handler handler) {
+ @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) {
return createVirtualDisplay(null,
- name, width, height, densityDpi, surface, flags, callbacks, handler);
+ name, width, height, densityDpi, surface, flags, callback, handler);
}
/** @hide */
public VirtualDisplay createVirtualDisplay(@Nullable MediaProjection projection,
@NonNull String name, int width, int height, int densityDpi, @Nullable Surface surface,
- int flags, @Nullable VirtualDisplay.Callbacks callbacks, @Nullable Handler handler) {
+ int flags, @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) {
return mGlobal.createVirtualDisplay(mContext, projection,
- name, width, height, densityDpi, surface, flags, callbacks, handler);
+ name, width, height, densityDpi, surface, flags, callback, handler);
}
/**
diff --git a/core/java/android/hardware/display/DisplayManagerGlobal.java b/core/java/android/hardware/display/DisplayManagerGlobal.java
index 8b44f3b..0051ef5 100644
--- a/core/java/android/hardware/display/DisplayManagerGlobal.java
+++ b/core/java/android/hardware/display/DisplayManagerGlobal.java
@@ -372,7 +372,7 @@
public VirtualDisplay createVirtualDisplay(Context context, MediaProjection projection,
String name, int width, int height, int densityDpi, Surface surface, int flags,
- VirtualDisplay.Callbacks callbacks, Handler handler) {
+ VirtualDisplay.Callback callback, Handler handler) {
if (TextUtils.isEmpty(name)) {
throw new IllegalArgumentException("name must be non-null and non-empty");
}
@@ -381,7 +381,7 @@
+ "greater than 0");
}
- VirtualDisplayCallbacks callbackWrapper = new VirtualDisplayCallbacks(callbacks, handler);
+ VirtualDisplayCallback callbackWrapper = new VirtualDisplayCallback(callback, handler);
IMediaProjection projectionToken = projection != null ? projection.getProjection() : null;
int displayId;
try {
@@ -408,7 +408,7 @@
return new VirtualDisplay(this, display, callbackWrapper, surface);
}
- public void setVirtualDisplaySurface(IVirtualDisplayCallbacks token, Surface surface) {
+ public void setVirtualDisplaySurface(IVirtualDisplayCallback token, Surface surface) {
try {
mDm.setVirtualDisplaySurface(token, surface);
} catch (RemoteException ex) {
@@ -416,7 +416,7 @@
}
}
- public void resizeVirtualDisplay(IVirtualDisplayCallbacks token,
+ public void resizeVirtualDisplay(IVirtualDisplayCallback token,
int width, int height, int densityDpi) {
try {
mDm.resizeVirtualDisplay(token, width, height, densityDpi);
@@ -425,7 +425,7 @@
}
}
- public void releaseVirtualDisplay(IVirtualDisplayCallbacks token) {
+ public void releaseVirtualDisplay(IVirtualDisplayCallback token) {
try {
mDm.releaseVirtualDisplay(token);
} catch (RemoteException ex) {
@@ -476,61 +476,61 @@
}
}
- private final static class VirtualDisplayCallbacks extends IVirtualDisplayCallbacks.Stub {
- private VirtualDisplayCallbacksDelegate mDelegate;
+ private final static class VirtualDisplayCallback extends IVirtualDisplayCallback.Stub {
+ private VirtualDisplayCallbackDelegate mDelegate;
- public VirtualDisplayCallbacks(VirtualDisplay.Callbacks callbacks, Handler handler) {
- if (callbacks != null) {
- mDelegate = new VirtualDisplayCallbacksDelegate(callbacks, handler);
+ public VirtualDisplayCallback(VirtualDisplay.Callback callback, Handler handler) {
+ if (callback != null) {
+ mDelegate = new VirtualDisplayCallbackDelegate(callback, handler);
}
}
@Override // Binder call
- public void onDisplayPaused() {
+ public void onPaused() {
if (mDelegate != null) {
- mDelegate.sendEmptyMessage(VirtualDisplayCallbacksDelegate.MSG_DISPLAY_PAUSED);
+ mDelegate.sendEmptyMessage(VirtualDisplayCallbackDelegate.MSG_DISPLAY_PAUSED);
}
}
@Override // Binder call
- public void onDisplayResumed() {
+ public void onResumed() {
if (mDelegate != null) {
- mDelegate.sendEmptyMessage(VirtualDisplayCallbacksDelegate.MSG_DISPLAY_RESUMED);
+ mDelegate.sendEmptyMessage(VirtualDisplayCallbackDelegate.MSG_DISPLAY_RESUMED);
}
}
@Override // Binder call
- public void onDisplayStopped() {
+ public void onStopped() {
if (mDelegate != null) {
- mDelegate.sendEmptyMessage(VirtualDisplayCallbacksDelegate.MSG_DISPLAY_STOPPED);
+ mDelegate.sendEmptyMessage(VirtualDisplayCallbackDelegate.MSG_DISPLAY_STOPPED);
}
}
}
- private final static class VirtualDisplayCallbacksDelegate extends Handler {
+ private final static class VirtualDisplayCallbackDelegate extends Handler {
public static final int MSG_DISPLAY_PAUSED = 0;
public static final int MSG_DISPLAY_RESUMED = 1;
public static final int MSG_DISPLAY_STOPPED = 2;
- private final VirtualDisplay.Callbacks mCallbacks;
+ private final VirtualDisplay.Callback mCallback;
- public VirtualDisplayCallbacksDelegate(VirtualDisplay.Callbacks callbacks,
+ public VirtualDisplayCallbackDelegate(VirtualDisplay.Callback callback,
Handler handler) {
super(handler != null ? handler.getLooper() : Looper.myLooper(), null, true /*async*/);
- mCallbacks = callbacks;
+ mCallback = callback;
}
@Override
public void handleMessage(Message msg) {
switch (msg.what) {
case MSG_DISPLAY_PAUSED:
- mCallbacks.onDisplayPaused();
+ mCallback.onPaused();
break;
case MSG_DISPLAY_RESUMED:
- mCallbacks.onDisplayResumed();
+ mCallback.onResumed();
break;
case MSG_DISPLAY_STOPPED:
- mCallbacks.onDisplayStopped();
+ mCallback.onStopped();
break;
}
}
diff --git a/core/java/android/hardware/display/IDisplayManager.aidl b/core/java/android/hardware/display/IDisplayManager.aidl
index cfaa5a0..4486dd4 100644
--- a/core/java/android/hardware/display/IDisplayManager.aidl
+++ b/core/java/android/hardware/display/IDisplayManager.aidl
@@ -17,7 +17,7 @@
package android.hardware.display;
import android.hardware.display.IDisplayManagerCallback;
-import android.hardware.display.IVirtualDisplayCallbacks;
+import android.hardware.display.IVirtualDisplayCallback;
import android.hardware.display.WifiDisplay;
import android.hardware.display.WifiDisplayStatus;
import android.media.projection.IMediaProjection;
@@ -61,17 +61,17 @@
// Requires CAPTURE_VIDEO_OUTPUT, CAPTURE_SECURE_VIDEO_OUTPUT, or an appropriate
// MediaProjection token for certain combinations of flags.
- int createVirtualDisplay(in IVirtualDisplayCallbacks callbacks,
+ int createVirtualDisplay(in IVirtualDisplayCallback callback,
in IMediaProjection projectionToken, String packageName, String name,
int width, int height, int densityDpi, in Surface surface, int flags);
// No permissions required, but must be same Uid as the creator.
- void resizeVirtualDisplay(in IVirtualDisplayCallbacks token,
+ void resizeVirtualDisplay(in IVirtualDisplayCallback token,
int width, int height, int densityDpi);
// No permissions required but must be same Uid as the creator.
- void setVirtualDisplaySurface(in IVirtualDisplayCallbacks token, in Surface surface);
+ void setVirtualDisplaySurface(in IVirtualDisplayCallback token, in Surface surface);
// No permissions required but must be same Uid as the creator.
- void releaseVirtualDisplay(in IVirtualDisplayCallbacks token);
+ void releaseVirtualDisplay(in IVirtualDisplayCallback token);
}
diff --git a/core/java/android/hardware/display/IVirtualDisplayCallbacks.aidl b/core/java/android/hardware/display/IVirtualDisplayCallback.aidl
similarity index 90%
rename from core/java/android/hardware/display/IVirtualDisplayCallbacks.aidl
rename to core/java/android/hardware/display/IVirtualDisplayCallback.aidl
index a1cdc01..c3490d1 100644
--- a/core/java/android/hardware/display/IVirtualDisplayCallbacks.aidl
+++ b/core/java/android/hardware/display/IVirtualDisplayCallback.aidl
@@ -16,20 +16,20 @@
package android.hardware.display;
/** @hide */
-oneway interface IVirtualDisplayCallbacks {
+oneway interface IVirtualDisplayCallback {
/**
* Called when the virtual display video projection has been
* paused by the system or when the surface has been detached
* by the application by calling setSurface(null).
* The surface will not receive any more buffers while paused.
*/
- void onDisplayPaused();
+ void onPaused();
/**
* Called when the virtual display video projection has been
* resumed after having been paused.
*/
- void onDisplayResumed();
+ void onResumed();
/**
* Called when the virtual display video projection has been
@@ -37,5 +37,5 @@
* and it will never be resumed. It is still the responsibility
* of the application to release() the virtual display.
*/
- void onDisplayStopped();
+ void onStopped();
}
diff --git a/core/java/android/hardware/display/VirtualDisplay.java b/core/java/android/hardware/display/VirtualDisplay.java
index 1dd6978..4ddf10f 100644
--- a/core/java/android/hardware/display/VirtualDisplay.java
+++ b/core/java/android/hardware/display/VirtualDisplay.java
@@ -35,11 +35,11 @@
public final class VirtualDisplay {
private final DisplayManagerGlobal mGlobal;
private final Display mDisplay;
- private IVirtualDisplayCallbacks mToken;
+ private IVirtualDisplayCallback mToken;
private Surface mSurface;
VirtualDisplay(DisplayManagerGlobal global, Display display,
- IVirtualDisplayCallbacks token, Surface surface) {
+ IVirtualDisplayCallback token, Surface surface) {
mGlobal = global;
mDisplay = display;
mToken = token;
@@ -114,20 +114,20 @@
/**
* Interface for receiving information about a {@link VirtualDisplay}'s state changes.
*/
- public static abstract class Callbacks {
+ public static abstract class Callback {
/**
* Called when the virtual display video projection has been
* paused by the system or when the surface has been detached
* by the application by calling setSurface(null).
* The surface will not receive any more buffers while paused.
*/
- public void onDisplayPaused() { }
+ public void onPaused() { }
/**
* Called when the virtual display video projection has been
* resumed after having been paused.
*/
- public void onDisplayResumed() { }
+ public void onResumed() { }
/**
* Called when the virtual display video projection has been
@@ -135,6 +135,6 @@
* and it will never be resumed. It is still the responsibility
* of the application to release() the virtual display.
*/
- public void onDisplayStopped() { }
+ public void onStopped() { }
}
}
diff --git a/media/java/android/media/projection/MediaProjection.java b/media/java/android/media/projection/MediaProjection.java
index 99d3ceb..3a74d93 100644
--- a/media/java/android/media/projection/MediaProjection.java
+++ b/media/java/android/media/projection/MediaProjection.java
@@ -97,12 +97,12 @@
*/
public VirtualDisplay createVirtualDisplay(@NonNull String name,
int width, int height, int dpi, boolean isSecure, @Nullable Surface surface,
- @Nullable VirtualDisplay.Callbacks callbacks, @Nullable Handler handler) {
+ @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) {
DisplayManager dm = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
int flags = isSecure ? DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE : 0;
return dm.createVirtualDisplay(this, name, width, height, dpi, surface,
flags | DisplayManager.VIRTUAL_DISPLAY_FLAG_AUTO_MIRROR |
- DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION, callbacks, handler);
+ DisplayManager.VIRTUAL_DISPLAY_FLAG_PRESENTATION, callback, handler);
}
/**
@@ -120,21 +120,21 @@
* should be rendered, or null if there is none initially.
* @param flags A combination of virtual display flags. See {@link DisplayManager} for the full
* list of flags.
- * @param callbacks Callbacks to call when the virtual display's state
+ * @param callback Callback to call when the virtual display's state
* changes, or null if none.
* @param handler The {@link android.os.Handler} on which the callback should be
* invoked, or null if the callback should be invoked on the calling
* thread's main {@link android.os.Looper}.
*
* @see android.hardware.display.DisplayManager#createVirtualDisplay(
- * String, int, int, int, int, Surface, VirtualDisplay.Callbacks, Handler)
+ * String, int, int, int, int, Surface, VirtualDisplay.Callback, Handler)
*/
public VirtualDisplay createVirtualDisplay(@NonNull String name,
int width, int height, int dpi, int flags, @Nullable Surface surface,
- @Nullable VirtualDisplay.Callbacks callbacks, @Nullable Handler handler) {
+ @Nullable VirtualDisplay.Callback callback, @Nullable Handler handler) {
DisplayManager dm = (DisplayManager) mContext.getSystemService(Context.DISPLAY_SERVICE);
return dm.createVirtualDisplay(
- this, name, width, height, dpi, surface, flags, callbacks, handler);
+ this, name, width, height, dpi, surface, flags, callback, handler);
}
/**
diff --git a/services/core/java/com/android/server/display/DisplayManagerService.java b/services/core/java/com/android/server/display/DisplayManagerService.java
index e31f177..e609701 100644
--- a/services/core/java/com/android/server/display/DisplayManagerService.java
+++ b/services/core/java/com/android/server/display/DisplayManagerService.java
@@ -29,7 +29,7 @@
import android.hardware.display.DisplayManagerInternal.DisplayTransactionListener;
import android.hardware.display.IDisplayManager;
import android.hardware.display.IDisplayManagerCallback;
-import android.hardware.display.IVirtualDisplayCallbacks;
+import android.hardware.display.IVirtualDisplayCallback;
import android.hardware.display.WifiDisplayStatus;
import android.hardware.input.InputManagerInternal;
import android.media.projection.IMediaProjection;
@@ -491,7 +491,7 @@
}
}
- private int createVirtualDisplayInternal(IVirtualDisplayCallbacks callbacks,
+ private int createVirtualDisplayInternal(IVirtualDisplayCallback callback,
IMediaProjection projection, int callingUid, String packageName,
String name, int width, int height, int densityDpi, Surface surface, int flags) {
synchronized (mSyncRoot) {
@@ -502,7 +502,7 @@
}
DisplayDevice device = mVirtualDisplayAdapter.createVirtualDisplayLocked(
- callbacks, projection, callingUid, packageName,
+ callback, projection, callingUid, packageName,
name, width, height, densityDpi, surface, flags);
if (device == null) {
return -1;
@@ -517,7 +517,7 @@
// Something weird happened and the logical display was not created.
Slog.w(TAG, "Rejecting request to create virtual display "
+ "because the logical display was not created.");
- mVirtualDisplayAdapter.releaseVirtualDisplayLocked(callbacks.asBinder());
+ mVirtualDisplayAdapter.releaseVirtualDisplayLocked(callback.asBinder());
handleDisplayDeviceRemovedLocked(device);
}
return -1;
@@ -1251,14 +1251,14 @@
}
@Override // Binder call
- public int createVirtualDisplay(IVirtualDisplayCallbacks callbacks,
+ public int createVirtualDisplay(IVirtualDisplayCallback callback,
IMediaProjection projection, String packageName, String name,
int width, int height, int densityDpi, Surface surface, int flags) {
final int callingUid = Binder.getCallingUid();
if (!validatePackageName(callingUid, packageName)) {
throw new SecurityException("packageName must match the calling uid");
}
- if (callbacks == null) {
+ if (callback == null) {
throw new IllegalArgumentException("appToken must not be null");
}
if (TextUtils.isEmpty(name)) {
@@ -1306,7 +1306,7 @@
final long token = Binder.clearCallingIdentity();
try {
- return createVirtualDisplayInternal(callbacks, projection, callingUid,
+ return createVirtualDisplayInternal(callback, projection, callingUid,
packageName, name, width, height, densityDpi, surface, flags);
} finally {
Binder.restoreCallingIdentity(token);
@@ -1314,31 +1314,31 @@
}
@Override // Binder call
- public void resizeVirtualDisplay(IVirtualDisplayCallbacks callbacks,
+ public void resizeVirtualDisplay(IVirtualDisplayCallback callback,
int width, int height, int densityDpi) {
final long token = Binder.clearCallingIdentity();
try {
- resizeVirtualDisplayInternal(callbacks.asBinder(), width, height, densityDpi);
+ resizeVirtualDisplayInternal(callback.asBinder(), width, height, densityDpi);
} finally {
Binder.restoreCallingIdentity(token);
}
}
@Override // Binder call
- public void setVirtualDisplaySurface(IVirtualDisplayCallbacks callbacks, Surface surface) {
+ public void setVirtualDisplaySurface(IVirtualDisplayCallback callback, Surface surface) {
final long token = Binder.clearCallingIdentity();
try {
- setVirtualDisplaySurfaceInternal(callbacks.asBinder(), surface);
+ setVirtualDisplaySurfaceInternal(callback.asBinder(), surface);
} finally {
Binder.restoreCallingIdentity(token);
}
}
@Override // Binder call
- public void releaseVirtualDisplay(IVirtualDisplayCallbacks callbacks) {
+ public void releaseVirtualDisplay(IVirtualDisplayCallback callback) {
final long token = Binder.clearCallingIdentity();
try {
- releaseVirtualDisplayInternal(callbacks.asBinder());
+ releaseVirtualDisplayInternal(callback.asBinder());
} finally {
Binder.restoreCallingIdentity(token);
}
diff --git a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
index e39f0b1..f6399a3 100644
--- a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
@@ -18,7 +18,7 @@
import android.content.Context;
import android.hardware.display.DisplayManager;
-import android.hardware.display.IVirtualDisplayCallbacks;
+import android.hardware.display.IVirtualDisplayCallback;
import android.media.projection.IMediaProjection;
import android.media.projection.IMediaProjectionCallback;
import android.os.Handler;
@@ -55,15 +55,15 @@
mHandler = handler;
}
- public DisplayDevice createVirtualDisplayLocked(IVirtualDisplayCallbacks callbacks,
+ public DisplayDevice createVirtualDisplayLocked(IVirtualDisplayCallback callback,
IMediaProjection projection, int ownerUid, String ownerPackageName,
String name, int width, int height, int densityDpi, Surface surface, int flags) {
boolean secure = (flags & DisplayManager.VIRTUAL_DISPLAY_FLAG_SECURE) != 0;
- IBinder appToken = callbacks.asBinder();
+ IBinder appToken = callback.asBinder();
IBinder displayToken = SurfaceControl.createDisplay(name, secure);
VirtualDisplayDevice device = new VirtualDisplayDevice(displayToken, appToken,
ownerUid, ownerPackageName, name, width, height, densityDpi, surface, flags,
- new Callbacks(callbacks, mHandler));
+ new Callback(callback, mHandler));
mVirtualDisplayDevices.put(appToken, device);
@@ -139,7 +139,7 @@
final String mOwnerPackageName;
final String mName;
private final int mFlags;
- private final Callbacks mCallbacks;
+ private final Callback mCallback;
private int mWidth;
private int mHeight;
@@ -153,7 +153,7 @@
public VirtualDisplayDevice(IBinder displayToken, IBinder appToken,
int ownerUid, String ownerPackageName,
String name, int width, int height, int densityDpi, Surface surface, int flags,
- Callbacks callbacks) {
+ Callback callback) {
super(VirtualDisplayAdapter.this, displayToken);
mAppToken = appToken;
mOwnerUid = ownerUid;
@@ -164,7 +164,7 @@
mDensityDpi = densityDpi;
mSurface = surface;
mFlags = flags;
- mCallbacks = callbacks;
+ mCallback = callback;
mDisplayState = Display.STATE_UNKNOWN;
mPendingChanges |= PENDING_SURFACE_CHANGE;
}
@@ -184,7 +184,7 @@
mSurface = null;
}
SurfaceControl.destroyDisplay(getDisplayTokenLocked());
- mCallbacks.dispatchDisplayStopped();
+ mCallback.dispatchDisplayStopped();
}
@Override
@@ -192,9 +192,9 @@
if (state != mDisplayState) {
mDisplayState = state;
if (state == Display.STATE_OFF) {
- mCallbacks.dispatchDisplayPaused();
+ mCallback.dispatchDisplayPaused();
} else {
- mCallbacks.dispatchDisplayResumed();
+ mCallback.dispatchDisplayResumed();
}
}
}
@@ -287,16 +287,16 @@
}
}
- private static class Callbacks extends Handler {
+ private static class Callback extends Handler {
private static final int MSG_ON_DISPLAY_PAUSED = 0;
private static final int MSG_ON_DISPLAY_RESUMED = 1;
private static final int MSG_ON_DISPLAY_STOPPED = 2;
- private final IVirtualDisplayCallbacks mCallbacks;
+ private final IVirtualDisplayCallback mCallback;
- public Callbacks(IVirtualDisplayCallbacks callbacks, Handler handler) {
+ public Callback(IVirtualDisplayCallback callback, Handler handler) {
super(handler.getLooper());
- mCallbacks = callbacks;
+ mCallback = callback;
}
@Override
@@ -304,13 +304,13 @@
try {
switch (msg.what) {
case MSG_ON_DISPLAY_PAUSED:
- mCallbacks.onDisplayPaused();
+ mCallback.onPaused();
break;
case MSG_ON_DISPLAY_RESUMED:
- mCallbacks.onDisplayResumed();
+ mCallback.onResumed();
break;
case MSG_ON_DISPLAY_STOPPED:
- mCallbacks.onDisplayStopped();
+ mCallback.onStopped();
break;
}
} catch (RemoteException e) {