Commit Graph

14791 Commits

Author SHA1 Message Date
TreeHugger Robot
c1b889d261 Merge "Fix a copy-paste typo." 2019-01-24 17:11:27 +00:00
Pavel Grafov
46165b5d61 Merge "Whitelist packages from VPN lockdown." 2019-01-24 16:15:08 +00:00
TreeHugger Robot
06928f4422 Merge "Add API for proxy configuration over VPN." 2019-01-24 15:09:18 +00:00
Lenka Trochtova
eca4ae464a Fix a copy-paste typo.
Bug: 111072170
Bug: 111071972
Test: make

Change-Id: I65d329792a5d8d6146711125ad54815c6411b693
2019-01-24 15:45:25 +01:00
TreeHugger Robot
e1a96063bc Merge changes from topic "calendar-package"
* changes:
  Handle null for the return of getCrossProfileCalendarPackages.
  API change for cross profile calendar feature.
2019-01-24 14:25:45 +00:00
Fabian Kozynski
e56b55182c Merge "Remove @SystemAPI from NotificationAssistantService" 2019-01-24 13:55:30 +00:00
Varun Shah
52792d160a Merge "Added APIs for App Usage Limits." 2019-01-24 13:35:28 +00:00
Irina Dumitrescu
18622d3d35 Add API for proxy configuration over VPN.
Test: runtest -x
frameworks/base/tests/net/java/com/android/server/ConnectivityServiceTest.java
&& atest HostsideVpnTests
Bug: 76001058
Change-Id: Id4dde4a4103fd93bfbbacc52d0e5ade56ae67a6a
2019-01-24 12:54:19 +00:00
Pavel Grafov
1d58621a1f Whitelist packages from VPN lockdown.
Bug: 77468593
Test: atest com.android.server.connectivity.VpnTest
Test: atest MixedDeviceOwnerTest#testAlwaysOnVpn
Test: MixedDeviceOwnerTest#testAlwaysOnVpnAcrossReboot
Change-Id: I7f6c5b9172063b588feacd6b9930a6cb88f764ab
2019-01-24 11:34:17 +00:00
yuemingw
d2bfbc8246 API change for cross profile calendar feature.
According to new requirements in b/121179845, we are changing the
API pattern from "add/remove" to "set(set<string>)" to support
"enable all packages" operation. Setting the whitelist to null
will enable all packages. This behavior is consistent with existing
methods in DevicePolicyManager, e.g. setPermittedInputMethods.

Also corrected some languages in the comments and annotations.

Bug: 121179845
Test: atest ManagedProfileTest#testCrossProfileCalendar
atest DevicePolicyManagerTest

Change-Id: I87f17a2094792e44fdeb672658bddb871c2c1eeb
2019-01-24 10:04:50 +00:00
Kevin Chyn
d75a03b722 Add plumbing for setRequireConfirmation to CC
Bug: 111461540

Test: Builds
Change-Id: I3fdb93282ceea091a459d014759ba747892f1a8c
2019-01-23 20:54:40 -08:00
Varun Shah
2546cef56c Added APIs for App Usage Limits.
Added a new AppUsageLimit group observer which follows the same pattern as
other UsageGroups. This specific observer allows the launcher to query
for the AppUsageLimit, available via the new LauncherApps API below. The
observer can be registered and unregistered via the respective new APIs in
UsageStats.

LauncherApps has a new API which allows it to get the AppUsageLimit for
a specified package and user, initally set via the API in UsageStats.
This new API allows the launcher to query specifics about the limit such
as how much usage time the limit has, and how much total usage time is
remaining.

