Commit Graph

4994 Commits

Author SHA1 Message Date
Anton Hansson
980590a6fa Fix product_services apps getting PRODUCT scanFlags.
Make all comparisons using startsWith for partition checks more
robust by appending a forward flash.

Also add a test.

Bug: 80741439
Test: atest FrameworksServicesTests:PackageManagerServiceTest
Change-Id: Ibe085d0edec44bf8b49f313209f9aec22b70aec1
2018-08-23 13:41:36 +01:00
TreeHugger Robot
3c98e02d43 Merge changes Ied0d0a83,Id649a1ed
* changes:
  Add ability to pass user sentiment to assistant
  Add AndroidTest file for ExtServices
2018-08-21 22:00:50 +00:00
Adrian Roos
031546664b Merge "Cutout: Add developer setting to mask the display cutout" into pi-dev am: c05c2d1e48
am: 6a403d8d5b

Change-Id: Ifc872c48e4670183f1f0fd3a4162d1eeb6c5c5e4
2018-08-21 13:38:33 -07:00
Adrian Roos
6a403d8d5b Merge "Cutout: Add developer setting to mask the display cutout" into pi-dev
am: c05c2d1e48

Change-Id: I728ce64b53d02f5a75f04071a04f5e6d0f61987c
2018-08-21 13:11:53 -07:00
Adrian Roos
c05c2d1e48 Merge "Cutout: Add developer setting to mask the display cutout" into pi-dev 2018-08-21 19:51:58 +00:00
Adrian Roos
8c28c7c2d9 Cutout: Add developer setting to mask the display cutout
Adds an option to mask the cutout by effectively shrinking the logical display
such that developers can test apps as if the device did not have a notch.

Bug: 112876936
Test: Go to Settings > Developer Options > Simulate display with cutout > "No cutout". Cutout should be hidden. Rotate screen, take screenshots, screenrecord, screen off animation should all work as expected.
Change-Id: I5cdb201734d238bf3785ab55843114e4b5b4ee41
2018-08-21 21:47:51 +02:00
Julia Reynolds
fd4099d74f Add ability to pass user sentiment to assistant
Test: runtest systemui-notification
Bug: 4798501
Change-Id: Ied0d0a83c4fbbdde59ee8f4e9394161792c42c03
2018-08-21 12:58:30 -04:00
Vishnu Nair
7f9c16cd7a WM: Fix flaky DragDropControllerTests tests
Stub Mockito spies using doReturn instead of when/then syntax. Using when/then
syntax on a spied object will call the actual implementation which is probably not
what we want for a stubbed function. Test failures suggest this or wrongly written
multi-threaded tests may be the root cause.

See: https://sponge.corp.google.com/target?id=aefd8278-1d23-458c-ab4c-56b19f24d745&target=com.android.frameworks.servicestests&searchFor=&show=FAILED&sortBy=STATUS

Test: FrameworksServicesTests:com.android.server.wm.DragDropControllerTests
Change-Id: Ib882f8d8602b848312631e69555a0316b9219b26
2018-08-21 01:09:25 +00:00
Beverly
6c60b90dd9 Don't show dnd upgrade dialog if user updated dnd
- If the user has already updated whether DND should
block notifications or not, the dnd upgrade dialog should
never appear

Change-Id: Icd3ab7568caf17d8d6c92de605b879e785e365c8
Fixes: 112584967
Test: ZenModeHelperTest, manual
2018-08-17 16:45:39 -04:00
TreeHugger Robot
80a2b7091f Merge "Ensure zen SystemConditions are subscribed" 2018-08-17 13:17:01 +00:00
Michael Groover
220c0a434a Merge "Resolve NPE and unexpected error code in AccountManagerServiceTest" am: 6078bc1602
am: 47ea1e53f3

