Commit Graph

80311 Commits

Author SHA1 Message Date
TreeHugger Robot
a4d970ea40 Merge "Throw an exception in case of parameter mismatch of precomputed text" into pi-dev 2018-03-07 21:02:37 +00:00
TreeHugger Robot
f99b1d8fd9 Merge "Implemented notifyViewClicked() on compat mode." into pi-dev 2018-03-07 19:40:55 +00:00
Seigo Nonaka
e1ffb54167 Throw an exception in case of parameter mismatch of precomputed text
If the given precomputed text is not compatible with the TextView,
reject the text by throwing IllegalArgumentException.

Bug: 73091756
Test: atest CtsWidgetTestCases:EditTextTest
    CtsWidgetTestCases:TextViewFadingEdgeTest
    FrameworksCoreTests:TextViewFallbackLineSpacingTest
    FrameworksCoreTests:TextViewTest FrameworksCoreTests:TypefaceTest
    CtsGraphicsTestCases:TypefaceTest CtsWidgetTestCases:TextViewTest
    CtsTextTestCases FrameworksCoreTests:android.text
    CtsWidgetTestCases:TextViewPrecomputedTextTest

Change-Id: I4fbf89a5f1409e8eefdeb9f208f9a3758220fe1a
(cherry picked from commit 3a0787af5e)
2018-03-07 18:30:27 +00:00
TreeHugger Robot
1e36211a96 Merge "Avoid service wrapper initialization deadlock." into pi-dev 2018-03-07 18:11:15 +00:00
Richard Ledley
847446d7f8 Merge "Don't use highlighting in non-selectable text. Also fixes potential discrepancy in indexes for Linkified entities." into pi-dev 2018-03-07 17:30:20 +00:00
Felipe Leme
54cc68370c Implemented notifyViewClicked() on compat mode.
Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.VirtualContainerActivityCompatModeTest#testSave_submitButtonClicked

Fixes: 73649008

Change-Id: Icf6a8b617e06055c58e38c5b7208c7f3ef3121ee
2018-03-07 09:27:02 -08:00
Annie Meng
292d895fb2 Merge "Validate restore of NetworkPolicy settings" into pi-dev 2018-03-07 17:07:51 +00:00
TreeHugger Robot
5a169cf2f6 Merge "System sounds get its own dnd toggle" into pi-dev 2018-03-07 16:39:40 +00:00
Rubin Xu
50ac241221 Clarify javadoc for DevicePolicyManager.setTrustAgentConfiguration
Fixes: 36887130
Test: builds
Change-Id: Ieccd3edc0122c9ae49903a3c5fc9fb0aba6c08a2
2018-03-07 14:21:35 +00:00
yuemingw
1d13eaea83 Block adb from changing certain settings value when corresponding user
restriction is on.

Check calling uid in isSettingRestrictedForUser(which is called by settingsprovider),
 and only allow system_uid when certain user restriction is on, so that user won't be
able to change these settings with adb:
Settings.Secure.LOCATION_MODE,
Settings.Secure.PROVIDERS_ALLOWED,
Settings.System.SCREEN_BRIGHTNESS,
Settings.System.SCREEN_BRIGHTNESS_MODE,
Settings.System.SCREEN_OFF_TIMEOUT,
Settings.Global.AUTO_TIME,
Settings.Global.AUTO_TIME_ZONE.
This check also prevents 3rd party apps from modifying system settings value
when corresponding user restriction is on.
In addition, any attempt to change AUTO_TIME will also go through the check
for dpm.getAutoTimeRequired().

Test: manually by running the adb command with restriction set and not set
Bug: 72549013
Bug: 72548203
Bug: 72548533
Bug: 72686466
Bug: 72687105
Bug: 72940551
Bug: 72940562
Change-Id: I1d1fd20d9fa0f76f27905d62873f6a6e9af0224e
2018-03-07 11:04:34 +00:00
TreeHugger Robot
1eb1ff31fc Merge "Remove toString() for CarrierIdentifier." into pi-dev 2018-03-07 03:44:31 +00:00
TreeHugger Robot
9aa32d0e71 Merge "Add APP_AUTO_RESTRICTION_ENABLED" into pi-dev 2018-03-07 02:32:17 +00:00
Scott Main
655d98bdb5 Merge "Fix javadoc typo causing broken links" into oc-mr1-dev
am: ac2cdc0dba

