Commit Graph

14048 Commits

Author SHA1 Message Date
Jeff Chang
9744262ffa Merge "Support the toast Window to show on the secondary display." 2018-08-17 01:14:51 +00:00
TreeHugger Robot
48f928720f Merge "Docs: fixed a broken link in SystemUpdatePolicy" 2018-08-15 14:54:18 +00:00
TreeHugger Robot
21b2bb982f Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 11:13:27 +00:00
Jeff Chang
48ecef4bfb Support the toast Window to show on the secondary display.
1) Looking for the specific display when add a toast window.

2) Modify the enqueueToast interface to support the toast with
   specific dispaly Id.
   2.1 Toast get the specific display id from context.
   2.1 Toast use the new interface with display id to communicate with
       the Notification manager servcie.

3) Support to add/remove toast window token according to the displayId.

Bug: 80001975
Test: atest WindowManagerSmokeTest ActivityManagerMultiDisplayTests
Test: atest android.widget.cts.ToastTest
Test: manual, use ActivityView & launch a toast testing app in virtual
      display
      1. Make a toast.
      2. Verify the toast if show on the virtual display

Change-Id: I3a95c291af647ed9c6e966b2a90924097df19b6a
2018-08-15 14:20:54 +08:00
TreeHugger Robot
14590e6d0e Merge "Fixed an issue when updating media actions" 2018-08-14 22:35:29 +00:00
Makoto Onuki
e2d8ba1db9 Merge "Print DB file sizes in "dumpsys dbinfo"" 2018-08-14 21:31:22 +00:00
Makoto Onuki
016dc59fef Print DB file sizes in "dumpsys dbinfo"
- This will be included in bugreports, but only for running processes.

Bug: 111939259
Test: dumpsys dbinfo (when device locked and unlocked)
Change-Id: If743b2c3340eac7e6bc873ac655ac352a46fb7dc
2018-08-14 12:30:06 -07:00
Mathew Inwood
61e8ae6144 Add @UnsupportedAppUsage annotations
For packages:
  android.app.usage
  android.app.trust
  android.app.timezonedetector
  android.app.timezone
  android.app.timedetector
  android.app.job
  android.app.backup
  android.app.assist
  android.app.admin
  android.app

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
2018-08-14 14:17:44 +01: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
Neda Topoljanac
6e0404d4cc Merge "Modifing Javadoc for setStatusBarDisabled" 2018-08-09 10:53:41 +00:00
NedaTopoljanac
f132c26a13 Modifing Javadoc for setStatusBarDisabled
To clarify documentation for use in lock screen.

Test: not applicable
Bug: 110247271
Fixes: 110247271
Change-Id: I256a6f4bc01f0f117cb082b541863d7af3ba95cd
2018-08-09 10:38:09 +01:00
Felipe Leme
8d7f7f4f28 Added new API to support multi-activity autofill workflows.
For example, when an app uses one activity to enter username, another for
password.

Bug: 112051762

Test: atest MultiScreenLoginTest # new API
Test: atest CtsAutoFillServiceTestCases # to make sure it doesn't break anything
Test: m -j update-api

Change-Id: Ia95888901ab72f75938efb87103cd76f5ec8ce09
2018-08-07 11:36:20 -07:00
Serik Beketayev
75915d1b9c [JobScheduler] Add hidden API call surface for snapshotting job execution state
Test: WIP
Bug: 111413203
Change-Id: I5356d0821b3d6a657bf50249fdeabf6f0300bf81
2018-08-07 00:51:57 +00:00
Benjamin Miller
625f91aa46 Docs: fixed a broken link in SystemUpdatePolicy
{@docroot} is relative to the root dir, not the host.
Updated the destination and anchor text to reflect the new OTA guide.

Bug: 111521364
Test: make ds-docs and inspect generated HTML
Change-Id: I937f47338e8c18637947944467803c1764938754
2018-08-03 11:01:12 +00:00
Benjamin Miller
52e8f58b5e Merge "Docs: fixed example in SharedPreferencesBackupHelper" 2018-08-03 08:15:33 +00:00
Winson Chung
e4c7d37e03 Merge "Expose method to clear all visible recent tasks" 2018-08-02 21:08:56 +00:00
Winson Chung
e643910a33 Expose method to clear all visible recent tasks
- Atomically remove all the visible tasks so that SysUI doesn't need to
  remove each task individually.

