Commit Graph

5346 Commits

Author SHA1 Message Date
TreeHugger Robot
7d60ed910f Merge "Fix home can not be started while instrumenting" 2018-11-09 01:05:38 +00:00
TreeHugger Robot
0c142dddaa Merge "Informing app idle listeners on enabled state changes." 2018-11-09 00:21:50 +00:00
Kweku Adams
1e8947c5da Informing app idle listeners on enabled state changes.
Currently, if AppStandbyController is enabled after some listeners have
already registered, the listeners will be told that the system is in a
state of parole even though AppStandbyController thinks it's not in
parole. This change informs AppIdleStateChangeListeners when
AppStandbyController's enabled state changes as well so that they can be
in the correct state.

I also removed the call to setAppIdleEnabled() in onBootPhase() since
updateSettings() is called right afterwards and that also calls
setAppIdleEnabled().

Bug: 112329453
Test: atest AppStandbyControllerTests
also check logs to confirm that NetworkPolicyManagerService and
JobSchedulerService's listeners switch from ON to OFF when the system is
ready.

Change-Id: I88bc293c70b459f54f75f92126ad306d6ab8d9b7
2018-11-08 13:58:50 -08:00
Philip P. Moltmann
17f65afe3b Split permissions inherit state from their parents
The old hack to grant permissions on upgrade was removed. The new code
applies to
- platfrom upgrade
- initial package installation
- package update

Inheriting the grant state is the default behavior for split permissions.
Special cases will be added later.

Also make sure to revoke the permission once the app declares that it is
aware of the permission.

Test: atest CtsPermissionTestCases:SplitPermissionTest
Change-Id: Ie51971530607f0b585cf7a3e11b01b11a28e1de9
2018-11-08 09:32:01 -08:00
Wale Ogunwale
355ea855f6 Merge "Unify Activities and Windows under one lock (38/n)" 2018-11-08 14:48:43 +00:00
TreeHugger Robot
3cbf07268f Merge "Fix lost intent extra when starting activity from recents" 2018-11-08 10:10:00 +00:00
TreeHugger Robot
42617d031a Merge "Fix unable to cleanup a removed display" 2018-11-08 05:29:23 +00:00
Riddle Hsu
2f9acd22ce Fix lost intent extra when starting activity from recents
Always create a copy for task info to avoid the original intent
being modified.

Bug: 119052114
Test: atest TaskRecordTests#testCopyBaseIntentForTaskInfo
Change-Id: Ib27bc52c436f3e8b379b4374dc9d5b6031fa0316
2018-11-08 12:28:01 +08:00
Louis Chang
dd3592afdc Fix home can not be started while instrumenting
We don't want to automatically start home activities while
the home app is being instrumented because it prevents home
activities unexpectedly resumed during testing.

We should still allow launching home activities if requested
(e.g. starting home activity when home key pressed).

Bug: 118891218
Test: atest TaplTests
Test: atest ActivityStackSupervisorTests
Test: atest ActivityManagerMultiDisplayTests

Change-Id: Ia362f875d38748a3dea40b5788a4d86bcc68392c
2018-11-08 11:50:15 +08:00
Evan Rosky
38e1cb73f5 Merge changes from topic "wm_move_disp_to_hier_2"
* changes:
  Move some display logic into hierarchy [2/2]
  Move some display logic into hierarchy [1/2]
2018-11-08 01:15:27 +00:00
TreeHugger Robot
28c413eb32 Merge "Fix FrameworksServicesTests:StorageManagerServiceTest" 2018-11-08 01:04:08 +00:00
TreeHugger Robot
608f8f93c5 Merge "Revert "Temporarily disable ZenModeFiltering tests"" 2018-11-07 18:24:14 +00:00
Wale Ogunwale
2411619660 Fix pre-submit failure due to cast error.
Not sure how this ever passed...

Bug: 113800711
Test: atest WmTests:ActivityStackTests
Change-Id: Ic08609436b480c0e3f493e2790398344d3122031
2018-11-07 07:46:56 -08:00
Wale Ogunwale
1f5e53d4a6 Unify Activities and Windows under one lock (38/n)
Final step before we actually start unifing the hierarchy is to have
activity and window manager under one lock. This CL makes it so.
Note, that there are probably areas where this change might lead to dealock
however we can fix those areas as we discover them.

Test: Existing tests pass
Bug: 80414790
Change-Id: Ie4b71d4ceb986256482031a99065b8d2ef60ebe8
2018-11-07 07:09:35 -08:00
Beverly Tai
fdae52974a Revert "Temporarily disable ZenModeFiltering tests"
This reverts commit c85c9c5748.

Reason for revert: Breakage should be fixed in ag/5457346