Change-Id: Ib8d63b1bfcc20e398314501a51bd2fad76a8d10e
2018-03-07 01:54:15 +00:00
Makoto Onuki
f896f1254c Avoid service wrapper initialization deadlock.
- Don't initialize a service wrapper with the cache lock held.
- Instead, use AtomicInteger to avoid instantiating the same service
multiple times.

Test: build, boot, presubmit
Bug: 71882178

Change-Id: Iea4207b855043addac4d24381778babf8eedd84d
2018-03-06 17:40:59 -08:00
Scott Main
bda0cc9c3c Fix javadoc typo causing broken links
Change-Id: I988e06100562c574bbda1bb530359da289062d65

bug: 74262753
2018-03-07 01:39:29 +00:00
TreeHugger Robot
d7cf0e1635 Merge "Add feature flag for audio output switcher." into pi-dev 2018-03-07 01:38:53 +00:00
Holly Jiuyu Sun
435c213e9d Remove toString() for CarrierIdentifier.
We may get NPE if mCarrierIdentifier is null. + should convert it to
string by itself.

Test: test on phone
Merged-In: Ibd352d6d2a9b0cb33a494d108eb0d3a7c1dbc61b
Change-Id: Ibd352d6d2a9b0cb33a494d108eb0d3a7c1dbc61b
2018-03-06 16:40:27 -08:00
TreeHugger Robot
2b00eaed27 Merge "IME API: rename IMS methods." into pi-dev 2018-03-07 00:19:55 +00:00
Doris Ling
1af6f81488 Add feature flag for audio output switcher.
Bug: 74130772
Test: rebuild
Change-Id: I06224975550ab4017d1546b182af083a36c0eacc
2018-03-06 15:17:10 -08:00
Dianne Hackborn
16268a69d6 Merge "Fix issue #72116995: Add permission guarding Service#startForeground" into pi-dev 2018-03-06 23:04:16 +00:00
TreeHugger Robot
8fa420c261 Merge "Stop invoking secdiscard when deleting password data" into pi-dev 2018-03-06 22:37:43 +00:00
TreeHugger Robot
9015d24332 Merge "Using UserManagerInternal for access control instead of UserManager" into pi-dev 2018-03-06 22:37:09 +00:00
TreeHugger Robot
29d047bab8 Merge "WallpaperColors hint computation" into pi-dev 2018-03-06 22:16:50 +00:00
jackqdyulei
3cd42a0a04 Add APP_AUTO_RESTRICTION_ENABLED
This config is used in aosp to auto restrict anomaly app.
Also add it to backup, dump and proto.

Bug: 73002171
Test: Build
Change-Id: I3d198e8856e2431f9ab7350a6dd897f1a6010002
Merged-In: I3d198e8856e2431f9ab7350a6dd897f1a6010002
(cherry picked from commit 1d9c0aa940)
2018-03-06 21:33:37 +00:00
TreeHugger Robot
1d03b9489e Merge "Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion"" into pi-dev 2018-03-06 20:14:26 +00:00
TreeHugger Robot
6ddf443d15 Merge "Expose Process.isIsolated()" into pi-dev 2018-03-06 19:20:47 +00:00
Richard Ledley
27db81baf8 Don't use highlighting in non-selectable text. Also fixes potential discrepancy in indexes for Linkified entities.
Test: atest CtsWidgetTestCases:TextViewTest FrameworksCoreTests:android.widget.TextViewActivityTest CtsViewTestCases:android.view.textclassifier.cts.TextClassificationManagerTest FrameworksCoreTests:android.view.textclassifier.TextLinksTest

Change-Id: Ib479afa9af2b921e6a217a34322a766561867b79
(cherry picked from commit bda1d9e740)
2018-03-06 18:33:20 +00:00
Lucas Dupin
1c6e3ba66d Merge "WallpaperColors.fromDrawable Drawable mutation" into pi-dev 2018-03-06 17:34:48 +00:00
Andrew Grieve
0fec93682e Expose Process.isIsolated()
Rather than have a process attempt to perform IO / IPC and check if it
fails, it makes much more sense to expose this getter.

My specific motivation for exposing this information more directly is to
be able to perform process-specific initialization logic in
Application.attachBaseContext():

https://cs.chromium.org/chromium/src/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java?rcl=ac2e180a1265f88dd4030bb35d69f5d0b2dc488d&l=54

