Commit Graph

14026 Commits

Author SHA1 Message Date
TreeHugger Robot
11eedb6379 Merge "Fix various crashes from a destroy-timeout activity" 2018-07-31 06:50:33 +00:00
Riddle Hsu
66b74a82e5 Fix various crashes from a destroy-timeout activity
This prevents below 3 cases that caused by using the
removed token to server side:

Block at | From method              | Exception
-----------------------------------------------------
onCreate | reportSizeConfigurations | IllegalArgument
onStart  | isTopOfTask              | IllegalArgument
onResume | addView                  | BadToken

Bug: 109718716
Test: atest CtsActivityManagerDeviceTestCases:ActivityLifecycleTests
Test: Sample app in bug link.
Change-Id: I123a048c36f7ddbca0d5b1bf8060c3a4dd13a903
2018-07-30 17:04:43 +08:00
Lucas Dupin
8f09a5057e Expose Ambient Wallpaper API
In P we introduced a private concept of AOD wallpapers, in Q
we're making it a public surface.

Bug: 111395593
Test: make
Change-Id: I4c406386f0ee15dc8734a24b040482b6cb807126
2018-07-30 10:42:06 +08:00
Wale Ogunwale
906f9c629c Moved input time out handling to ActivityTaskManagerService (14/n)
Also:
- Post handling of scheduling GC from WM to AM side.
- Removed access on package manager through mAm reference.

Bug: 80414790
Test: Existing tests pass
Change-Id: Ia76c57411fc332ea099adb6ef7975e012b4d744c
2018-07-29 00:37:56 -07:00
TreeHugger Robot
cf8c852331 Merge "Add some compatibility support for resizing." 2018-07-27 17:03:18 +00:00
Winson Chung
b413299347 Dump the visible list for easier debugging
- For each task info returned for the visible task list, also dump some
  vars to make it easier to debug

Bug: 111272828
Test: adb shell dumpsys activity recents

Change-Id: Ie754cebd00ba07917054b9e5e3a69e0f72a072aa
2018-07-26 13:52:42 -07:00
Winson Chung
6b6a71a591 Merge "Consolidate RecentTaskInfo and RunningTaskInfo into TaskInfo class" 2018-07-26 18:58:02 +00:00
Garfield Tan
2746ab5bbb Add some compatibility support for resizing.
This includes changes to:
1) Allow app crash at most twice during resizing w/o interrupting
resizing process -- this is also necessary to support relaunching pre-N
app when user force maximizing/restoring pre-N apps.
2) Add crash tag to indicate that a crash happens during resizing.

This is one of starter tasks to improve large display UX, and a
spiritual cherry pick of a6364ef4af9e7e78934859f0ae2ea48e678a09c2 and
19bda6841f321ba780577265c90b0d4b7a066b1f.

Bug: 111840655
Test: go/wm-smoke
Change-Id: Ief9e1ee9cefbfd5cfd5047158f2bb1a12b19ed6f
2018-07-26 10:07:17 -07:00
Wale Ogunwale
590c716f8c Merge "Moved URI grants code out of ActivityManagerService to its own service (13/n)" 2018-07-26 03:56:08 +00:00
TreeHugger Robot
c3e9c8ba74 Merge "Added new test for AssistStructure." 2018-07-25 23:26:28 +00:00
Felipe Leme
c28cba10f8 Added new test for AssistStructure.
Test: atest app.assist.AssistStructureTest#testParcelizationForAutofill_oneSmallView
Bug: 37567426

Change-Id: I169a1605107b1da62f7d7363cd7ffb93554ba4ee
2018-07-25 13:57:34 -07:00
Andrii Kulian
d56ed0cdb8 Improve transaction logging
Add more detailed conditional logs to transaction executor on the
client side for easier debugging. This will print out transaction
callbacks and final state requests, as well as target activity
names.

Test: Manual
Change-Id: I14ab1a34985975bfd8c1f90b9c5945e354f79446
2018-07-25 11:38:20 +00:00
Philip P. Moltmann
6c644e620d Always review permissions before <M app is started the first time
This splits the
- review permissions
- individually control permissions
- consent to manage wireleess (wifi + bluetooth)
properties.

Almost all code cares only for the first and it is now always true.
Hence a lot of code can be simplified.

Bug: 110431654
Test: atest PermissionsHostTest
      started pre-M app