Change-Id: I1117bc81999022e147926f61d371bceec8d7a174
2018-11-07 14:15:10 +00:00
TreeHugger Robot
b2117bbc3a Merge "Fix unable finish booting when display added before boot" 2018-11-07 09:16:45 +00:00
Evan Rosky
e747c3e4e1 Move some display logic into hierarchy [2/2]
Move display update logic from WM into ATM hierarchy by letting
ActivityStack watch for relevant changes and calculate bounds
accordingly and removing configuration updates from WM side
outside of calls from the display-level controller (like how
the other levels work).

One of the main display-changes to account for is rotation. To
make this work without drastically modifying things was to leave
display freeze/startSeamless in WM but move the actual rotation
to ATM while handling SEND_NEW_CONFIGURATION. This prevents
changes to the wm-side hierarchy outside of ATMS's control.

To facilitate this extra communication between ATMS and WM,
this adds rotation into WindowConfiguration. This makes rotation
available to the hierarchy update for policies that care about it
(things like split). It will also replace TaskStack's mRotation
in an upcoming CL and should also let us remove the one-off
variable for landscape->seascape orientation changes (needs
some more research though).

Bug: 113900640
Test: go/wm-smoke + relevant am/wm servicestests
Change-Id: I12c79cc5eb94d48d846f1cf27765c9f9f6741435
2018-11-06 18:39:37 -08:00
TreeHugger Robot
c526bdf8ab Merge changes Ie8685a12,I87abde9f
* changes:
  am: Add unit tests for ActivityMetricsLaunchObserver
  am: Add new LaunchObserver to track app launch sequences
2018-11-07 02:00:25 +00:00
Alex Light
dfe6c07b96 Merge "Correct illegal mockito usage." am: 5bb1e8c9bc am: 7901714521
am: 756d5ae29a

Change-Id: Ibae90ae05b36129a34a358bb60ffd7ad23e3c4a4
2018-11-06 16:11:53 -08:00
Igor Murashkin
cb76aac913 am: Add unit tests for ActivityMetricsLaunchObserver
Add mockito-based behavioral unit tests for the LaunchObserver.
Verify each state transition.

Test: atest WmTests:ActivityMetricsLaunchObserverTests
Bug: 72170747
Bug: 112680320
Change-Id: Ie8685a1262ccc7730aa5c574274f7ad0caeeedef
2018-11-06 16:03:38 -08:00
Alex Light
756d5ae29a Merge "Correct illegal mockito usage." am: 5bb1e8c9bc
am: 7901714521

Change-Id: I2eb72a34d8fa13514ad8946937972a725638711c
2018-11-06 15:54:40 -08:00
Alex Light
84faaf8ec6 Correct illegal mockito usage.
According to the mockito FAQ use of thenReturn(mock(...)) is
forbidden. This fixes that pattern in the setup for
ZenModeFilteringTest.

https://github.com/mockito/mockito/wiki/FAQ#can-i-thenreturn-an-inlined-mock-

Test: runtest systemui-notification
Bug: 119063276
Change-Id: Ic62b18063e5837240255e1dd0f5e0feb450f22cb
2018-11-06 14:15:54 -08:00
Beverly
c85c9c5748 Temporarily disable ZenModeFiltering tests
failing on cloud devices
Bug: 119063276
Bug: 119100256
Test: atest ZenModeFilteringTest
Change-Id: I5dcab2bfb0fd3be31e1fc9ab2706ed558c5968fb
2018-11-06 14:15:49 -05:00
Brett Chabot
ec6bcbceee Fix FrameworksServicesTests:StorageManagerServiceTest
Use androidx.test not android.support.test.
And remove android.support.test from build by removing unnecessary
frameworks-base-testutils > android.support.test dependency

Bug: 117990406
Test: m checkbuild; atest FrameworksServicesTests:StorageManagerServiceTest
Change-Id: Ia825e0926b46855f9056739441cb21a065692076
2018-11-06 10:48:19 -08:00
Tadashi G. Takaoka
e2e5daf291 Merge "Fix missing showWhenLocked activity attribute" am: f1e9db0cbe
am: cfbbe2d89d

Change-Id: I93f86f0da6a557065a83044fcd77eb31eda8ce29
2018-11-06 09:20:41 -08:00
Tadashi G. Takaoka
f1e9db0cbe Merge "Fix missing showWhenLocked activity attribute" 2018-11-06 16:57:36 +00:00
Nicolas Geoffray
c6c856912b Merge "Make shared library dependencies explicit in SharedLibraryInfo" 2018-11-06 13:58:01 +00:00
Tadashi G. Takaoka
93d923a298 Merge "Fix missing showWhenLocked activity attribute" 2018-11-06 13:42:26 +00:00
Riddle Hsu
402b440f32 Fix unable to cleanup a removed display
Assume a display supports system decoration and allows reparenting
stacks to another display when the display is removed. If there
exists a standard type finishing activity during removing the
display, the activity will be reparented and found the original
stack is empty, then home is started again on the removed display.

