summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-05-08 14:58:11 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-05-08 14:58:14 +0000
commit1336c2c68df5761af174d93f42a478ea752e2a5c (patch)
tree4e234aa32cc307b48d572846f9e2e6dcfb48be41 /services
parenta0698b617f1efc71d5301f98aead822e266ec5d6 (diff)
parentd1a5fae3bc1b4fa4ff4e97a1cc14c5b16aa4a799 (diff)
downloadframeworks_base-1336c2c68df5761af174d93f42a478ea752e2a5c.zip
frameworks_base-1336c2c68df5761af174d93f42a478ea752e2a5c.tar.gz
frameworks_base-1336c2c68df5761af174d93f42a478ea752e2a5c.tar.bz2
Merge "Always destroy virtual display on Binder death." into mnc-dev
Diffstat (limited to 'services')
-rw-r--r--services/core/java/com/android/server/display/VirtualDisplayAdapter.java16
1 files changed, 8 insertions, 8 deletions
diff --git a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
index 6f59b54..7f961ae 100644
--- a/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
+++ b/services/core/java/com/android/server/display/VirtualDisplayAdapter.java
@@ -82,7 +82,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
appToken.linkToDeath(device, 0);
} catch (RemoteException ex) {
mVirtualDisplayDevices.remove(appToken);
- device.destroyLocked();
+ device.destroyLocked(false);
return null;
}
@@ -110,7 +110,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
public DisplayDevice releaseVirtualDisplayLocked(IBinder appToken) {
VirtualDisplayDevice device = mVirtualDisplayDevices.remove(appToken);
if (device != null) {
- device.destroyLocked();
+ device.destroyLocked(true);
appToken.unlinkToDeath(device, 0);
}
@@ -147,7 +147,7 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
if (device != null) {
Slog.i(TAG, "Virtual display device released because application token died: "
+ device.mOwnerPackageName);
- device.destroyLocked();
+ device.destroyLocked(false);
sendDisplayDeviceEventLocked(device, DISPLAY_DEVICE_EVENT_REMOVED);
}
}
@@ -205,19 +205,19 @@ final class VirtualDisplayAdapter extends DisplayAdapter {
@Override
public void binderDied() {
synchronized (getSyncRoot()) {
- if (mSurface != null) {
- handleBinderDiedLocked(mAppToken);
- }
+ handleBinderDiedLocked(mAppToken);
}
}
- public void destroyLocked() {
+ public void destroyLocked(boolean binderAlive) {
if (mSurface != null) {
mSurface.release();
mSurface = null;
}
SurfaceControl.destroyDisplay(getDisplayTokenLocked());
- mCallback.dispatchDisplayStopped();
+ if (binderAlive) {
+ mCallback.dispatchDisplayStopped();
+ }
}
@Override