* Mock out registerReceiverAsUser() to avoid SecurityException
* Mock out setKeystorePassword() to not call into the real keystore
Bug: 170661840
Test: atest com.android.server.locksettings
Change-Id: I97c33f3b21ac16d2bb92e1658c222e4d0fd1970e
Otherwise Task#isOnHomeDisplay also returns false for a detached
task, which causes a task without activities is not trimmable
even if it is exclude-from-recent.
Fix: 185481296
Test: atest RecentTasksTest#testVisibleTasks_excludedFromRecents
Change-Id: I66d494376bc750563b914b18e9f4a999913c70e9
Note that this requires removing part of a test, because
that part is testing that the a 50 bonus of the legacy
int is stronger than the validation penalty, which is
not a mechanic we want to have. When WiFi is unvalidated
and cell is unvalidated, cell should be kept in case it
validates, like is described in comments in
isNetworkPotentialSatisfier ; however this test is
checking that it *IS* reaped off if the wifi score is
strong enough. This should be incorrect, and should not
be tested, so this patch removes the check.
Test: ConnectivityServiceTest
Bug: 184834350
Change-Id: I8966abee59fea2d9f10f082aba87df6588b72762
If a non-CEC sink is detected, KEYCODE_TV_POWER will now fall back on KEYCODE_POWER.
This change uses an existing detection mechanism, until now only used to
inform listeners about a non-CEC sink.
Before this change, CEC initialization triggered a DevicePowerStatusAction only if there were listeners registered.
After this change, DevicePowerStatusAction is started regardless of listeners.
Since in unit tests there are no listeners registered, this change introduced a DevicePowerStatusAction in the test setUp() method. Unit tests needed to be updated to account for this additional action:
- introduce wait times to allow for the DevicePowerStatusAction to time-out before starting a new DevicePowerStatusAction
- introduce wait times to allow for the DevicePowerStatusAction to time-out before checking that <Standby> is sent
- clear list of messages sent after DevicePowerStatusAction for tests explicitely verifying that <Give Device Power Status> is sent
Bug: 185092253
Test: atest
Change-Id: I9974c08e79aae04d3658e8ed2e3f55e77b81c558
The hall sensor would report fixed value fields, we have to ignore other
unused values when checking the condition.
- Only check the expected values.
Bug: 182241801
Test: manual
Change-Id: I63c17ac388e3a089914b4b8a3ca3295f90ef1cae
The PendingIntent checking was enforced in ag/14164166(cfd031a), we
should add mutability flag in the test.
Bug: 185534778
Test: atest android.view.textclassifier.TextClassificationTest
Change-Id: I551b29a7b4f7083469ee11ba5fa0d3069abc9bc1
- Move new matrix/rect construction to if the param is set on the
builder, we only apply the params if the flags are set anyways
and if the caller doesn't set those params then we are allocating
new objects unnecessarily
- Always recycle motion event
Bug: 183756396
Test: Take memory profile when dragging pip
Change-Id: Ie7457c8c508ee61bd27daeebe486c39a5cebe7d7
The shell *already had* the privileges granted by this permission due to
specific code in netd, and it lost those privileges when it gained the
CHANGE_NETWORK_STATE permission. Explicitly add
CONNECTIVITY_USE_RESTRICTED_NETWORKS so that it can obtain sufficient
permission in netd no matter CHANGE_NETWORK_STATE is set or not.
Remove a duplicate row by the way.
Bug: 185071689
Test: atest NetdClientTest#protectFromVpnTcp6
Change-Id: I64bc321de2c83378ce7bc8d9eb3044ae7772faca
1. Update the Wallet tile label.
2. Check the card width and height in the request, if they are not valid
(is 0) do not query cards.
Test: manual
Test: atest
Bug: 184905963
Change-Id: Ie1f02a27e2ac0c3077dd576a3ee2efcce0c6b8d4
1. Currently AppSearchSession#setSchema is only invoked when the schema
hasn't been created. The correct logic should be, call setSchema if the
schema version on the device is older than current.
2. Add null check on the call-site of ShortcutPackage#getShortcutById,
the return value is generally non-null (on misses it simply return an
empty list), the only case it can be null is when there was an
exception thrown from AppSearch.
3. Update ShortcutManagerTest10 in comply with security fix in
LauncherAppService#getShortcutConfigActivityIntent
Bug: 151359749
Test: atest ShortcutManagerTest1 ShortcutManagerTest2
ShortcutManagerTest3 ShortcutManagerTest4 ShortcutManagerTest5
ShortcutManagerTest6 ShortcutManagerTest7 ShortcutManagerTest8
ShortcutManagerTest9 ShortcutManagerTest10 ShortcutManagerTest11
ShortcutManagerTest12
Test: atest CtsShortcutManagerTestCases
Change-Id: I214b0e9c8030f45cff5e6451733bf853f6303030
Previously, the returned value of WordIterator#following is used without
checking, which will cause fatal error when it's WordIterator.DONE.
Fix: 184915852
Test: atest CtsInputMethodTestCases:SpellCheckerTest
Change-Id: I37418bb36bc49e7dfa729ffb7209a6f383b611dd
- If the process exits abnormally then we will leak the stdout and
stderr FDs. Fix it by closing the FDs before returning.
- If another child process exits then we will incorrectly return the
result from that process instead of waiting for our child. Fix it
by using waitpid instead of wait.
Change-Id: I8974d5e4bd33f264cd2d364f55a60f1f5cb7eb1a
Previously we created the Filter FMQ from the AIDL MQ Descriptor after
it is passed from the TunerService to the client side.
But the default creation would reset the mq pointer.
Since we only get the mq when read operation is executed on the filter,
the mq could have already been writtern. The default creation would
reset the pointer and erase the data.
Test: atest TunerTest
Bug: 185542142
Change-Id: I56a09e30b0cfbf9fadcaa7f0c7ef1ac6a6d601b1
We set the layer of the nav bar to MAX_VALUE when attaching the nav bar
to app during quick-step gesture.
Hence, we also need to reset it when restoring it back.
Bug: 184914153
Test: atest RecenteAnimationControlerTest
Change-Id: I331a2992c1b965503f714683f8be56d473e03434
Use this test api to make sure testing
KeyboardVisibilityControlTest#testRestoreImeVisibility_.* that
requires the system supporting TaskSnapshot mechanism, otherwise skip
the test when the system doesn't support it.
Bug: 184978234
Test: m checkapi & atest KeyboardVisibilityControlTest
Change-Id: I777053aeeb6a2734a4bbd37711cf56ced41c1bd9
- Pass TaskSnapshot to Shell directly.
- Parallel process: create a splash screen worker thread to create the
splash screen view and pre-draw the icon drawable, and use splash
screen thread to do stuff about window's lifecycle like add/remove
window. We don't use shell main thread here so the starting window
won't blocking any task execute on main thread.
- Trigger addStartingWindow directly when startActivity, also
removeStartingWindow directly without post the animation thread.
- Do not defer addStartingWindow for prepare surface, on the contrast
it should be execute before prepare surface.
- Remove ActivityRecordTests#testAddRemoveRace, it wasn't been test as
expected because in original logic the add and remove starting window
are post to animation thread, so the test was actually testing on
handler#postAtFrontOfQueue and handler#removeCallbacks.
For now it will only cause OutOfMemoryError.
Bug: 183665220
Bug: 182836977
Test: atest StartingSurfaceDrawerTests SplashscreenTests
Change-Id: Ie9a529c7d81f07f923394eb69944518f3e9010ce