Change-Id: I733cd476ccd0bf5eaa59e9a9506db34f57c6baee
2018-07-24 11:45:34 -07:00
Wale Ogunwale
6d50dcc8af Moved URI grants code out of ActivityManagerService to its own service (13/n)
Allows for other services like window manager to call uri grants without
holding AM service lock.

Bug: 80414790
Test: Existing tests pass.
Change-Id: Ie5b4ddb19a2cedff09332dbeb56bcd9292fd18ac
2018-07-23 16:37:46 -07:00
Jason Monk
36524c7dbc Merge "Fix slice auto grant permissions" 2018-07-23 21:09:28 +00:00
Jason Monk
fe4885e360 Fix slice auto grant permissions
Test: Use auto-grant permissions across processes
Bug: 110958430
Change-Id: I3100f0655dbeb4ff0cde6407684edaff45961e09
2018-07-23 15:26:04 -04:00
TreeHugger Robot
c51551d408 Merge "Removing supports for creating stack on display" 2018-07-23 00:36:13 +00:00
TreeHugger Robot
5ecdab5763 Merge "Initial unit tests for AssistStructure" 2018-07-19 17:51:32 +00:00
Felipe Leme
ce47000f39 Initial unit tests for AssistStructure
Right now this test is focused in the parcelization of a big object, due to an
upcoming refactoring on the Autofill parcelization that does not use
ensureData() to load the structure (which in turn requires calls from
system server to the app).

Bug: 35708678

Test: atest app.assist.AssistStructureTest

Change-Id: I9e1c52b19cd1d82869fa8f48113cc7dd7b00a38c
2018-07-19 08:17:19 -07:00
Winson Chung
abfdcceba2 Consolidate RecentTaskInfo and RunningTaskInfo into TaskInfo class
- Remove overlapping logic for building both recent/running task infos
- Deprecate unused members of recent/running task infos
- Skip creating unnecessary recent task info when creating AppTaskImpl

Bug: 111078814
Test: Build and open Overview (ensure it still works)
Test: atest CtsAppTestCases:ActivityManagerRecentTaskInfoTest
Test: atest CtsAppTestCases:ActivityManagerRunningTaskInfoTest
Change-Id: Iaf1731002196bb89319de141a05ab92a7dcb2928
2018-07-18 18:06:47 +00:00
Kazuki Takise
4095cd7dbf Merge "Defer always on top state when task gets maximized" 2018-07-17 23:56:21 +00:00
Eran Messeri
607a995691 DPM: Propagate StrongBox-related exception
When the caller attempts to generate a key via DevicePolicyManager
(using DevicePolicyManager.generateKeyPair), and specifies that
StrongBox should be used, throw the right exception indicating
StrongBox unavailability - the same one that is thrown if the same
parameters were passed to the KeyStore's key generation method.

This is achieved by catching the StrongBoxUnavailableException in
KeyChain, returning an error code indicating this particular failure
to the DevicePolicyManagerService, which then propagates it by
throwing a service-specific exception with a value indicating
StrongBox unavailability.
The DevicePolicyManager then raises StrongBoxUnavailableException.

Prior to this change the exception propagated from KeyChain would be
a generic failure so the caller would simply get a null result.

Bug: 110882855
Bug: 111183576
Bug: 111322478
Test: atest CtsDevicePolicyManagerTestCases:com.android.cts.devicepolicy.MixedDeviceOwnerTest#testKeyManagement
Change-Id: I9abe3f449b48eb5a960fafbc15c59b9b4ce7a966
2018-07-17 12:58:13 +01:00
Kazuki Takise
048e2661ee Defer always on top state when task gets maximized
This CL enables always on top to be restored/deferred when
stacks switch between freeform and fullscreen.

Bug: 110494387
Test: ActivityStackTests
Test: DisplayContentTests
Test: go/wm-smoke
Change-Id: Iccb9824f845dea4925fac5d5dcb5eeaab2acdfcd
2018-07-17 16:09:57 +09:00
TreeHugger Robot
c3aadf378a Merge "Make stop complete notification call in to ActivityManager blocking." 2018-07-17 05:46:21 +00:00
Chris Morin
0260f3d79f Reland "OOM score management"
Add 2 additional attirubte |isFocused| and |lastActivityTime| in
ActivityManager.RunningAppProcessInfo and pass them to Chrome via IPC
so Chrome can better prioritize ARC processes.