Bug: 73343822
Test: Same code that's used in Chrome via reflection.
Change-Id: I1505962679da36ac42401230b204bff7b3376b73
2018-03-06 17:17:43 +00:00
TreeHugger Robot
bf8137a7cd Merge "Revert accidental change of isUsingUnifiedPassword javadoc" into pi-dev 2018-03-06 15:23:18 +00:00
Jeffrey Vander Stoep
85d1b5c414 Revert "pm: SharedUserId: Assign seinfo using actual targetSdkVersion"
This reverts commit 8196fd9380.

Reason for revert: b/74214574

Bug: 74214574
Change-Id: I9602872238ccc8a49d8b200e5389995d597f1c3a
(cherry picked from commit 00b4fa8b13)
2018-03-06 15:12:15 +00:00
Beverly
d696476fb3 System sounds get its own dnd toggle
- Added logic for streams to be muted by dnd (unassociated with ringer)

Test: runtest -x frameworks/base/services/tests/uiservicestests/src/com/android/server/notification/ZenModeHelperTest.java
Bug: 73362490
Change-Id: I1101e67282f7331497e91eb510d2bf4f1ea6b4b1
2018-03-06 09:08:29 -05:00
Annie Meng
47f5c9c55f Validate restore of NetworkPolicy settings
We want to catch potential exceptions that occur when restoring
NetworkPolicy settings. Here, a DateTimeException can be thrown when
we try to read the recurrence rule from the backup data and cannot
parse a timezone.

We also add GTS tests to validate that these catches persist and that
we don't crash when given unexpected backup data to restore.

Bug: 73942796
Test: gts-tradefed run gts -m GtsBackupHostTestCases -t com.google.android.gts.backup.NetworkPolicyRestoreHostSideTest
Change-Id: I6f6ea09d2fff60b8d704c6160234e6f032321103
(cherry picked from commit 853097ca2c)
2018-03-06 13:47:24 +00:00
TreeHugger Robot
3fbc54e609 Merge "Don't whitelist all system image apps." into pi-dev 2018-03-06 11:50:23 +00:00
Tony Mak
6a97535f28 Revert accidental change of isUsingUnifiedPassword javadoc
Test: None

Change-Id: I72735b790ae37838917b2330b84a3cfef32ce7b8
2018-03-06 11:34:08 +00:00
Mathew Inwood
6827f4a2c8 Don't whitelist all system image apps.
Also include in system dump which packages are exempt from the api
restrictions.

This is a cherry-pick of 974290b032
from master.

Test: Verified that the device boots.
Bug: 64382372
Change-Id: Iaeca91478f53c8b4e9608246aab42bdb90f899bb
2018-03-06 09:54:55 +00:00
TreeHugger Robot
27ed96bf0c Merge "VideoView2: Move MediaContolView2's hidden constant" into pi-dev 2018-03-06 07:55:14 +00:00
Erik Kline
a69df717ce Merge "Fail if the interface is not available when starting" into pi-dev 2018-03-06 05:53:29 +00:00
Insun Kang
7c5b02dff8 VideoView2: Move MediaContolView2's hidden constant
Bug: 74173212
Test: VideoViewTest app
Change-Id: Ic91e0b0bfb910d555c1dbe77f028a017f2a18b79
(cherry picked from commit a0fdcc97f0)
2018-03-06 05:51:56 +00:00
TreeHugger Robot
faf6589748 Merge "Bluetooth: Use enums for adapter connection states" into pi-dev 2018-03-06 03:33:42 +00:00
Tarandeep Singh
164cfba536 IME API: rename IMS methods.
Incorporating API Review feedback:
* Use IMS.switchInputMethod(id) instead of IMS.setInputMethod()
* Use IMS.switchInputMethod(id, subtypeId) instead of
  IMS.setInputMethodAndSubtype()
* Renamed switchToLastInputMethod() to switchToPreviousInputMethod()

