Commit Graph

14772 Commits

Author SHA1 Message Date
TreeHugger Robot
161833f209 Merge "Revert "Add support for enabling backup in work profile in"" 2019-01-23 17:12:43 +00:00
Zhi An Ng
6c14b389ef Merge "Change default mode for system alert window" 2019-01-23 17:08:07 +00:00
TreeHugger Robot
2288bdc9ab Merge "New extra and helper methods to set screenlock to a specific complexity level" 2019-01-23 13:59:21 +00:00
TreeHugger Robot
eea1710cda Merge "Add a feature flag for secure lock screen." 2019-01-23 10:55:33 +00:00
Stefano Tommasini
0bfafb7f41 Revert "Add support for enabling backup in work profile in"
This reverts commit 00a6e52734.

Reason for revert: b/123237328

Change-Id: I0e38e6187760264f16f3cd00389a4e1cdb316086
2019-01-23 10:43:06 +00:00
TreeHugger Robot
09d70fb609 Merge "Implement test harness mode" 2019-01-23 07:05:37 +00:00
Yohei Yukawa
2988d2db5c Unimplement VrManager#setVrInputMethod()
A system API VrManager#setVrInputMethod(), which was originally
introduced in Android P [1], has hever been used actually.  To avoid
unnecessary maintenance burden in the Android Framework, this CL makes
VrManager#setVrInputMethod() no-op.

For those who want to develop VR Keyboard, they should be able to use
Android P build to see if it actually works and it's actually what
they want.  In the future, if we can have a working prototype, we can
revisit here to see if we want to restore the framework implementation
or not.

Note that with this CL IMEs that have android:isVrOnly="true" will
always be ignored.

There should be no user/developer visible behavior change because this
is about an unused system API.

 [1]: I1db7981b5198e7e203d4578cae7e5b6d20037d0d
      89a6c48a8b

Bug: 72522822
Fix: 122058241
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: atest FrameworksCoreTests:InputMethodInfoTest
Test: atest FrameworksServicesTests:InputMethodManagerServiceTests
Change-Id: I5464ff74b92ff4a0d30002d643bd3c89925f0f0c
2019-01-22 21:29:09 -08:00
Rob Carr
302d36b6a8 Merge changes from topic "public-sc"
* changes:
  Unhide parts of SurfaceControl API in SDK.
  Replace SurfaceView background with boundless color layer.
  SurfaceControl: Accept instance rather than handle for reparent
2019-01-23 04:57:59 +00:00
Rhed Jao
dcc2b928fb Merge "Enable multi-display support for magnification controller" 2019-01-23 03:34:54 +00:00
Ryan Savitski
e58c4b5850 Merge "zygote children: propagate profileability to bionic for native heap profiling" 2019-01-23 03:21:43 +00:00
Ryan Savitski
cfdc151d52 zygote children: propagate profileability to bionic for native heap profiling
go/heapprofd is a native heap profiler for android Q+. Its triggering is
implemented within /bionic/libc. App processes (i.e.  zygote children) are not
considered profileable by default on "user" builds. To opt-in into being
profileable, the app's manifest needs to have the Q+ go/profileable flag set
(or be marked as debuggable, which is its superset).

With this change, if the app is supposed to be profileable, post-fork runtime
init calls into bionic to mark itself as such, and possibly start "from
startup" profiling.

On userdebug, all zygote children are marked profileable via the same
mechanism. System server is also marked profileable on userdebug (and needs a
separate codepath, as it does not have an activity thread).

See go/heapprofd-java-trigger for details on why we're taking this approach.
Context on the profiler itself: go/heapprofd-design.

Test: flashed blueline-userdebug, confirmed that java profiling activates from startup and at runtime.
Test: flashed crosshatch-user, confirmed that no java profiling is enabled by default.
Bug: 120409382
Change-Id: Ia038871acfa6b9cae7b6a81f666aecce4b68a4fc
2019-01-23 00:08:15 +00:00
TreeHugger Robot
9a8406418d Merge "Added trace points for ContentCapture." 2019-01-22 23:05:27 +00:00
Sudheer Shanka
7ee3291911 Merge "Update DownloadManager.addCompletedDownload javadoc." 2019-01-22 22:21:17 +00:00
William Hester
a96d3d3ff4 Implement test harness mode
Test Harness Mode is a feature for device farms that want to wipe
their devices after each test run. It stores the ADB keys in the
persistent partition (used for Factory Reset Protection) then performs
a factory reset by broadcasting the MASTER_CLEAR intent.

Upon rebooting, the Setup Wizard is skipped, and a few settings are set:
  * Package Verifier is disabled
  * Stay Awake While Charging is enabled
  * OTA Updates are disabled
  * Auto-Sync for accounts is disabled

