- Root cause: When an app uses the system default camera app to open
the camera on the phone, and another app uses an Intent
(MediaStore.ACTION_IMAGE_CAPTURE) (the system default camera app) to
open the camera on the virtual display, because they will use the same
thread in the camera service, the camera will only reconfigure the
stream without creating it again. Therefore, the onCameraOpened callback
will not be triggered, causing the issue that the camera on the virtual
display is not blocked.
- Solution: The camera mechanism is that only one camera can run at a
time. If two apps open the camera at the same time, it will first open
and close the camera of one of two apps, and then open the camera of
another app. So we identify above issue according to this rule: track
the app that opens the camera on the phone (main display). When it is
detected that this app also appears on the virtual display, it means
that the app appears on both sides at the same time, which belongs to
the above issue, and the camera of this app is set to a blocked state.
Bug: 210795569
Test: Manual
Change-Id: Idabee8a38085c8aae1f47f3579cead1adde385ea
Before, we search overlay within the same root Task, which can be other
task in split. Now, we only search within the same leaf Task.
Bug: 197364677
Test: atest WmTests:TaskFragmentTest
Change-Id: I64dfdf322a15cfd80f169d0ddfc6e9bbf94d2a03
* changes:
[automerge] [DO NOT MERGE] Update to use new res status bar height dimen 2p: 47fb15fe8c
[DO NOT MERGE] Update to use new res status bar height dimen
Previously, if an app posted a notification with an invalid sound
and they targeted P+, we would not post the notification.
However, sounds are often not in the control of apps, and apps
should not be blamed if those sounds get corrupted.
With this cl, rather than dropping the notification if the app
provides an invalid uri, we will replace the sound with the default
notification sound.
Bug: 227770797
Fixes: 201488127
Test: NotificationRecordTest; modify sms sounds to be invalid and ensure
notification is posted with sound
Change-Id: Id438b7ea6912b13cfb79a09fe700474ad17879de
Because the client callbacks from SoundTriggerMiddleware service are
async, if a client quickly stops and starts a model, then receives a
detection event for that model, it is impossible for it to tell
whether the event corresponding to the previous or current session,
and thus is unable to reason about the resulting state of the model.
To mitigate that, we will always wait for an abort event when a model
is stopped before any other operation is attempted. This way the
model state stays synchronized.
Bug: 191935600
Fixes: 226926627
Test: Manual verification of soundtrigger use-cases. Specifically,
quick toggling of Assitant and Now Playing via Settings.
Change-Id: Ia1b91e78aa6981a7b3612ae9213af1b37a333d00
This reverts commit 6e2eb81ac4.
The original commit fixed b/223922855, which resulted from fixing
b/191935600, but created another.
Blocking the stop() call until the event confirming the stop arrives is
a bad idea, since:
- We have to give up the lock when waiting for the event, and thus lose
the atomicity of some of the operations. b/226926627 is an example of
this.
- It turns out some of the forward calls happen from the main thread's
looper, which is also used for callbacks, and we risk deadlocks.
A follow-up commit will address the fix in a better way.
Bug: 191935600
Bug: 226926627
Bug: 223922855
Test: See next commit in the chain.
Change-Id: I2b9987ae93803d3b4f72a1df56c88e284bed43c5
Relying on the garbage collector to release SurfaceControl and trigger
destruction of server-side layers has proven to be unreliable in
monkey testing. In this case it may cause the accumulation of
a large number of InputWindowInfo, leading to oneway binder spam.
Bug: 228810413
Test: Existing tests pass
Change-Id: If961767a1209674f202518f8b8be8f930d1a43e3
Prevent the host app from crashing if systemui crashes while binding to
it. Instead, just return null and let the new systemui process bind
again, as the service will be unbound.
Test: atest FrameworksCoreTests:TileServiceTest
Test: manual, tiles still work
Fixes: 168756844
Change-Id: I70e0e8a223a84874415f7e649106398a5e039097