Change-Id: I39e0644a56a747f4b570b643016cacdc6e250dfc
2018-08-17 01:50:05 -07:00
Michael Groover
47ea1e53f3 Merge "Resolve NPE and unexpected error code in AccountManagerServiceTest"
am: 6078bc1602

Change-Id: I5e9046068f71be3afc18587ae6afa46ff03f12d7
2018-08-17 01:40:51 -07:00
Kazuki Takise
0a83cf2c4b Merge "Resolve race condition in TaskStackChangedListenerTest" 2018-08-17 05:55:05 +00:00
Treehugger Robot
6078bc1602 Merge "Resolve NPE and unexpected error code in AccountManagerServiceTest" 2018-08-16 18:25:56 +00:00
Michael Groover
ccf15f79f0 Resolve NPE and unexpected error code in AccountManagerServiceTest
ag/3915086 modified AccountManagerService to use the PackageManagerInternal returned from
LocalServices. However when AccountManagerServiceTest runs tests against AccountManagerService
it is using a local instance of the object which does not have access to system's local
PackageManagerInternal. To resolve this a mock PackageManagerInternal is added to the LocalServices
with a mocked hasSignatureCapability that returns an appropriate response based on the test. This
fix also exposed an issue that appears to be introduced by ag/2959363; with the change in
checkKeyIntent to no longer throw a SecurityException the expected return code for error paths
is now AccountManager.ERROR_CODE_REMOTE_EXCEPTION.

A small change was also added to AccountsDbTest to skip testCeNotAvailableInitially on eng builds
as the Log.wtf would crash the test process when invoked on eng builds.

Test: adb shell am instrument -w -e package com.android.server.accounts \
      com.android.frameworks.servicestests/\
      android.support.test.runner.AndroidJUnitRunner
Bug: 80380639

Change-Id: I9438550d1c19cc86ec56991da766d71e068784ab
Merged-In: I9438550d1c19cc86ec56991da766d71e068784ab
2018-08-16 17:59:45 +00:00
TreeHugger Robot
dee54a448b Merge "Resolve NPE and unexpected error code in AccountManagerServiceTest" 2018-08-16 17:50:13 +00:00
Brad Stenning
1e14f9f92a Bypass Zenmode filtering when the notification is marked as critical
Test: enable dnd and use test app to send Car_emergency
Bug: 111793232
Change-Id: I6492c1e48429c5f199680c76d53248da8072f4ff
2018-08-16 13:51:57 +00:00
Steven Moreland
03ebe02009 Merge "Simplify IWeaver mocking code." am: d5dc5a7168 am: a64d04f5fe
am: db8351b2cd

Change-Id: I0f777ca9d737255f388594a228e1b9cf2cb5ca88
2018-08-16 04:17:26 -07:00
Steven Moreland
db8351b2cd Merge "Simplify IWeaver mocking code." am: d5dc5a7168
am: a64d04f5fe

Change-Id: I72b1e82c8bbb9cd68264d102cc268c51da1a645f
2018-08-16 03:35:46 -07:00
Kazuki Takise
9a0be7278a Resolve race condition in TaskStackChangedListenerTest
This CL makes sure that the start-up process of an activity has
completed and ActivityStack#mResumedActivity is set as the activity
before removing the activity in TaskStackChangedListenerTest.
Otherwise, onTaskRemovalStarted, which is a callback expected to be
called in TaskStackChangedListenerTest is not called because of the
following logic in ActivityStack#finishActivityLocked().

if (mResumedActivity == r) {
    mService.getTaskChangeNotificationController().notifyTaskRemovalStarted(task.taskId);
}

Currently, whether mResumeActivity is set before removing the
activity is not guaranteed, which causes flakiness in some
environments such as ARC. (it's 50/50 whether it's set properly or
not. ) This CL guarantees this and make the tests pass all the time.