Other apps may configure themselves differently in Test Harness Mode by
checking ActivityManager.isRunningInUserTestHarness()

Bug: 80137798
Test: make && fastboot flashall -w
Test: adb shell cmd testharness enable
Change-Id: I91285c056666e36ad0caf778bffc140a0656fcfa
2019-01-22 13:32:20 -08:00
Lenka Trochtova
66c492a87e Add a feature flag for secure lock screen.
Disable certain APIs which require secure lock screen if the device
doesn't have the feature.
Make sure one cannot set the password/PIN if there is no secure lock
screen, because the password/PIN wouldn't be really used afterwards
while the password strength checks would succeed, creating a false
sense of security.
Allow setting password strength requirements in DPM - test if the
current password is sufficient will fail automatically if there is
no secure lock screen.

Bug: 111072170
Bug: 111071972
Test: cts-tradefed run cts -m CtsDevicePolicyManagerTestCases
Test: cts-tradefed run cts -m CtsAdminTestCases
Test: frameworks/base/core/tests/utiltests/runtests.sh
Test: adb shell am instrument -w -e class com.android.internal.widget.LockPatternUtilsTest com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner
Test: atest SyntheticPasswordTests
Test: atest LockSettingsServiceTests
Test: atest LockSettingsShellCommandTest
Test: atest DevicePolicyManagerTest (for servicestests)

Change-Id: Ie46b0de6cb03c26dd05c05711c5c3b5e36a872df
2019-01-22 17:51:56 +01:00
Bernard Chau
60e0f7f6d8 New extra and helper methods to set screenlock to a specific complexity level
- updated complexity bucket metrics order and comments so that the
buckets metrics are sorted in ascending order of quality
- added helper method to sanitize complexity level (default to none if
invalid)
- added helper method to get min quality allowed at a complexity level
- added helper method to return the minimum metrics to fulfil minimum complexity
and dpm requirements

Bug: 111173457
Test: atest FrameworksCoreTests:PasswordMetricsTest
      manual test with TestDpc (ag/5901733)

Change-Id: Icf7c81bea0b66a47c4ee5913cfa0e713b3fa77b6
2019-01-22 16:25:42 +00:00
Robert Carr
10584fa98a SurfaceControl: Accept instance rather than handle for reparent
In preparation for public API.

Bug: 111297488
Test: Builds.
Change-Id: I80da54d92989ec0afe9fcdde324847f0de0c5083
2019-01-22 07:55:10 -08:00
Stefano Tommasini
69fbfdb787 Merge "Add support for enabling backup in work profile in DevicePolicyManager." 2019-01-22 11:48:28 +00:00
Svet Ganov
65f1b9ef44 Use proper API to get op name
Test: atest CtsAppOpstTestCases

Change-Id: Ibc5d9775092e6d82e7beb7163d91c1f9ea87e1be
2019-01-20 13:42:57 -08:00
Felipe Leme
b337e1c5dd Added trace points for ContentCapture.
Test: ./external/chromium-trace/systrace.py -o ~/tmp/trace.html -a android.contentcaptureservice.cts -t 1 view am
Fixes: 120440520

Change-Id: Ic6ad506ac88a9d04b096d58f568d04904b72fb04
2019-01-18 14:37:23 -08:00
Sudheer Shanka
fd2e571077 Update DownloadManager.addCompletedDownload javadoc.
Starting from Q, downloads added using
DownloadManager.addCompletedDownload are by default going to
be added to MediaProvider regardless of isMediaScannerScannable
argument specified by clients. Update the javadoc to reflect this.

Bug: 120876251
Test: n/a
Change-Id: Ie091703d801bb9cecc9574a122e13a242f4cca95
2019-01-18 14:19:37 -08:00
Lucas Dupin
00be88f1fd New pulsing notification layout
Test: wake up with power
Test: look at shelf on lock screen
Test: lock device w/ notifications from home screen
Test: receive notification on AOD
Test: atest KeyguardClockPositionAlgorithmTest
Test: atest NotificationRoundnessManagerTest
Test: atest ScrimControllerTest
Test: atest NotificationContentViewTest
Bug: 111405682
Change-Id: I9b4f2febd56a62256124567bffebc9f5f8255847
2019-01-18 13:57:04 -08:00
Ng Zhi An
65a99b6158 Change default mode for system alert window
Starting from Q, on Phones, SYSTEM_ALERT_WINDOW is by default denied for
all callers.

Bug: 63697002
Test: m, flash, boot
Change-Id: I7f2f697ce6cafb43b6e4075ad1985a9041605a0a
2019-01-18 11:02:00 -08:00
Yohei Yukawa
9f141ee802 Plumb Context#mUser to TextServicesManager to TextServicesManagerService
This is a follow up CL to our previous CL [1], which enabled spell
checker for background users.  In that CL, we assumed that spell
checker user ID can and should always be determined by the calling
user ID.  This assumption is not valid at least for direct-reply
notifications on System UI, because System UI always runs as user 0 no
matter who is the current active user.