Bug: 29576205
Test: Ensure new process information is passed to Chrome.
2018-07-13 15:54:03 -07:00
Jorim Jaggi
402d78ebb7 Pin compiled code of HOME app
Keeping the code in memory of the currently set home app is
important for latency as we don't have any kind of starting
window/splash screen when pressing the home app to hide any latency.

Memory impact:

Pinning dex/vdex:

In practical scenarios, this should be < 500kb.
The home app is usually profile-speed compiled, for which the
resulting dex/vdex files are about 2 mb. However, during regular
use, at least 1.5 MB of it is referenced in memory. This makes
sense: By definition profile-speed only compiles the things that
is usually frequently executed during regular execution.

Pinning apk:
With Launcher 3 in practical scenarios this should be about 3.7 MB,
as the APK is about 5.7 MB but 2 MB are usually referenced in any
case.

Bug: 111132016
Bug: 78585335
Test: Inspect "adb shell dumpsys pinner" after boot.
Test: Check for pinned files after updating camera/home.
Test: Check for pinned files after user switch with different
default apps.
Test: Check for pinned files after bg-dexopt.
Test: Check for pinned files after bg-dexopt + kill pid.

Change-Id: I6cdbc06d089efeb1c72a51216879ba0573502009
2018-07-13 15:16:48 +02:00
Louis Chang
f379f80bc6 Removing supports for creating stack on display
The API of creating a stack on certain display was intended
to create a container that can launch activities within.
Since activities now can be launched to any display by
specifying display id. This is no longer necessary.

Bug: 111363427
Test: atest ActivityManagerPinnedStackTests#testEnterPipWithResumeWhilePausingActivityNoStop

Change-Id: I89635d4e744672b79f5a60a8019f2ff93413e1df
2018-07-13 15:25:20 +08:00
TreeHugger Robot
f97fa4d77b Merge "Skip execution of transactions on a destroyed activity" 2018-07-13 03:38:16 +00:00
Lucas Dupin
401ea1647a Merge "Dark Notification Shade" 2018-07-13 02:09:31 +00:00
Lucas Dupin
f03e752407 Dark Notification Shade
Test: adb shell service call uimode 4 i32 1 # day
Test: adb shell service call uimode 4 i32 2 # night
Bug: 110758454
Change-Id: Ib6fce91d1aeff7e1fbfe8a7a528095487fbdb3f8
2018-07-12 17:30:34 -07:00
Riddle Hsu
d3062cbf41 Skip execution of transactions on a destroyed activity
An Activity may not yet create on client side, there is another
launch request with flags to clear task, then a destroy transaction
is scheduled. If client side keeps blocking until destroy timeout,
the token on server side will be removed. When client begins to
handle the first creation, it will report its activity token to
server that causes IllegalArgumentException because there is no
matched ActivityRecord.

Bug: 32375307
Test: atest FrameworksCoreTests:TransactionExecutorTests
Change-Id: I1b7e0c2863b13091c3fd50df602ff31ae02ff38d
2018-07-12 11:54:47 +08:00
Tony Mak
09db2ea924 Suggest smart actions in ExtServices
By using text textclassifier API, we classify entities like
email, phone, address in the notification and suggest the corresponding
actions.

Test: Manual test for now. Sideload GoogleExtServices. Write a sample app
to generate notification with phone number / address, etc, and finally
observe the smart actions.

BUG: 110527159

Change-Id: I02740cb07fa25a588d9e864990f95332d6830f12
2018-07-11 19:17:16 +00:00
TreeHugger Robot
5fd43b5a88 Merge "Add nullability annotations to lifecycle callbacks" 2018-07-10 23:58:57 +00:00
TreeHugger Robot
1433f50d94 Merge "Add nullability annotations to state save/restoration" 2018-07-10 21:23:12 +00:00
Robert Carr
6827f72fe2 Make stop complete notification call in to ActivityManager blocking.
This call can lead directly to Surface destruction, so it's only safe
to execute while the app renderer is paused. If the call is oneway and is
deferred we can end up in a scenario where the call is processed (destroying
the surface) after the client renderer has been unpaused for a different reason.

Bug: 80423392
Bug: 62536731
Test: Manual. go/wm-smoke.
Change-Id: Ide9da46a4ca7b6ef3b55c9966cc495b70b10fa46
2018-07-10 13:21:26 -07:00
Christopher Morin
d955be72b7 Merge "Revert "OOM score management"" 2018-07-10 19:23:19 +00:00
Aaron Heuckroth
09d6bd8a66 Merge "Move channel logging to dump method and redact name." 2018-07-10 18:05:34 +00:00
Christopher Morin
8852c7fe83 Revert "OOM score management"
This reverts commit af5451f0ac.