Bug: 110908055
Test: atest TaskStackChangedListenerTest
Change-Id: Ieb9f2ffe40de4e79ef2bf43c4036625ce0b63304
2018-08-16 18:14:26 +09:00
Beverly Tai
efc0ac8e3d Merge "DO NOT MERGE: Ensure zen SystemConditions are subscribed" into pi-dev
am: 6b188c070e

Change-Id: Ie33e07277cef28558f8213cee8b01a9082f46d23
2018-08-15 18:48:15 -07:00
TreeHugger Robot
ace398c3fb Merge "Migrate frameworks/base/services/tests/servicestests to androidx.test" 2018-08-15 20:56:10 +00:00
Steven Moreland
a64d04f5fe Merge "Simplify IWeaver mocking code."
am: d5dc5a7168

Change-Id: Ic5c39741a218806b127b26870b796fc204dc639a
2018-08-15 13:04:40 -07:00
Riddle Hsu
c80cac6c67 Merge "Get gravity of menu panel by display" 2018-08-15 14:27:10 +00:00
Riddle Hsu
a4d6fa229c Get gravity of menu panel by display
Also:
 - Reorganize import of DisplayContent and PhoneWindow.
 - Fix DisplayContent leakage in wm test.
   (SurfaceFlinger abort in createLayer -> addClientLayer with
    "Suspected IGBP leak: 4097 IGBPs (4096 max)")

Bug: b/111362047
Test: atest FrameworksServicesTests:DisplayContentTests# \
      testGetPreferredOptionsPanelGravityFromDifferentDisplays

Change-Id: I9c5a0f59a86fda08bd532cb2b66bab76b2dfa6c8
2018-08-15 20:51:57 +08:00
Michael Groover
c76ea60085 Resolve NPE and unexpected error code in AccountManagerServiceTest
ag/3915086 modified AccountManagerService to use the PackageManagerInternal returned from
LocalServices. However when AccountManagerServiceTest runs tests against AccountManagerService
it is using a local instance of the object which does not have access to system's local
PackageManagerInternal. To resolve this a mock PackageManagerInternal is added to the LocalServices
with a mocked hasSignatureCapability that returns an appropriate response based on the test. This
fix also exposed an issue that appears to be introduced by ag/2959363; with the change in
checkKeyIntent to no longer throw a SecurityException the expected return code for error paths
is now AccountManager.ERROR_CODE_REMOTE_EXCEPTION.

A small change was also added to AccountsDbTest to skip testCeNotAvailableInitially on eng builds
as the Log.wtf would crash the test process when invoked on eng builds.

Test: adb shell am instrument -w -e package com.android.server.accounts \
      com.android.frameworks.servicestests/\
      android.support.test.runner.AndroidJUnitRunner
Bug: 80380639

Change-Id: I9438550d1c19cc86ec56991da766d71e068784ab
2018-08-14 16:39:47 -07:00
Dan Shi
38539523e4 Migrate frameworks/base/services/tests/servicestests to androidx.test
See go/jetpack-test-android-migration

Bug: 111443449
Test: atest ArcTerminationActionFromAvrTest
atest AppWindowTokenAnimationTests

Change-Id: Ifad50690c9df9da5661bd04414625f9ed223d9f2
2018-08-14 14:48:51 -07:00
Jeff Sharkey
9b191c2415 Merge "Methods to translate sandbox paths." 2018-08-14 21:39:15 +00:00
TreeHugger Robot
726ab98716 Merge "Override old alarms in zen schedule" 2018-08-14 21:22:49 +00:00
TreeHugger Robot
ffc6c357ba Merge "Don't use creationTime for ZenRule equality" 2018-08-14 19:29:54 +00:00
Beverly
4e76191a9f Override old alarms in zen schedule
Change-Id: I371a586d470e3e341a42fb5ae3b8f32929214c18
Fixes: 112493468
Test: ScheduleCalendarTest
2018-08-14 15:03:26 -04:00
Beverly
277a5dc624 DO NOT MERGE: Ensure zen SystemConditions are subscribed
Test: ZenModeHelperTest
Bug: 112500368
Change-Id: I5ac4edcee5a6dc7c4877aa147016c09e53a0b033
2018-08-14 18:41:35 +00:00
Steven Moreland
54ea922d1a Simplify IWeaver mocking code.
Implementations of HIDL interfaces are intended to extend
from the Stub class, not the core interface class.