In order to allow TextServicesManagerService (TSMS) connect to the
right user for such a special use case, this CL introduces a hidden
parameter "userId" to each IPC so that clients that have
INTERACT_ACROSS_USERS_FULL can override the target user ID when
necessary.

For instance, to interact with user 10's spell checker services, you
can obrain a special instance of TextServicesManager as follows.

  TextServicesManager tsmForUser10 = context
          .createPackageContextAsUser("android", 0, 10 /* userId */)
          .getSystemService(TextServicesManager.class)

If the calling process does not belong to user 10, any operations on
that TextServicesManager will result in SecurityException unless the
calling package needs to have INTERACT_ACROSS_USERS_FULL.

This CL is just a preparation.  There should be no user-visible
behavior change yet.

 [1]: I06c27ef834203a21cc445dc126602c799384527b
      06a2624049

Bug: 123043618
Test: spell checker still works
Change-Id: I31dda3ae8795190d44b0622b8335c34ddbc5dd48
2019-01-18 09:17:16 -08:00
Aurimas Liutikas
feccee99fa Merge "Remove old private constant from ResourceId." 2019-01-18 16:53:46 +00:00
Stefano
00a6e52734 Add support for enabling backup in work profile in
DevicePolicyManager.

Test: atest ProfileOwnerTest
BUG: 121198006
Change-Id: I9a1d4bf5530c432be3276e17f0535e26e77c8d59
2019-01-18 12:33:45 +00:00
Rhed Jao
02655dc38c Enable multi-display support for magnification controller
1) New api for a11y service to specify display id and return
per display magnification controller.
2) Updae MagnificationController to support multi-display.
3) Update AccessibilityController to support multi-display
magnifier.

Bug: 112273690
Test: atest MagnificationControllerTest
Test: atest MagnificationGestureHandlerTest
Test: atest CtsAccessibilityTestCases
Test: atest CtsAccessibilityServiceTestCases

Change-Id: I643a8f96e7d57f729daf8df7f26c9014b1dfd476
2019-01-18 16:53:32 +08:00
TreeHugger Robot
9c81c7cc5e Merge "Log history of Content Capture flushes." 2019-01-17 21:08:48 +00:00
Aurimas Liutikas
d8ebfefcee Remove old private constant from ResourceId.
Bug: 122967079
Test: make -j builds
Change-Id: I3e999044df02549e84208d38bb77d2ce1d1bd73b
2019-01-17 12:51:58 -08:00
Yueming Wang
21be1cf12d Merge "Add new intents, extras and constants for provisioning optimization." 2019-01-17 08:34:18 +00:00
Felipe Leme
1af85ea149 Log history of Content Capture flushes.
Bug: 122959591

Test: manual verification
Test: atest CtsContentCaptureServiceTestCases \
            FrameworksCoreTests:android.view.contentcapture.ContentCaptureTest

Change-Id: I9a5af8d1ea882b7b8fbbfa32aa2a37466b524ce5
2019-01-16 18:08:14 -08:00
Hui Yu
46c2a56f6d Merge "UsageStats DEVICE_SHUTDOWN event." 2019-01-16 23:22:06 +00:00
yuemingw
c5524f2944 Add new intents, extras and constants for provisioning optimization.
Bug: 122725418
Test: manual
Change-Id: I84ebac25621ea252030741b9f725075eeed1cd7b
2019-01-16 22:29:14 +00:00
Varun Shah
c51b2c6023 Merge "Adding a null check for ActivityManager#switchUser(UserHandle)." 2019-01-16 20:31:43 +00:00
Hui Yu
b1d243a51b UsageStats DEVICE_SHUTDOWN event.
DEVICE_SHUTDOWN event is used to close all open usage events that do
not have matching closing event when device is shut down. For example,
ACTIVITY_RESUMED or FOREGROUND_SERVICE_START are open events, the
DEVICE_SHUTDOWN event will close the usage session of the open events.

At orderly shutdown like selecting Power Off or Restart after pressing
power button, a DEVICE_SHUTDOWN event is sent to UsageStats.
UsageStats persists UsageStatsDatabase to disk immediately.

When power button is pressed for 3.5 seconds (configured by
config_veryLongPressTimeout in config.xml). A DEVICE_SHUTDOWN
event is sent to UsageStats. UsageStats persists UsageStatsDatabase
to disk immediately.

This is the mechanism that we do not lose UsageStats data when the
device is shut down.