Bug: 73954137
Test: atest InputMethodServiceTest
Test: atest CtsInputMethodServiceHostTestCases
Change-Id: I6efd5ca473e33e6faeadb7eea7772b9d2b8ca12b
2018-03-06 02:23:15 +00:00
Erik Kline
ea1b8bd5a5 Fail if the interface is not available when starting
Addresses a long-standing TODO.  Now, when calling IpClient's
startProvisioning(), the interface has to be available (i.e.
InterfaceParams#getByName() must return non-null).

Also:
    - add a test
    - refactor for testability
    - delete some constructors no longer used
    - properly handle passed-in null IpClient.Callback
    - some more IpManager -> IpClient renaming
    - permit recording metrics before starting a provisioning
      attempt (logging immediate errors) without Log.wtf().

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks/opt/net/wifi/tests/wifitests/runtests.sh passes
    - runtest frameworks-net passes
    - basic WiFi IpClient connections works fine
Bug: 62476366
Bug: 73487570
Merged-In: I68e5e24122dc31e730cdbe8d75e33847e6332da4
Merged-In: Ifd27f5d908947cd7b4e1b8d54f9fa87e43ebb11b
Merged-In: Ief3c8e1652f69af0276fe35946ae1bf6e6b1b57e
Change-Id: Ic83ad2a65637277dcb273feb27b2d1bb7a11eb2b
(cherry picked from commit b152cd0aa4)
2018-03-06 11:06:34 +09:00
Jack He
bd020a6f5a Bluetooth: Use enums for adapter connection states
Bug: 69478930
Test: make, no user visible change
Change-Id: I999d0c445fe3b24aca72961c40c3428901542bc1
(cherry picked from commit ee81f99150)
2018-03-05 17:27:05 -08:00
Dianne Hackborn
dd027b3ab2 Fix issue #72116995: Add permission guarding Service#startForeground
Now requires permission if targeting P.

Note that this is a separate permission from the existing one
that is required for instant apps to use foreground services.  The
reason for this is that their semantics are different (the instant
apps permission is associated with an app op for control over what
the app is allowed, while the regular app permission is just a
normal permission that is always granted and only there for
auditing of apps), and there are probably going to be cases where
a developer will want to use a foreground service in the full
version of their app but not as an instant app.

Bug: 72116995
Test: atest CtsAppTestCases
Change-Id: I883c9515c307ed8e39f0bf888c4045944c8183ac
2018-03-05 16:59:21 -08:00
Fyodor Kupolov
d97a0f1ac5 Merge "Revert "Allow restoring of apps that rotated key"" into pi-dev 2018-03-06 00:28:51 +00:00
Amith Yamasani
14c716c911 Revert "Allow restoring of apps that rotated key"
This reverts commit 313d225cd1.

Reason for revert: b/74159113

Change-Id: I483ecdd80d26fca8451cd270b4fcbe34379839cb
2018-03-05 20:40:23 +00:00
Tony Mak
329047bd16 Improve javadocs of some DPM APIs
FIX: 70332970
FIX: 73919570
FIX: 67495520
FIX: 71566404

Test: None

Change-Id: Ic9b485ff7c15e0d244cba9e71def8d5c41e52070
(cherry picked from commit 8309c8f760)
2018-03-05 20:21:57 +00:00
Sunny Goyal
145c8f80a9 Using UserManagerInternal for access control instead of UserManager
Bug: 36067387
Test: for C in {1..10}; do adb shell am instrument -e class com.android.server.pm.ShortcutManagerTest$C \
      -w com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner; done
      atest CtsDevicePolicyManagerTestCases:LauncherAppsSingleUserTest \
            CtsDevicePolicyManagerTestCases:LauncherAppsProfileTest \
            CtsDevicePolicyManagerTestCases:LauncherAppsMultiUserTest
      atest CtsShortcutManagerTestCases
Change-Id: Ia4ddea58f66861ef760865b6d8831563584f85c9
2018-03-05 19:45:38 +00:00
Lucas Dupin
ffbf37e611 WallpaperColors.fromDrawable Drawable mutation
WallpaperColors.fromDrawable should never mutate Drawable bounds

Test: tests/app/src/android/app/cts/WallpaperColorsTest.java
Change-Id: I7467033c6a4e587b04e60423ceec3404b980cdf2
Fixes: 73506557
2018-03-05 17:27:28 +00:00
Lucas Dupin
c50f47d970 WallpaperColors hint computation
Public WallpaperColors surface should not compute hints, malicious apps
might use theme inversion to slow down the system.

Change-Id: I9d14259e433b1047d2512b3d994524dca5e8531a
Fixes: 69532159
Test: set white wallpaper, black wallpaper, observe theme changing
Test: runtest -x services/tests/servicestests/src/com/android/server/wallpaper/WallpaperServiceTests.java
2018-03-05 17:26:58 +00:00