Test: m FrameworksServicesTests
Test: frameworks/base/services/tests/runtests.py -e package "com.android.server.locksettings"
OK (454 tests)

Bug: 112334405

Change-Id: Ib060560fd74f0092544096210f52e1f7fcba6c06
2018-08-14 18:10:43 +00:00
Jeff Sharkey
5790af08f8 Methods to translate sandbox paths.
System components (like MediaProvider) will live in a mount namespace
that has a view of the "real" shared storage device, and normal apps
will have "sandboxed" views of the shared storage device.  (Parallel
changes are implementing these namespaces in vold and installd.)

The system components mentioned above will need to translate between
the two namespaces, so this change introduces methods that perform
that translation, along with a nice batch of tests to verify.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/StorageManagerServiceTest.java
Bug: 111893193, 111892833, 111268862
Change-Id: Iae91a44ce09eb33d6cd9b90f6c7b4f88c8cd12f0
2018-08-14 10:56:43 -06:00
Beverly
2f43b64a4a Ensure zen SystemConditions are subscribed
Test: ZenModeHelperTest
Bug: 112500368
Change-Id: I5ac4edcee5a6dc7c4877aa147016c09e53a0b033
2018-08-14 12:53:37 -04:00
TreeHugger Robot
9d1e5cd266 Merge "Migrate frameworks/base/services/tests/servicestests to androidx.test" 2018-08-13 23:17:25 +00:00
TreeHugger Robot
32a8335c5f Merge "Prevent reiterating over same stack tasks when calculating running tasks" 2018-08-13 19:57:52 +00:00
Beverly
aa5ca96298 Don't use creationTime for ZenRule equality
- onRestore, the ZEN_MODE_CONFIG_ETAG shouldn't change
even though creationTime for zen automatic rules are updated

Test: ZenModeHelperTest.java
Change-Id: If241143f6759553b3297e5d7f12e3a3caddbd17d
Fixes: 111415419
2018-08-13 15:28:25 -04:00
Julia Reynolds
196a2956b2 Merge "The quietening round 2 part 1" 2018-08-13 18:43:57 +00:00
TreeHugger Robot
65380d6d4b Merge "Fixed gamma correction test." 2018-08-13 12:52:24 +00:00
Brett Chabot
a26eda941f Migrate frameworks/base/services/tests/servicestests to androidx.test
See go/jetpack-test-android-migration

cherrypicked from ag/4608401

Test: atest FrameworksServicesTests
Change-Id: I2d9641c681489135aa3167bb4c9b1296a1a6a4f7
2018-08-10 14:04:11 -07:00
Julia Reynolds
efcdff4528 The quietening round 2 part 1
Allow the notification assistant to block or silence
incoming notifications, or demote notifications after they
are posted

Also temporarily silence everything by default

Plus: bonus refactoring of the cancel notification runnable so I could
write just one of those tests :)

Bug: 111475013
Test: manual, runtest systemui-notification
Change-Id: Ifa04a21919f60d06080cd63e7d7747180b641308
2018-08-10 15:47:54 -04:00
Winson Chung
d21996045d Prevent reiterating over same stack tasks when calculating running tasks
- Clear the stack task list before each fetch and don't re-add all of them.
  There is no functional change since the tasks are added to the same set
  which will dedupe them.

Bug: 112467578
Test: atest FrameworksServicesTests:RunningTasksTest
Change-Id: I9c65771429b30d8e1d357843235b1a6deebfd402
2018-08-10 10:54:24 -07:00
Brad Stenning
9a8b2c83c6 Add the ability to force car emergency and car warning notifications to the top
This changes the global sort string such these notifications can bypass all others

