summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMichael Wright <michaelwr@google.com>2015-05-05 14:16:35 +0100
committerMichael Wright <michaelwr@google.com>2015-05-06 14:45:43 +0100
commitd1a5fae3bc1b4fa4ff4e97a1cc14c5b16aa4a799 (patch)
tree7bd7c251c512eda14d218aab31b211f378579c84 /services
parentfbb34dd8df7bc89ae972c545130e76c5bbb4176e (diff)
downloadframeworks_base-d1a5fae3bc1b4fa4ff4e97a1cc14c5b16aa4a799.zip
frameworks_base-d1a5fae3bc1b4fa4ff4e97a1cc14c5b16aa4a799.tar.gz
frameworks_base-d1a5fae3bc1b4fa4ff4e97a1cc14c5b16aa4a799.tar.bz2
Always destroy virtual display on Binder death.
Bug: 20265052 Change-Id: I039d3f2bab0dcbbcdc99b7105b04de5bc3845e05
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