Reason for revert: Causes b/110976005

Exempt-From-Owner-Approval: Needed to avoid a widespread breakage
Change-Id: Ibe969726601d6e4ce9a66b1bf8998cb33a955619
2018-07-10 17:27:41 +00:00
Jake Wharton
324c73f212 Add nullability annotations to lifecycle callbacks
Bug: 77936892
Test: none
Change-Id: I83f5ff5c8a7955c189617eb8c489171da93fd47a
2018-07-10 12:44:00 -04:00
Jake Wharton
63f4d89c7b Add nullability annotations to state save/restoration
Bug: 110513685
Test: none
Change-Id: I570f0c5430ca29972d542e523a6d83ab567b4ed1
2018-07-10 12:44:00 -04:00
Dianne Hackborn
95031ef2e6 Now track "active time" in procstats.
Associations now keep track of the time they are
actively involved in impacting their target application.
This is based on the procstate propagating through the
association being the same as the procstate of its target
process...  so it may count as active when there is
another reason for that process to be in the same state.

To do this, we now maintain a set of "tracking
associations" -- these are in-use associations that
we know we need to be tracking to determine whether
they are active.  This list is built based on whether
we at all consider an association during an oom_adj
computation, and at the end of that walked to determine
which of those associations are currently active.

Also add tracking of associations through external
provider references, with a tag name now needing to be
passed through so we can mark up the reason for the
external reference.

Test: manual
Bug: 110957691
Change-Id: I426a499834e20a9d7f2b439faf9cb398d9792fa2
2018-07-09 12:46:53 -07:00
Aaron Heuckroth
51d3288431 Move channel logging to dump method and redact name.
Test: Generate bug report and confirm that NotificationChannel logs contain redacted name strings.
Change-Id: Iebaf7b165de0276e69ead862aa7ec864ef912282
Fixes: 78326066
2018-07-09 13:26:48 -04:00
TreeHugger Robot
9a8e27a915 Merge "Allow UiAutomation to adopt the shell permission indentity" 2018-07-04 03:00:14 +00:00
Svet Ganov
d873ae62c4 Allow UiAutomation to adopt the shell permission indentity
For testing we often need to run shell commands. This can be done
today via running a shell command from an instrumentation test
started from the shell. However, this requires adding shell commands
which are not in the API contract, involve boilerplate code, require
string parsing, etc.

This change allows an instrumentation started from the shell to
adopt the shell UID permission state. As a result one can call APIs
protected by permissions normal apps cannot get by are granted to
the shell. This enables adding dedicated test APIs protected by
signatures permissions  granted to the shell.

Test: cts-tradefed run cts-dev -m CtsUiAutomationTestCases
          -t android.app.uiautomation.cts.UiAutomationTest#testAdoptShellPermissions

bug:80415658

Change-Id: I4bfd4b475225125512abf80ea98cd8fcacb6a1be
2018-07-03 16:39:44 -07:00
Wale Ogunwale
20a65c4e7b Merge "Break direct calls to UserController object in AMS from activity classes (12/n)" 2018-07-03 20:50:18 +00:00
Wale Ogunwale
86b7446c2b Break direct calls to UserController object in AMS from activity classes (12/n)
Make calls from activity classes go through ActivityManagerInternal
interface to case UserController instead of calling AMS.mUserController
object directly. Note that calls to UserController should not hold the
AMS lock.

Bug: 80414790
Test: Existing tests pass
Change-Id: Ie56f08d10b62d609e9b5e31f45b5f0d6eed3a9d4
2018-07-03 08:22:59 -07:00
TreeHugger Robot
95e4e67dc6 Merge "Docs: generateKeyPair() can't be called from the main thread." 2018-07-03 08:32:23 +00:00
Winson Chung
8f54a7c515 Merge changes Ibae2de51,I1d6718d9
* changes:
  Allow share/edit screenshot actions from lockscreen
  Prevent clobbering of activity options bundle when merging
2018-07-02 21:04:39 +00:00
TreeHugger Robot
f574d538c1 Merge "Add a package declaration to RulesState" 2018-07-02 19:28:22 +00:00
TreeHugger Robot
ce77407144 Merge "StrictMode to catch storage while locked." 2018-06-30 22:04:26 +00:00