Design doc linked in the bug

Bug:111793232
Test: unit tests added
Change-Id: If47019ecf79f71caba6f4984d4cc745fd0d40da0
2018-08-10 16:42:52 +00:00
Michal Karpinski
6166874b93 Merge "DO NOT MERGE Log various information about non-foreground activity starts" into pi-dev
am: dfba41947b

Change-Id: I18f630182b169c5ef48f8f084884894813c34f0f
2018-08-10 01:51:41 -07:00
Michal Karpinski
3eab951217 DO NOT MERGE Log various information about non-foreground activity starts
Logging activity starts to TRON, but only if the caller app
doesn't have any foreground activity present.

Example event:
08-03 15:21:30.813  1231  3220 I sysui_multi_action: [757,1513,758,4,805,1533306090812,1514,10147,1515,com.google.android.talk,1516,1018,1517,0,1518,1000,1519,1000,1520,0,1521,10147,1522,com.google.android.talk,1523,1018,1524,0,1525,pendingintent:u0a12:com.google.android.talk/com.google.android.apps.hangouts.phone.ConversationActivity,1526,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1527,1,1528,com.google.android.apps.hangouts.phone.conversationlist,1540,1,1541,com.google.android.apps.hangouts.phone.BabelHomeActivity,1542,3146240,1543,{com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity},1544,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1545,com.google.android.talk,1546,1,1547,0,1551,0,1552,0]

(cherry-picked from 201bc0c14e)

Bug: b/111866309
Context: go/activity-starts-logging-tron
Test: 1) enable logging with: adb shell settings put global activity_starts_logging_enabled 1
      2) open some activities and observe: adb logcat -b events | grep "sysui_multi_action: \[757,1513"
Test: atest FrameworksServicesTests:ActivityStarterTests

Change-Id: Ie7dee51c574e544d12e83d279afda46b336f2013
2018-08-09 15:18:07 +01:00
Michal Karpinski
201bc0c14e Log various information about non-foreground activity starts
Logging activity starts to TRON, but only if the caller app
doesn't have any foreground activity present.

Example event:
08-03 15:21:30.813  1231  3220 I sysui_multi_action: [757,1513,758,4,805,1533306090812,1514,10147,1515,com.google.android.talk,1516,1018,1517,0,1518,1000,1519,1000,1520,0,1521,10147,1522,com.google.android.talk,1523,1018,1524,0,1525,pendingintent:u0a12:com.google.android.talk/com.google.android.apps.hangouts.phone.ConversationActivity,1526,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1527,1,1528,com.google.android.apps.hangouts.phone.conversationlist,1540,1,1541,com.google.android.apps.hangouts.phone.BabelHomeActivity,1542,3146240,1543,{com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity},1544,com.google.android.talk/com.google.android.apps.hangouts.phone.BabelHomeActivity,1545,com.google.android.talk,1546,1,1547,0,1551,0,1552,0]

Bug: b/111866309
Context: go/activity-starts-logging-tron
Test: 1) enable logging with: adb shell settings put global activity_starts_logging_enabled 1
      2) open some activities and observe: adb logcat -b events | grep "sysui_multi_action: \[757,1513"
Test: atest FrameworksServicesTests:ActivityStarterTests
Change-Id: Id63806a2d08a50f404268194a05c6e94bd7e9724
2018-08-08 14:55:05 +01:00
TreeHugger Robot
c0819d2066 Merge "Add an optional reason field to vibrator service" 2018-08-07 19:42:58 +00:00
Jackal Guo
9e795d828a Merge "Magnification isn't reset when service is disabled" 2018-08-03 01:23:38 +00:00
TreeHugger Robot
c8280ca86a Merge "Bootstrap freeform external displays." 2018-08-02 21:16:56 +00:00