Loading core/java/android/service/dreams/DreamService.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -234,6 +234,7 @@ public class DreamService extends Service implements Window.Callback { private boolean mCanDoze; private boolean mCanDoze; private boolean mDozing; private boolean mDozing; private boolean mWindowless; private boolean mWindowless; private boolean mOverlayFinishing; private int mDozeScreenState = Display.STATE_UNKNOWN; private int mDozeScreenState = Display.STATE_UNKNOWN; private int mDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT; private int mDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT; Loading Loading @@ -1051,6 +1052,7 @@ public class DreamService extends Service implements Window.Callback { // We must unbind from any overlay connection if we are unbound before finishing. // We must unbind from any overlay connection if we are unbound before finishing. if (mOverlayConnection != null) { if (mOverlayConnection != null) { mOverlayConnection.unbind(); mOverlayConnection.unbind(); mOverlayConnection = null; } } return super.onUnbind(intent); return super.onUnbind(intent); Loading @@ -1067,7 +1069,9 @@ public class DreamService extends Service implements Window.Callback { // If there is an active overlay connection, signal that the dream is ending before // If there is an active overlay connection, signal that the dream is ending before // continuing. Note that the overlay cannot rely on the unbound state, since another dream // continuing. Note that the overlay cannot rely on the unbound state, since another dream // might have bound to it in the meantime. // might have bound to it in the meantime. if (mOverlayConnection != null) { if (mOverlayConnection != null && !mOverlayFinishing) { // Set mOverlayFinish to true to only allow this consumer to be added once. mOverlayFinishing = true; mOverlayConnection.addConsumer(overlay -> { mOverlayConnection.addConsumer(overlay -> { try { try { overlay.endDream(); overlay.endDream(); Loading Loading
core/java/android/service/dreams/DreamService.java +5 −1 Original line number Original line Diff line number Diff line Loading @@ -234,6 +234,7 @@ public class DreamService extends Service implements Window.Callback { private boolean mCanDoze; private boolean mCanDoze; private boolean mDozing; private boolean mDozing; private boolean mWindowless; private boolean mWindowless; private boolean mOverlayFinishing; private int mDozeScreenState = Display.STATE_UNKNOWN; private int mDozeScreenState = Display.STATE_UNKNOWN; private int mDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT; private int mDozeScreenBrightness = PowerManager.BRIGHTNESS_DEFAULT; Loading Loading @@ -1051,6 +1052,7 @@ public class DreamService extends Service implements Window.Callback { // We must unbind from any overlay connection if we are unbound before finishing. // We must unbind from any overlay connection if we are unbound before finishing. if (mOverlayConnection != null) { if (mOverlayConnection != null) { mOverlayConnection.unbind(); mOverlayConnection.unbind(); mOverlayConnection = null; } } return super.onUnbind(intent); return super.onUnbind(intent); Loading @@ -1067,7 +1069,9 @@ public class DreamService extends Service implements Window.Callback { // If there is an active overlay connection, signal that the dream is ending before // If there is an active overlay connection, signal that the dream is ending before // continuing. Note that the overlay cannot rely on the unbound state, since another dream // continuing. Note that the overlay cannot rely on the unbound state, since another dream // might have bound to it in the meantime. // might have bound to it in the meantime. if (mOverlayConnection != null) { if (mOverlayConnection != null && !mOverlayFinishing) { // Set mOverlayFinish to true to only allow this consumer to be added once. mOverlayFinishing = true; mOverlayConnection.addConsumer(overlay -> { mOverlayConnection.addConsumer(overlay -> { try { try { overlay.endDream(); overlay.endDream(); Loading