This change combines the condition ActivityDisplay.mRemoved into
ActivityStack.isAttached, and defers the resume during finishing
or reparenting, so the stacks in the removing display won't be
focusable and resumed.

Also keep original z-order of the reparented stacks and reduce
unnecessary resume, visibility update for each reparented stack.

Bug: 119093839
Test: atest ActivityDisplayTests#testNotResumeHomeStackOnRemovingDisplay

Change-Id: I7dea2582ce8bd4aa4a18e1d5d721bfb1d9027c6a
2018-11-06 13:40:36 +00:00
Alan Stokes
85d47fd962 Merge "Stop recording unsupported class loaders." am: c90f30d1d9 am: ad370ddf38
am: e9b09f2bc8

Change-Id: I2dfe1829fd900e48242089625e296566625d5378
2018-11-06 01:40:13 -08:00
Alan Stokes
e9b09f2bc8 Merge "Stop recording unsupported class loaders." am: c90f30d1d9
am: ad370ddf38

Change-Id: I10a8de9283a9af4870fba6e36b01bbe771c6686a
2018-11-06 01:29:48 -08:00
Louis Chang
1eff248081 Fix unable finish booting when display added before boot
We started home activity before system ready because overlay
display was added. It accidentally updated the AM state to booted
without actually finishing booting procedure. The booting procedure
was unable to complete afterward.

Do not start home activity before system booting.

Bug: 118796241
Test: atest ActivityStackSupervisorTests

Change-Id: I4e4a38b742529fc7ba6163c1a05137c68faf83e7
2018-11-06 16:30:17 +08:00
Tadashi G. Takaoka
0b590e6ab9 Fix missing showWhenLocked activity attribute
This attribute will stabilize ScreenDecorWindowTests since this test
needs activity is shown even on locked device.

Fixes: 119041502
Bug: 119037340
Test: On sleeping DUT.
  atest FrameworksServicesTests:com.android.server.wm.ScreenDecorWindowTests
Change-Id: I98ef00ba32c792c396f3abba447dd20628902492
Merged-In: I8fc2683ad65e627c4e002b767fd23a4dd9f16223
2018-11-06 13:40:49 +09:00
Tadashi G. Takaoka
aaa15aebcc Fix missing showWhenLocked activity attribute
This is a follow up of I28076aad00.  Moving tests to other package
accidentally missed an important Activity attribute.

Bug: 113800711
Fixes: 119037340
Test: atest WmTests:com.android.server.wm.ScreenDecorWindowTests on
  sleeping device.
Change-Id: I8fc2683ad65e627c4e002b767fd23a4dd9f16223
2018-11-05 18:31:13 -08:00
Nicolas Geoffray
10b0779df8 Make shared library dependencies explicit in SharedLibraryInfo
bug: 112405321
Test: boots, PackageParserTest
Change-Id: I591c29f72ad95b2a8adb4a2242f1e764e0e29007
2018-11-06 00:32:34 +00:00
Tadashi G. Takaoka
b6e148cd8e Fix error prone build of WM tests in FrameworksServicesTests
An erroprone build is usually triggered by Presubmit-Ready and built by
TreeHugger. You may see some failures in Presubmit Build Status of the
Gerrit. The error messages contains nice explanations and the links to how
to fix these.

Bug: 113800711
Test: Trigger Presubmit-Ready in TreeHugger and see errorprone build
  successfully.
Test: Pass all WM presubmit tests in FrameworksServicesTests and WmTests
  $ tradefed.sh run commandAndExit FrameworksServicesTests \
      --include-filter com.android.server.wm. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
  $ tradefed.sh run commandAndExit WmTests \
      --include-filter com.android.server.wm. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Change-Id: I06c8162d4196346c4e90557e75f29088f5917284
2018-11-05 14:42:35 -08:00
Beverly Tai
fe0efe6bd2 Merge "Only update zen rule name on locale change" 2018-11-05 18:58:39 +00:00
Alan Stokes
6dba50d633 Stop recording unsupported class loaders.
Don't record anything if any of the classloaders in the chain are
unsupported.  (This is slightly unsubtle, but matchs the existing
behavior - see below.) We can't correctly DexOpt secondary dex files
in this case anyway.

Also discard any existing records of unsupported classloaders on read.

Currently this is almost a no-op: BaseDexClassLoader doesn't notify if
there are any unknown class loaders, since
5ac512c07cfa80160e240c359349c1390a20a981, so the new check is
reachable only if there's some sort of mismatch. But I'm going to
change that soon.

Tightened up visibility a bit too.