Bug: 80471073
Test: atest FrameworksServicesTests:RecentTasksTest#testRemoveAllVisibleTasks
Change-Id: I23a6e152e94d5462948ab40adc9d7baf593847e1
2018-08-01 12:16:51 -07:00
Bernardo Rufino
f3b8c6fe3a Merge "[KV] State machine to linear task w/ RemoteCall" 2018-08-01 17:56:27 +00:00
Benjamin Miller
0160e156d5 Docs: fixed example in SharedPreferencesBackupHelper
Test: make ds-docs and manual inspection of generated HTML
Bug: 111822295
Change-Id: I415b891ca684684eb88e2ab42ca06460022f0e42
2018-08-01 15:41:22 +00:00
Felipe Leme
849df8f351 Disable warning on blocking one-way call from autofill server.
This behavior existed since autofill was introduced on O and most likely
won't be fixed on Q, so there's no point on warning. In fact, the warning is
often a red herring for other issues, not to mention a big logcat spammer.

Bug: 35708678
Test: manual verification looking at logcat

Change-Id: I40be4ce25abc5b097ea67e5cb34bb9c4237f0826
(cherry picked from commit 385ee5393d)
2018-07-31 13:10:33 -07:00
TreeHugger Robot
11eedb6379 Merge "Fix various crashes from a destroy-timeout activity" 2018-07-31 06:50:33 +00:00
Bernardo Rufino
2d87f453d9 [KV] State machine to linear task w/ RemoteCall
This is the first CL of key-value backup refactor.

* Method execute() that executed the state machine states is now empty
  and run() is created with the initial version of the linear task. It's
  basically composed of begin + loop + end. Although it still has the notion
  of state, it's more restricted than before (with private methods returning
  the next state). This is intentional to avoid making this CL too heavy to
  review and to avoid too much behavioral changes here. In the next CLs I
  intend to remove BackupState.

* Introduction of RemoteCall, which encapsulates an outbound call that
  leaves the system_server, with time-out and cancellation built-in.
  Agent calls are now triggered using this. As a result there is no more
  operationComplete() method either.

* Cancellation now is cleaner. We don't need a step lock anymore, only a
  (volatile) boolean that is checked in every queue iteration. If asked
  to cancel during an ongoing agent call we rely on RemoteCall.cancel()
  to return control of the task thread to us. We wait for the cancel
  acknowledgement to preserve the contract of no more transport calls.

* PFTBT instantiation moved from the constructor to the run() method,
  which makes more sense.

* No need for mFinished, mBackupData == null bookkeeping since time-outs,
  cancellation and legitimate agent responses won't step into one another
  anymore.

* Ternary (mQueue.isEmpty) ? BackupState.FINAL : BackupState.RUNNING_QUEUE gone
  because we check this in the beginning of invokeNextAgent() and now we
  don't pay the state-machine tick price associated with the handler.

* PerformBackupTask call sites now call static method start(), that
  spins up a new dedicated thread for the task. This new thread is
  assigned the same (process) priority as the backup thread
  (THREAD_PRIORITY_BACKGROUND).

Work left for future CLs:

* RemoteCall spins up a new thread for kicking off the call, this is for
  system agents that are executed inline. Old PBT also executed in the same
  thread (backup handler thread), so maintaining this to keep this CL at
  a reasonable size.

Test: atest PerformBackupTaskTest
Test: atest RunFrameworksServicesRoboTests
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/backup
Test: atest CtsBackupTestCases
Test: atest CtsBackupHostTestCases
Test: atest GtsBackupTestCases
Test: atest GtsBackupHostTestCases
Test: adb shell bmgr backupnow <kv_packages>
Test: 1. adb shell bmgr backup <p1> <p2>
      2. adb shell bmgr run
      A) 3. Cancel while sending <p1> data to transport
         4. Verify <p1> is backed-up and not pending
	    Verify <p2> is not backed-up and is pending
      B) 3. Cancel while waiting for <p1> agent
         4. Verify <p1> is not backed-up and is pending
	    Verify <p2> is not backed-up and is pending

Change-Id: Ia456c4e807de95d662c9e923245be07e8996f58a
2018-07-30 17:04:02 +01: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
Selim Cinek
5da4a6be6a Fixed an issue when updating media actions
When updating media actions to not have actions,
they weren't properly removed.

Change-Id: Ie946679d27c8b9bfee4005bdd9429f7afd9febf7
Fixes: 111681308
Test: install attached app and update from 5 to 0 actions
2018-07-20 14:00:24 -07: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