When the device boots up, if the last event is not
DEVICE_SHUTDOWN, we add a DEVICE_SHUTDOWN with timestamp set to be the last
time database file is persisted. This is to handle the case device
shutdown abruptly due to power drained or cold temperature.

Bug: 111464278
Test: atest UsageStatsTest.java
Change-Id: I1e88063ba71d09042d02c6deb9f07d8581a15c30
2019-01-16 11:13:58 -08:00
TreeHugger Robot
4180876be4 Merge "Fixed how ContentCapture checks for system apps." 2019-01-16 03:30:44 +00:00
TreeHugger Robot
d9043b830e Merge "Implement setContentCaptureEnabled for manually enabling content capture" 2019-01-16 03:23:30 +00:00
Felipe Leme
0c6b23d5d1 Fixed how ContentCapture checks for system apps.
The previous check was disabling it for "non-system" apps that were bundled
in the system...

Bug: 121045049
Fixes: 122915433

Test: manual verification
Test: atest CtsAutoFillServiceTestCases

Change-Id: I2352fc21de27750509715035ba2f9c2dc2371428
2019-01-15 17:05:36 -08:00
Varun Shah
e7f6b54312 Adding a null check for ActivityManager#switchUser(UserHandle).
Also updated documentation and added the relevant test.

Bug: 122887441
Test: atest com.android.server.pm.UserManagerTest#testSwitchUserByHandle_ThrowsException
Change-Id: Ic936570ff24d4879732017c717d8c81f38356553
2019-01-15 17:04:59 -08:00
Chavi Weingarten
f9d1062118 Merge "Added turn on/off virtual display" 2019-01-15 23:53:08 +00:00
Mady Mellor
7c73162d40 Merge "Create BubbleMetadata use it instead of app overlay intent" 2019-01-15 22:24:45 +00:00
Adam He
6079d151e4 Implement setContentCaptureEnabled for manually enabling content capture
Change-Id: Id660aebac0b35a33b39a7c74da0f11c0958549ee
Fixes: 121047183
Test: atest CtsContentCaptureServiceTestCases
Test: atest android.contentcapture.cts.ChildlessActivityTest#testDisabledByApp
2019-01-15 12:13:21 -08:00
Mady Mellor
c39b4aedb0 Create BubbleMetadata use it instead of app overlay intent
* BubbleMetadata encapsulates necessary info to display a bubble
* Replaces app overlay intent usages with BubbleMetadata
* Renames existing bubble APIs to use 'bubble' rather than 'app overlay'

Bug: 111236845
Test: existing tests pass
Change-Id: I6a85d3c41dda47139fb8d960cadf1c8e109cf29b
2019-01-15 10:28:31 -08:00
Chandan Nath
2c9ae09194 [Multi-user] Change ActivityManagerService to use userId.
1. The book-keeping needs to be per user.
2. The calls into IBackupManager need to pass in the userId.
3. convert clearPendingBackup to an internal service call.

Bug: 121197004

Test: 1) atest RunBackupFrameworksServicesRoboTests
2) atest $(find \
frameworks/base/services/tests/servicestests/src/com/android/server/backup \
-name '*Test.java')
3) atest CtsBackupTestCases
4) atest CtsBackupHostTestCases
5) 'adb shell bmgr' enabled/backupnow flow

Change-Id: If49e00fc1d6aa770815c454f01b53865f6a68db4
2019-01-15 12:54:28 +00:00
TreeHugger Robot
1efe5f627a Merge "Add intent action and extra for managing a single default app." 2019-01-15 00:47:40 +00:00
TreeHugger Robot
09203ca2be Merge "Adding an api to mark a package as distracting" 2019-01-14 23:53:02 +00:00
TreeHugger Robot
e7d8df324d Merge "Disable content capture for system apps." 2019-01-14 19:31:07 +00:00
Adam He
b66babbf55 Disable content capture for system apps.
Change-Id: I58f827bd2b6da63768d670f2a3e40f7d2cd003e6
Fixes: 121045049
Test: manual verification
Test: atest CtsContentCaptureServiceTestCases # still passing
2019-01-14 18:43:35 +00:00
Hai Zhang
3a21289896 Add intent action and extra for managing a single default app.
This change adds Intent.ACTION_MANAGE_DEFAULT_APP and
Intent.EXTRA_ROLE_NAME for managing a single default app, which will
be launched from Settings' App info page. The new
Intent.EXTRA_ROLE_NAME also replaces RoleManager.REQUEST_ROLE_NAME.

Bug: 110557011
Test: build
Change-Id: Ice81150b0e960d050d24d963ade04254852a4ee4
2019-01-14 10:41:08 -08:00
Hyunyoung Song
9114be68cd Merge "Add @SystemApi to OverlayManager that ThemePicker needs" 2019-01-14 17:53:17 +00:00