Bug: 117409586
Test: atest FrameworksServicesTests:AppTimeLimitControllerTests
Test: atest android.app.usage.cts.UsageStatsTest#testObserveUsagePermissionForRegisterObserver
Test: atest android.app.usage.cts.UsageStatsTest#testObserveUsagePermissionForUnregisterObserver
Test: manual (mmma frameworks/base/tests/UsageStatsTest/)
Change-Id: Ifaffab629409e9191e40404a949c8df70bd3f7cb
2019-01-23 20:30:25 -08:00
Fabian Kozynski
b0da4bcb3a Remove @SystemAPI from NotificationAssistantService
Test: CTS tests
Bug: 120852766
Change-Id: I7b755dda96091dba50e12771804aa2ade07e3141
2019-01-23 16:15:54 -05:00
TreeHugger Robot
e0b050e1c3 Merge "Changed the virtual ids on ContentCapture to be long." 2019-01-23 20:04:51 +00:00
Ruslan Tkhakokhov
cda504b718 Merge "[Multi-user] Verfiy full backup/restore flow" 2019-01-23 18:53:58 +00:00
Michael Wachenschwanz
b9877a0137 Merge "Add Task Root package info to UsageEvent" 2019-01-23 18:03:40 +00:00
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
Ruslan Tkhakokhov
6712b72a48 [Multi-user] Verfiy full backup/restore flow
Bug: 121198030
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) atest GtsBackupTestCases
6) atest GtsBackupHostTestCases

Manual testing:
1. Start secondary user -> verify fb-schedule file is created, full backup queue initialised
2. Verify fullbackup of 1 package for system/secondary users, [package] only exists for current user:
  * bmgr --user [user-id] fullbackup [package]
  * Verify in logs that backup is successful
  * Uninstall/install [package]
  * Verify data is restored
3. Verify fullbackup of 1 package for secondary user, [package] eixtst for user 0:
  * bmgr fullbackup [package]
  * bmgr --user [user-id] fullbackup [package]
  * Verify in logs that backup is successful
  * Uninstall/install [package] for secondary user
  * bmgr --user [user-id] restore [token] [package]
  * Verify the data restored is different from system user data and belongs to [user-id]
3. Verify backup of all packages for system/secondary users:
  * bmgr --user [user-id] backupnow --all
  * Verify system packages (android, settings, wallpaper) are skipped for secondary user
  * Verify in logs that backup is successful
  * Uninstall/install [package]
  * Verify data is restored

Base -> Patchset 2: Update method calls to use asUser versions
Patchset 2 -> Patchset 3: Update opComplete callback to accept userId
Patchset 3 -> Patchset 4: Gate system packages from backup/restore for non-system users

Change-Id: Ic3986709ba4d46c0af9da45bb4dd682ee2aef3ce
2019-01-23 15:57:11 +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
Michael Wachenschwanz
0b4ab1f171 Add Task Root package info to UsageEvent
Bug: 113094946
Test: manual (use "adb shell dumpsys usagestats apptimelimit" to verify
apps at the root of tasks are considered active)
Test: atest cts/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java#testTaskRootEventField
Test: atest cts/tests/tests/app.usage/src/android/app/usage/cts/UsageStatsTest.java#testUsageSourceAttribution
Test: atest UsageStatsDatabaseTest

Change-Id: I40f86743d33c13892de0e59ae02c9ebddb606ee7
2019-01-22 22:19:21 -08: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
Felipe Leme
a75333c876 Changed the virtual ids on ContentCapture to be long.
WebView will use the node addresses as the id, and these address are 64 bits.

Fixes: 123234726
Test: atest ContentCaptureSessionTest ViewNodeTest ContentCaptureSessionTest \
            CtsContentCaptureServiceTestCases \
	    CtsAutoFillServiceTestCases:VirtualContainerActivityTest \
	    CtsAutoFillServiceTestCases:VirtualContainerActivityCompatModeTest
Test: m update-api
Test: manual verification with Webview, as CtsAutoFillServiceTestCases:WebViewActivityTest is broken

Change-Id: Iaf3008ed2dd530e596489cb144da678a4dac48ca
2019-01-22 17:14:51 -08: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