Bug: 111336847
Test: atest --test-mapping services/core/java/com/android/server/pm/dex
Change-Id: I6af5620a73be7b6440cbafdf6a5c1da1082cbdd4
2018-11-05 11:13:46 +00:00
Junyu Lai
e914f1e453 Merge "Extend onDnsEvent callback to report more fields." am: 89eb3e6117 am: 7a782be65d
am: 556ae82025

Change-Id: I50ef791009b0e9301ba10d8e52c3fd6c15e6b938
2018-11-04 21:05:47 -08:00
Junyu Lai
556ae82025 Merge "Extend onDnsEvent callback to report more fields." am: 89eb3e6117
am: 7a782be65d

Change-Id: Ic1b35f2b02dc60e301d39e89008617b341194382
2018-11-04 20:54:14 -08:00
Junyu Lai
89eb3e6117 Merge "Extend onDnsEvent callback to report more fields." 2018-11-05 04:29:47 +00:00
Wale Ogunwale
595070969d Moved Activity management out of ActivityManager to WindowManager (37/n)
What could go wrong ;)

Note that ATMS and all other activity management files are still under
the AMS lock. We will be changing them soon to use the WMS lock, but
till then it is important to take care not to use the WMS lock for
activities stuff and AMS lock for window stuff.

Test: Existing tests pass
Bug: 80414790
Change-Id: I69f5a6e40ad892557a425e1f34be987507102136
2018-11-03 23:23:06 -07:00
TreeHugger Robot
8be8936abb Merge "Move some AM tests back to FrameworksServicesTests" 2018-11-04 04:06:24 +00:00
Tadashi G. Takaoka
d3eb645ce7 Move some AM tests back to FrameworksServicesTests
The following com.android.server.am tests has been moved to WmTests by
Idc2dc9e80d, but those should be moved back to FrameworksServicesTests.
 - ActivityManagerServiceTest
 - ActivityManagerTest
 - ActivityManagerInternalTest
 - AppErrorDialogTest
 - BroadcastRecordTest
 - CoreSettingsObserverTest
 - GlobalSettingsToPropertiesMapperTest
 - MemoryStatUtilTest
 - UserControllerTest

Bug: 113800711
Test: Pass all AM presubmit tests in FrameworksServicesTests
  $ tradefed.sh run commandAndExit FrameworksServicesTests \
      --include-filter com.android.server.am. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest

Change-Id: I8852d1a26d7e9d9e52a06fb8ed90d15b6f40bf1c
2018-11-03 19:13:28 -07:00
Wale Ogunwale
db485dec8b Don't use WMS.mWindowMap to synchronize WM critical section (36/n)
Use new field WMS.mGlobalLock instead. This will make it easier to
switch the lock to the same object used by ActivityTaskManagerService
in an upcoming CL.

Test: Existing tests pass
Bug: 80414790
Change-Id: I4202e9028395d79cc60b01ed795528b469a16bf1
2018-11-04 01:26:51 +00:00
Tadashi G. Takaoka
1f19960bd4 Mark UserControllerTest.testStartUser_background as @FlakyTest
Bug: 118932054
Test: Pass all AM tests in WmTests
  $ tradefed.sh run commandAndExit WmTests \
      --include-filter com.android.server.am. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest

Change-Id: I4fab1b08cc5061a2e107292e5d9bd6e2a6a121e5
2018-11-03 10:36:13 -07:00
Brett Chabot
8d5e64d94e Merge "Replace use of deprecated androidx-test build rule." am: d3efd1ad0c
am: a16d173fc7

Change-Id: If11f4288ac60c6284a3f0510061183b2418d8d11
2018-11-02 22:22:40 -07:00
Tadashi G. Takaoka
a65212d4fa Move simple WindowManager tests to WmTests
Bug: 113800711
Test: Pass all WM presubmit tests in WmTests
  $ tradefed.sh run commandAndExit WmTests \
      --include-filter com.android.server.wm. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Change-Id: I28076aad00b0fe4b4d35552677436e0f3e37eafe
2018-11-02 21:45:54 -07:00
Tadashi G. Takaoka
56682c2be6 Move PhoneWindowManager tests to WmTests
Bug: 113800711
Test: Pass all PhoneWindowManager presubmit tests in WmTests
  $ tradefed.sh run commandAndExit WmTests \
      --include-filter com.android.server.policy. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Change-Id: I806acaa9c62af4849bb5872f5821ee69600412a5
2018-11-02 21:45:54 -07:00
Tadashi G. Takaoka
74ccec25d5 Move ActivityManager tests to WmTests
Bug: 113800711
Test: Pass all AM presubmit tests in WmTests
  $ tradefed.sh run commandAndExit WmTests \
      --include-filter com.android.server.am. \
      --include-annotation android.platform.test.annotations.Presubmit \
      --exclude-annotation androidx.test.filters.FlakyTest
Change-Id: Idc2dc9e80d95cfe8490ddef94aeca9a5202aad91
2018-11-02 17:56:19 -07:00