OSDN Git Service

android-x86/frameworks-base.git
3 years agoRequire a more specific intent
Lucas Dupin [Wed, 25 Mar 2020 17:46:44 +0000 (10:46 -0700)]
Require a more specific intent

Bug: 147606347
Fixes: 161150380
Test: run poc, device didn't reboot
Change-Id: I8f721ca659d58271880a7adbf386b270b331e55b
Merged-In: I8f721ca659d58271880a7adbf386b270b331e55b
(cherry picked from commit a9afc32ddc013424e2d17a091ef3fdfbe18c0d76)
(cherry picked from commit d16e86f466c2fc18448b654cbe71089c7fede991)
(cherry picked from commit 6dbda27f98ccfdc97b41e8f3990b3a316bb928dd)

3 years agoRESTRICT AUTOMERGE
Patrick Baumann [Fri, 6 Mar 2020 18:34:17 +0000 (10:34 -0800)]
RESTRICT AUTOMERGE
Do not set referrerUri on SessionInfo for non-owners

This change leaves the referrerUri field null when the caller leading to
its production is not the owner of the session.

Bug: 142125338
Test: atest SessionReferrerUriTest
Change-Id: I84679ea0636aa2097e25e23813c48134c9cc1d75
(cherry picked from commit 681b2364225aca50e7770d82be83f3e129a8cb11)

3 years agoRemove unused intent in NiNotification
Yu-Han Yang [Mon, 8 Jun 2020 21:59:23 +0000 (14:59 -0700)]
Remove unused intent in NiNotification

Bug: 154319182
Test: manual
Change-Id: I5958a8fb442cf4506e1824243493f91aea34a7cc
Merged-In: I5958a8fb442cf4506e1824243493f91aea34a7cc
(cherry picked from commit d541f6d85e9030c5e0e7372332854684d8a32916)

3 years agoRevert "Ignores protected broadcasts if not priv-app"
Winson Chiu [Tue, 16 Jun 2020 21:41:22 +0000 (21:41 +0000)]
Revert "Ignores protected broadcasts if not priv-app"

Revert of I5bd2bf3bd7c38fd9cc563a02b24bc569495d79ed

For now, allow all system apps to declare protected
broadcasts. This will be cleaned up in a future change.

Bug: 158570769

Merged-In: I54d236c0a6daaa934bd64a3bd05e2654e0e868fe
Change-Id: I54d236c0a6daaa934bd64a3bd05e2654e0e868fe
(cherry picked from commit b5e3addc5f27149d1b0bbc213ced47b2ade732bf)

3 years agoOnly autoVerify at install for new hosts
Christopher Tate [Fri, 29 May 2020 00:49:53 +0000 (17:49 -0700)]
Only autoVerify at install for new hosts

Re-run app link verification at update time only when the set of hosts
has expanded.  Intentionally revoke verify history when an app stops
using autoVerify, as a one-time measure to place it back into the
non-autoverify model for tracking the user's launch preferences.  If the
app starts using autoVerify again later, it behaves identically to an
app that has never done so before.

Bug: 151475497
Bug: 146204120
Test: described on master CL

Merged-In: I200d85085ce79842a3ed39377d1f75ec381c8991
Change-Id: Ibaf087946966ad82d60c7b255e3ee75990716b63
(cherry picked from commit 3e76c30b7db2cb431e84a3e933c839fefe283c6d)

3 years agoDO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package
Winson [Thu, 23 Apr 2020 17:45:55 +0000 (10:45 -0700)]
DO NOT MERGE: Verify INSTALL_PACKAGES permissions when adding installer package

Without this check, any package can set the installer package of
another package whose installer has been removed or was never set.
This provides access to other privileged actions and is undesired.

Bug: 150857253

Test: manual verify with proof of concept in linked bug
Test: atest android.appsecurity.cts.PackageSetInstallerTest

Merged-In: I2159c357911ff39ffd819054b42f96ae86bc98bc
Change-Id: I2159c357911ff39ffd819054b42f96ae86bc98bc
(cherry picked from commit 8220483a2ed83dbaf838803d45bc58cadede4208)

3 years agoRevert "Revoke 'always' web handler status when not autoverifying"
Chris Tate [Fri, 20 Mar 2020 18:30:24 +0000 (18:30 +0000)]
Revert "Revoke 'always' web handler status when not autoverifying"

This reverts commit ce22265eeda3a96613b9a7bb7dd898c69d295964.

Reason for revert: Inadvertently broke link handling stickiness even for well behaved apps

Bug: 146204120
Test: install app that handles web urls; set to 'always' in Settings;
install same apk again.  Verify that app is still in 'always' state via
'adb shell dumpsys package d'

Merged-In: Ifac4f0c044c2c575a29bdd5ce5d14d12373fbe70
Merged-In: If9046cb420961b8ef0333e9f1115eb69fb92242e
Change-Id: Ife6cd66e0bae5738c08962a8fa9397973e33f28e
(cherry picked from commit 63b6cfd96485c11b906ca4ecc83245335d531364)

3 years agoDO NOT MERGE Make intents immutable
Julia Reynolds [Thu, 28 May 2020 14:45:19 +0000 (10:45 -0400)]
DO NOT MERGE Make intents immutable

Test: make
Fixes: 154719656
Change-Id: I212ca5f1a48174ed85311b551259da314718f082
Merged-In: I212ca5f1a48174ed85311b551259da314718f082
(cherry picked from commit 36b3352784ae90326a2b308542b1d2cfe18661a0)
(cherry picked from commit f596432fde8008f3571fa7157e7eb8a85ece5d7b)

3 years agoMore fixes towards the race conditions in AMS
Jing Ji [Fri, 25 Oct 2019 19:03:30 +0000 (12:03 -0700)]
More fixes towards the race conditions in AMS

Bug: 142986887
Bug: 140108616
Test: Manual
Change-Id: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
Merged-In: I6e0bdc8c02bab54f6278096b3a3acadd97c064c6
(cherry picked from commit b2e84f0406139156442984943d8de7dd37d51368)
(cherry picked from commit 9f8923d54a2d3740d1a293728b1d5b5b2451627b)

3 years agoAdd back enforceReadPermission for getmetadata
Diksha Gohlyan [Thu, 7 May 2020 00:46:46 +0000 (00:46 +0000)]
Add back enforceReadPermission for getmetadata

Test: manually tested
Bug: 151095863

Change-Id: I29ef120c10c488550b85269e598aeb6ff9505038
Merged-In: I4f04f08f76d039196c2c67bac80d4a46ebec87f2
(cherry picked from commit 71ec29b05022b06ffd4596dc8b339d2067cf58c0)

3 years agoRESTRICT AUTOMERGE
Linus Tufvesson [Tue, 5 May 2020 10:13:51 +0000 (11:13 +0100)]
RESTRICT AUTOMERGE

This change is the union of
I2aaab1903dee54190338f7b6e49888aa51437108 and I58834636e092f992e403342e36b475dc60e8f20ai

Original CL descriptions:

*** I2aaab1903dee54190338f7b6e49888aa51437108
Block TYPE_PRESENTATION windows on default display

... and any other display that isn't considered a public presentation
display, as per Display.isPublicPresentation()

*** I58834636e092f992e403342e36b475dc60e8f20a
Use TYPE_PRIVATE_PRESENTATION for private presentations
Detect if the Presenation is targeting a private virtual display, and if they
are use the windowType TYPE_PRIVATE_PRESENTATION.
***

Bug: 141745510
Test: atest CtsWindowManagerDeviceTestCases:android.server.wm.PresentationTest CtsDisplayTestCases:android.display.cts.VirtualDisplayTest

Change-Id: I9f1c4b140ab4bc6183151aafc5501e8648fbc3fa
(cherry picked from commit d663d274ea8cdb7169d08bc3a4efa81517a8724a)

3 years agoDO NOT MERGE - Kill apps outright for API contract violations
Christopher Tate [Mon, 19 Aug 2019 23:16:20 +0000 (16:16 -0700)]
DO NOT MERGE - Kill apps outright for API contract violations

...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
(cherry picked from commit a79b6ba5c59dc6aaa8adbe1ffa3ee4b761f45e7f)

4 years agoRESTRICT AUTOMERGE
Eugene Susla [Thu, 28 Mar 2019 20:50:17 +0000 (13:50 -0700)]
RESTRICT AUTOMERGE
Prevent accessing companion records from arbitrary uids

Test: manual
Fixes: 129476618
Change-Id: I7b18cfcdf58e62a445cbb508116c6ce7c1cea8d7
(cherry picked from commit 84cccfe6cdbc57ee372ee1a0fea64c7a11c53766)

4 years agoVerify all possible hosts that match web nav
Christopher Tate [Wed, 26 Feb 2020 01:48:49 +0000 (17:48 -0800)]
Verify all possible hosts that match web nav

Even if an <intent-filter> matches non-web schemes in addition to http
or https, make sure to include its cited hosts in the autoVerify
evaluation.

Bug: 150038428
Test: atest OsHostTests#testIntentFilterHostValidation
Change-Id: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
Merged-In: If9ef0fc53d96e6581c56d86f89fe63bc9a5fb89a
(cherry picked from commit 1fba0f897f276d5d47962534867e764da8061105)
(cherry picked from commit bfa779601082d9021ea4e7d4cca571575bd0b13b)

4 years agoRevert "DO NOT MERGE - Kill apps outright for API contract violations"
Anis Assi [Tue, 28 Apr 2020 19:41:11 +0000 (12:41 -0700)]
Revert "DO NOT MERGE - Kill apps outright for API contract violations"

This reverts commit ca006a7de870f58587dbd9054aa98b3ea21157f6.

4 years agoRESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo
Riddle Hsu [Tue, 3 Mar 2020 08:29:31 +0000 (16:29 +0800)]
RESTRICT AUTOMERGE Use consistent calling uid and package in navigateUpTo

Originally, if the caller of navigateUpTo is alive, even the calling
uid is set to the caller who launched the existing destination activity,
the uid from caller process has higher priority to replace the given
calling uid. So this change doesn't modify the existing behavior if
the caller process is valid. Besides, the case of delivering new intent
uses the source record as calling identity too, so the case of starting
new activity should be consistent.

Also forbid attaching null application thread to avoid unexpected state
in process record.

Bug: 144285917
Test: atest ActivityStackTests#testNavigateUpTo
Test: atest CtsSecurityTestCases:ActivityManagerTest# \
      testActivityManager_attachNullApplication
Change-Id: I60732f430256d37cb926d08d093581f051c4afed
(cherry picked from commit da78af4d6696dda77c692a7c6f2f49d4277cf341)

4 years agoRESTRICT AUTOMERGE Create separated tasks for different apps from startActivities
Riddle Hsu [Wed, 19 Feb 2020 07:13:56 +0000 (15:13 +0800)]
RESTRICT AUTOMERGE Create separated tasks for different apps from startActivities

Assume there are 2 applications A, B with different uids.
There are 4 activities A1, A2, B1, B2 with default task
affinity and launch mode.

After A1 called startActivities(B1, A2, B2):
 Original   : Task(A1, B1, A2, B2)
 This Change: Task(A1, B1), Task(A2, B2)
In other words, the source caller cannot launch its activity
above the activity of other application in the same task, and
it can still launch activity of other application in its task.

Bug: 145669109
Test: atest StartActivityTests# \
      testStartActivitiesWithDiffUidNotInSameTask
Change-Id: I97bd875146a52f62b8fe82235487ccefb2955e8e
(cherry picked from commit 48d8d370f3d1dac06719ca6a52bda5f45a1a533a)

4 years agoDO NOT MERGE - Kill apps outright for API contract violations
Christopher Tate [Mon, 19 Aug 2019 23:16:20 +0000 (16:16 -0700)]
DO NOT MERGE - Kill apps outright for API contract violations

...rather than relying on in-app code to perform the shutdown.

Backport of security fix.

Bug: 128649910
Bug: 140108616
Test: manual
Test: atest OsHostTests#testForegroundServiceBadNotification
Change-Id: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
Merged-In: I94d9de50bb03c33666471e3dbd9c721e9278f7cb
(cherry picked from commit a79b6ba5c59dc6aaa8adbe1ffa3ee4b761f45e7f)

4 years agoDO NOT MERGE Ensure package names read from config are system packages.
Hai Zhang [Wed, 11 Dec 2019 01:34:18 +0000 (17:34 -0800)]
DO NOT MERGE Ensure package names read from config are system packages.

Bug: 145981139
Test: manually tested ensureSystemPackageName() returns null for non-system app
Change-Id: I1d23910cbd282f6702785c9dfb059d7be6b0e895
(cherry picked from commit 6a56247200e1a8afc4dacc2497ec384efa200b92)
(cherry picked from commit 584d73a0b066e01b0877b475c8e2b1a85fcf5328)

4 years agoRESTRICT AUTOMERGE
Rubin Xu [Tue, 5 Nov 2019 10:15:36 +0000 (10:15 +0000)]
RESTRICT AUTOMERGE
Update keyguard locked state from TrustManagerService

TrustManagerService holds the ground truth about whether a user is
locked or not, so update keystore using the information there,
instead of doing it from KeyguardStateMonitor. This fixes the issue
of work profile locked state not being correctly pushed to keystore.

Note: since this change is likely to be backported as a security
patch, I'm refraining from doing major refactoring right now.

Bug: 141329041
Bug: 144430870
Test: manually with KeyPairSampleApp
Change-Id: I3472ece73d573a775345ebcceeeb2cc460374c9b
(cherry picked from commit 0860a5c5c303426073c36763bef28644673ff441)

4 years agoOnly suspend package from system or shell
Julia Reynolds [Thu, 7 Nov 2019 16:37:18 +0000 (11:37 -0500)]
Only suspend package from system or shell

Test: manual
Bug: 148059175
Change-Id: I50ee768e792266ad2091f1913168e89d5d1463ed
Merged-In: I50ee768e792266ad2091f1913168e89d5d1463ed
(cherry picked from commit 1c943a2670c1ff499669b42ef72dcd9f07db08c3)
(cherry picked from commit adc39de3a148a2058d63bd7a1b8b71ee0a3524ac)
(cherry picked from commit eb4f716bf3a0ee3ac8015cde48305aeb82724039)

4 years agoFix potential double destroy of AssetManager
Riddle Hsu [Thu, 4 Jul 2019 08:10:08 +0000 (16:10 +0800)]
Fix potential double destroy of AssetManager

Assume there is a XmlBlock [X] created by a AssetManager [A]
([A] will have mNumRefs = 2). After [A].close is called
(mNumRefs = 1) and then both [X] and [A] are going to be GCed,
if [A].finalize is called first (nativeDestroy), the later
[X].finalize will invoke [A].xmlBlockGone that triggers the
second nativeDestroy of [A] and leads to crash.

By clearing the mObject in AssetManager.finalize, the
decRefsLocked from other paths won't call nativeDestroy again.

Bug: 136721562
Bug: 144028297
Test: atest AssetManagerTest
Test: Build and install CorePerfTests
      adb shell am instrument -w -r --no-hidden-api-checks -e class \
      android.app.ResourcesPerfTest#getLayoutAndTravese,android.graphics.perftests.RenderNodePerfTest \
      com.android.perftests.core/androidx.test.runner.AndroidJUnitRunner

Change-Id: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
Merged-In: Ia938502d2443f5a6de6a3cabdb7ce1d41d3ff6d1
(cherry picked from commit 0a8a1e9d40a3cdff06150c43c623fa4c415226b6)

4 years agoRevoke 'always' web handler status when not autoverifying
Christopher Tate [Tue, 17 Dec 2019 19:21:02 +0000 (11:21 -0800)]
Revoke 'always' web handler status when not autoverifying

If an app has previously used autoVerify to make claims about its status
re handling web navigation intents, but is updated such that it no
longer makes those claims, step down its "official handler" status as
though it had never invoked autoVerify in the first place.

Bug: 146204120
Test: manual: as described in bug; observe policy before/after via
      'adb shell dumpsys package d'
Test: atest CtsOsHostTestCases
Change-Id: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
Merged-In: I58502d1b32d793aba9aa772fa2ad5ac38acca48a
(cherry picked from commit ce22265eeda3a96613b9a7bb7dd898c69d295964)

4 years agoFixes NPE when preparing app data during init
Patrick Baumann [Wed, 6 Nov 2019 18:36:39 +0000 (10:36 -0800)]
Fixes NPE when preparing app data during init

When deleting an unused static shared library on Q, the user manager was
fetched via mContext.getSystemService. At this time during boot, the
service wasn't registered and so null was returned. This has already
been addressed in R with a move to injecting dependencies in the
PackageManagerService constructor.

Bug: 142083996
Bug: 141413692
Test: manual; remove static dependency on eng Q build and reboot
Change-Id: I8ae4e331d09b4734c54cdc6887b273705dce88b1
Merged-In: I8ae4e331d09b4734c54cdc6887b273705dce88b1
(cherry picked from commit 5d3fc339b57950fd8621cb410865e8800ccb6873)

4 years agoUse KNOWN_PACKAGES when shared lib consumers
Patrick Baumann [Thu, 10 Oct 2019 22:50:28 +0000 (15:50 -0700)]
Use KNOWN_PACKAGES when shared lib consumers

This change ensures we find ALL known packages that could be consuming a
shared library, not only currently installed ones. Without this check,
the system may get into a state in which we have currently uninstalled
but on-device apps that depend on a shared library that does not exist
on device.

This change also leaves static shared library packages on device even if
it's not installed for any of the remaining users as it could still be
used, but marked uninstalled for users in which it is consumed.

Bug: 141413692
Bug: 142083996
Test: Manual; attempt to remove shared lib after marking its consumer uninstalled.
Test: atest StaticSharedLibsHostTests
Change-Id: Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea
Merged-In: Id4e37c3e4d3ea3ad5fddae5d2c7305e56f50eeea
(cherry picked from commit 08315953bc42fb392c32293418dfb2a3e4ffbe53)

4 years agoHandles null outInfo in deleteSystemPackageLI
Patrick Baumann [Fri, 23 Aug 2019 20:50:23 +0000 (13:50 -0700)]
Handles null outInfo in deleteSystemPackageLI

This change adds null checks before accessing outInfo in
deleteSystemPackageLI.

Bug: 142083996
Bug: 141413692
Test: manual; remove static dependency on eng build and reboot
Change-Id: If0fd48343e89cbb77ccd25826656194195d5b0cd
(cherry picked from commit 17471016508bb9c9ffb8c3946dda0b4897d722f1)
Merged-In: If0fd48343e89cbb77ccd25826656194195d5b0cd
(cherry picked from commit 6afabce549f5725988b9c03de932c34e9d22f10e)

4 years agoFix security problem on PermissionMonitor#hasPermission
paulhu [Mon, 16 Dec 2019 10:24:05 +0000 (18:24 +0800)]
Fix security problem on PermissionMonitor#hasPermission

PermissionMonitor#hasPermission only checks permssions that app
requested but it doesn't check whether the permission can be
granted to this app. If requested permission doens't be granted
to app, this method still returns that app has this permission.
Then PermissionMonitor will pass this info to netd that means
this app still can use network even restricted network without
granted privileged permission like CONNECTIVITY_INTERNAL or
CONNECTIVITY_USE_RESTRICTED_NETWORKS.

Bug: 144679405
Test: Build, flash, manual test
Change-Id: Iae9c273af822b18c2e6fce04848a86f8dea6410a
Merged-In: I8a1575dedd6e3b7a8b60ee2ffd475d790aec55c4
Merged-In: I2da730feda4d7ebed1f158b073167bb3964b3e7d
(cherry picked from commit d0205a3469dc8d8122e89072c19d0e9f18e7452f)

4 years agoSupport strict mode private DNS on VPNs that provide Internet.
Lorenzo Colitti [Fri, 10 May 2019 11:33:43 +0000 (04:33 -0700)]
Support strict mode private DNS on VPNs that provide Internet.

Currently, strict mode private DNS does not work on VPNs because
NetworkMonitor does not validate VPNs. When a VPN connects, it
immediately transitions to ValidatedState, skipping private DNS
hostname resolution.

This change makes NetworkMonitor perform private DNS hostname
resolution and evaluation even on VPNs.

In order to ensure that the system always immediately switches to
the VPN as soon as it connects, remove the unvalidated penalty
for VPN networks. This ensures that the VPN score is always 101
and the VPN always outscores other networks as soon as it
connects. Previously, it would only outscore other networks
when no-op validation completed.

Backport of 414b8c8b1ce8ae2ad6ef95c1ffba19062077d3e6.

Bug: 122652057
Test: atest FrameworksNetTests
Test: manually ran a VPN with private DNS in strict mode
Test: atest android.net.cts.ConnectivityManagerTest com.android.cts.net.HostsideVpnTests
Change-Id: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
(cherry picked from commit 029d9ea11921b7ca5652d24a9563b66c2b70fafc)

4 years agoAdd test coverage for strict mode private DNS.
Lorenzo Colitti [Fri, 25 Oct 2019 16:20:57 +0000 (01:20 +0900)]
Add test coverage for strict mode private DNS.

Support faking out the DNS lookups used by NetworkMonitor to
resolve strict mode DNS, and add more test coverage.

These tests were partly adapted from tests we have in Q but
also contain new coverage. This is because in Q the interface
between ConnectivityService and NetworkMonitor changed
substantially, and it is impractical to backport
NetworkMonitorTest.

Bug: 122652057
Test: atest FrameworksNetTests
Change-Id: I6497b7efa539267576d38d3036eef0af0df4e9cb
Merged-In: Iaa78a7edcf23755c89d7b354edbc28d37d74d891
(cherry picked from commit 60cd85533d3a9ad4e3758de4804d1716e7fe0371)

4 years agoRESTRICT AUTOMERGE
Sterling Huber [Thu, 7 Nov 2019 19:04:03 +0000 (11:04 -0800)]
RESTRICT AUTOMERGE
Make toasts non-clickable

Since enforcement was only on client-side, in Toast class, an app could
use reflection (or other means) to make the Toast clickable. This is a
security vulnerability since it allows tapjacking, that is, intercept touch
events and do stuff like steal PINs and passwords.

This CL brings the enforcement to the system by applying flag
FLAG_NOT_TOUCHABLE.

Test: atest CtsWindowManagetDeviceTestCases:ToastTest
Test: Construct app that uses reflection to remove flag FLAG_NOT_TOUCHABLE and
      log click events. Then:
      1) Observe click events are logged without this CL.
      2) Observer click events are not logged with this CL.
Bug: 128674520

Change-Id: Ica346c853dcb9a1e494f7143ba1c38d22c0003d0
(cherry picked from commit 6bf18c39d9fc727523fa3201567b836032bb2114)

4 years agoDO NOT MERGE back porting for fixing sysui direct reply
Yohei Yukawa [Sat, 19 Jan 2019 19:49:37 +0000 (11:49 -0800)]
DO NOT MERGE back porting for fixing sysui direct reply

Root cause: systemui run as user 0 service to handle all of users'
notifications. And, the users can user the copy/cut/paste
functionality.

Solution: To crate @hide API in TextView let SystemUI to mark the
TextView instance should check if the power of
INTERACT_ACROSS_USER_FULL is needed to be restricted.
e.x. Keyguard password textview/Notificaiton entries

Bug: 123232892
Test: manual test
Reference: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Reference: Ibabe13e5b85e5bb91f9f8af6ec07c395c25c4393
Reference: I975baa748c821538e5a733bb98a33ac609bf40a7

Change-Id: I6d11e4d6a84570bc2991a8552349e8b216b0d139
Merged-In: Ie3daecd1e8fc2f7fdf37baeb5979da9f2e0b3937
(cherry picked from commit 08391b3da7e2da3b0220eb5766e0a1774d28e9a5)

4 years agoRESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView.
Abodunrinwa Toki [Fri, 2 Aug 2019 17:35:50 +0000 (18:35 +0100)]
RESTRICT AUTOMERGE Disable TextClassifier for RemoteInputView.

Sys UI runs in the primary user. This means that TextView components
such as RemoteInputView and KeyguardPasswordView running in it could
leak data across users.

This CL disables the TextClassifier for RemoteInputView.
It also logs when fixed issue is "potentially" exercised.
There is no need to explicitly disable the TextClassifier for
KeyguardPasswordView. It is a password field
(TYPE_CLASS_TEXT | TYPE_TEXT_VARIATION_PASSWORD) and the
TextClassifier does not run for such fields.

Test: manually attempt to excercise the bug.
      See the bug in 123232892 for more information.

Bug: 136483597
Bug: 123232892
Change-Id: Ia1e4843d1505e204f2e78d2459da198c9988f7f2
(cherry picked from commit 579abbd2d8ad37c4e07e1396002ad5be5bd41365)

4 years agoDO NOT MERGE: Disable SpellChecker in secondary user's direct reply
Tarandeep Singh [Mon, 1 Jul 2019 21:27:25 +0000 (14:27 -0700)]
DO NOT MERGE: Disable SpellChecker in secondary user's direct reply

For secondary users, when AOSP keyboard is used to type in
direct-reply, unknown words can be added to dictionary.
It's *not* OK for SpellCheckerService of primary user to
check unknown words typed by a secondary user.
The dialog to add these words shows up in primary user instead.

TextView uses TextView#isSuggestionsEnabled() to determine if
SpellChecker is enabled. This can be disabled by setting the flag
TYPE_TEXT_FLAG_NO_SUGGESTIONS in inputType.

Note: This doesn't affect workprofile users on P or older versions since
they use same SpellCheckerService for all workprofiles.

Bug: 123232892
Test: Manually tested using the steps mentioned in the bug.
 1. Flash latest P build.
 2. Install AOSP keyboard (LatinIME) and set it as default.
 3. Install and open EditTextVariations
 4. Initiate direct reply in primary user and type non-english
    words like "ggggg hhhhh".
 5. Observe that they get red underline and tapping it brings "add
    to dictionary" popup.
 6. Create a new secondary user and switch to it.
 7. Once the setup completes, initiate a direct reply and type words
    similar to step 4.
 8. Verify that red underlines dont appear.
 9. switch back to primary user and verify direct reply still has red
    underlines.

Change-Id: I93918eb2c12e37908e03a7951a9e2c5375bc0ecc
(cherry picked from commit b5c0e01aca6f19ae3e305ce6d1c1ecec6aba0532)

4 years agoPrevent system uid component from running in an isolated app process
Jing Ji [Mon, 4 Nov 2019 22:22:27 +0000 (14:22 -0800)]
Prevent system uid component from running in an isolated app process

Bug: 140055304
Test: Manua
Change-Id: Ie7f6ed23f0c6009aad0f67a00af119b02cdceac3
Merged-In: I5a1618fab529cb0300d4a8e9c7762ee218ca09eb
(cherry picked from commit 0bfebadf304bdd5f921e80f93de3e0d13b88b79c)

4 years agoOnly allow INSTALL_ALLOW_TEST from shell or root
Todd Kennedy [Fri, 20 Sep 2019 20:45:15 +0000 (13:45 -0700)]
Only allow INSTALL_ALLOW_TEST from shell or root

Bug: 141169173
Test: Manual. App can't be installed as test-only
Change-Id: Ib6dcca7901aa549d620448c0165c22270a3042be
Merged-In: Ib6dcca7901aa549d620448c0165c22270a3042be
(cherry picked from commit 702d394762a9b162cb2a2b04bb726fd8053f24d3)

4 years agoDO NOT MERGE Validate wallpaper dimension while generating crop
Ahan Wu [Thu, 26 Sep 2019 10:29:59 +0000 (18:29 +0800)]
DO NOT MERGE Validate wallpaper dimension while generating crop

If dimensions of cropped wallpaper image exceed max texture size that
GPU can support, it will cause ImageWallpaper keep crashing
because hwui crashes by invalid operation (0x502).

Bug: 120847476.
Test: Write a custom app to set a 8000x800 bitmap as wallpaper.
Test: The cropped file will be 29600x2960 and make sysui keep crashing.
Test: After applyed this cl, wallpaper will use fallback.
Test: Sysui will not keep crashing any more.
Change-Id: I8ed5931298c652a2230858cf62df3f6fcd345c5a
(cherry picked from commit f1e1f4f04d0165ed065637a4ba556583a7c79ef0)

4 years agoRESTRICT AUTOMERGE
Seigo Nonaka [Wed, 16 Oct 2019 21:48:30 +0000 (14:48 -0700)]
RESTRICT AUTOMERGE
Revive runLimit check logic

The runLimit check logic was accidentally removed by
I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735

Bug: 142134328
Bug: 140632678
Test: Manually done with reported step
Test: StaticLayoutTest passes
Change-Id: Ib1d5efdcb9adcc18a6a43370dc016ea464f48148
(cherry picked from commit fd1a7e8663feb23ba912e1c519630a2385b452fc)

4 years agoForce FGS notifications to show for a minimum time
Evan Laird [Fri, 4 Oct 2019 18:18:59 +0000 (14:18 -0400)]
Force FGS notifications to show for a minimum time

It's possible for a service to do a start/stop foreground and cause a
couple of things to happen:

NotificationManagerService will enqueue a EnqueueNotificationRunnable,
post a PostNotificationRunnable (for the startForeground), and then also
enqueue a CancelNotificationRunnable. There is some racy behavior here
in that the cancel runnable can get triggered in between enqueue and
post runnables. If the cancel happens first, then
NotificationListenerServices will never get the message.

This behavior is technically allowed, however for foreground services we
want to ensure that there is a minmum amount of time that notification
listeners are aware of the foreground service so that (for instance) the
FGS notification can be shown.

This CL does two things to mitigate this problem:

1. Introduce checking in the CancelNotificationRunnable such that it
will not cancel until after PostNotificationRunnable has finished
executing.

2. Introduce a NotificationLifetimeExtender method that will allow a
lifetime extender to manage the lifetime of a notification that has been
enqueued but not inflated yet.

Bug: 119041698
Test: atest NotificationManagerServiceTest
Test: atest ForegroundServiceLifetimeExtenderTest
Change-Id: I0680034ed9315aa2c05282524d48faaed066ebd0
Merged-In: I0680034ed9315aa2c05282524d48faaed066ebd0
(cherry picked from commit 3b8c4743f630dcd370bfc5dc9683b551983fbe28)

4 years agoRESTRICT AUTOMERGE
Seigo Nonaka [Mon, 16 Sep 2019 21:49:49 +0000 (14:49 -0700)]
RESTRICT AUTOMERGE
Do not compute outside given range in TextLine

This is second attempt of I646851973b3816bf9ba32dfe26748c0345a5a081
which breaks various layout test on application.
The empty string must be also handled by the TextLine since it
retrieves the default line height from the empty string.

Bug: 140632678
Test: StaticLayoutTest
Test: Manually done
Change-Id: I7089ed9b711dddd7de2b27c9c2fa0fb4cb53a735
(cherry picked from commit f582b9bc9834c80f48070b032637dd1c94ebe6f4)

4 years agoDO NOT MERGE revoke certain app-ops on suspend
Suprabh Shukla [Fri, 13 Sep 2019 00:35:22 +0000 (17:35 -0700)]
DO NOT MERGE revoke certain app-ops on suspend

Revoking an apps authorizations to use camera and record or play audio
while suspended. Appops watchers will also be notified of this change to
re-evaluate privileges at the time of suspension.

Test: atest FrameworksServicesTests:SuspendPackagesTest

Bug: 138636979
Change-Id: Ie95555856afdd56728125f7e60b6a78cf9fc0e58
Merged-In: Ie95555856afdd56728125f7e60b6a78cf9fc0e58
Merged-In: Ic5fb1807deceabfd956b666fa76f8bcc94020ac3
(cherry picked from commit ed5edb77dcdbf0e65acb58188698027036fb8d05)

4 years agoRESTRICT AUTOMERGE
Jeff Sharkey [Tue, 16 Jul 2019 22:50:42 +0000 (16:50 -0600)]
RESTRICT AUTOMERGE
Strict SQLiteQueryBuilder needs to be stricter.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change offers setStrictGrammar() to prevent this by outright
blocking subqueries in WHERE and HAVING clauses, and by requiring
that GROUP BY and ORDER BY clauses be composed only of valid columns.

This change also offers setStrictColumns() to require that all
untrusted column names are valid, such as those in ContentValues.

Relaxes to always allow aggregation operators on returned columns,
since untrusted callers can always calculate these manually.

Bug: 135270103
Bug: 135269143
Test: atest android.database.sqlite.cts.SQLiteQueryBuilderTest
Test: atest FrameworksCoreTests:android.database.sqlite.SQLiteTokenizerTest
Exempt-From-Owner-Approval: already approved in downstream branch
Change-Id: I6290afd19c966a8bdca71c377c88210d921a9f25
(cherry picked from commit 216bbc2a2e4f697d88f8fd633646e3c0433246f1)

4 years agoSet default phonebook access to ACCESS_REJECTED when user didn't choose
Zongheng Wang [Thu, 5 Sep 2019 20:44:28 +0000 (13:44 -0700)]
Set default phonebook access to ACCESS_REJECTED when user didn't choose
one

When there's no users' choice to tell us whether to share their
phonebook information to the Bluetooth device, set the phonebook access
permission to ACCESS_REJECTED.

Bug: 138529441
Test: Manual test
Change-Id: Iefabeb731b941f09fe1272ac7b7cd2feba75c8df
Merged-In: Iefabeb731b941f09fe1272ac7b7cd2feba75c8df
(cherry picked from commit 9b3cb0f06b7c4907c293aa65e68c7ed6e4962d4b)

4 years agoRESTRICT AUTOMERGE
Jeff Sharkey [Thu, 18 Jul 2019 00:51:28 +0000 (18:51 -0600)]
RESTRICT AUTOMERGE
Enable stricter SQLiteQueryBuilder options.

Malicious callers can leak side-channel information by using
subqueries in any untrusted inputs where SQLite allows "expr" values.

This change starts using setStrictColumns() and setStrictGrammar()
on SQLiteQueryBuilder to block this class of attacks.  This means we
now need to define the projection mapping of valid columns, which
consists of both the columns defined in the public API and columns
read internally by DownloadInfo.Reader.

We're okay growing sAppReadableColumnsSet like this, since we're
relying on our trusted WHERE clause to filter away any rows that
don't belong to the calling UID.

Remove the legacy Lexer code, since we're now internally relying on
the robust and well-tested SQLiteTokenizer logic.

Bug: 135270103
Bug: 135269143
Test: atest DownloadProviderTests
Test: atest CtsAppTestCases:android.app.cts.DownloadManagerTest
Change-Id: Iec1e8ce18dc4a9564318e0473d9d3863c8c2988a
(cherry picked from commit 382d5c0c199f3743514e024d2fd921248f7b14b3)

4 years agofixes a security vulnerability in slice provider
Pinyao Ting [Thu, 8 Aug 2019 22:35:20 +0000 (15:35 -0700)]
fixes a security vulnerability in slice provider

Bug: 138441555
Test: Manual
Change-Id: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
Merged-In: Ib1b4fba54ebd3599fe11021d21dc9b09d34e8965
(cherry picked from commit 2b415a4c4465a6294e51ad1a8fcf2e6c1497853b)
(cherry picked from commit 46368e4f5cf4ff4582942bcc8ab23636c702daa3)

4 years agoAdd MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc).
Jonathan Scott [Tue, 25 Jun 2019 09:58:06 +0000 (10:58 +0100)]
Add MANAGED_PROVISIONING_DPC_DOWNLOADED (nyc).

Test: Just adding a constant
Bug: 132261064
Change-Id: I1527be03a10fa1a2fde09e3e41d6b7e83a986fc0
Merged-In: I2bce277ff8f2de4614e19d5385fe6712b076f9c9
(cherry picked from commit 20e5d92613268c196b508865b7275b59f00688f5)

4 years ago[RESTRICT AUTOMERGE] Pass correct realCallingUid to startActivity() if provided by...
Bryan Ferris [Wed, 5 Jun 2019 01:02:55 +0000 (18:02 -0700)]
[RESTRICT AUTOMERGE] Pass correct realCallingUid to startActivity() if provided by PendingIntentRecord#sendInner()

Previously we'd ignore realCallingPid and realCallingUid that
PendingIntentRecord#sendInner() provided to startActivityInPackage().
Now we correctly pass it on, preserving past behaviour if none
provided.

Test: manual; we added logging statements to check the value of realCallingUid
in startActivitiesMayWait when launching the calendar app from the calendar widget
and verified that it was the calendar uid rather than the system uid.

Bug: 123013720
Change-Id: If0c0b67880c2e7a8774f31fbb1ba5f50544d2972
(cherry picked from commit b255e64a5d282f860bd58ae8f85158b5badce7ba)

4 years agoOP_REQUEST_INSTALL_PACKAGES denied by default
Christopher Dombroski [Tue, 16 Apr 2019 20:21:39 +0000 (13:21 -0700)]
OP_REQUEST_INSTALL_PACKAGES denied by default

Some system apps may download unknown content and the user should
be explicitly asked whether they trust these files. System apps should
explicitly use the extra NOT_UNKNOWN_SOURCE to bypass this check.

Test: Builds, boots, existing tests pass:
atest CtsPackageInstallTestCases

Locally verified they pass if CtsPackageInstallTestCases.apk was signed by
the platform cert.

Bug: 123700348
Change-Id: I3028bf8ff3f79a41521deeee43fba3c32bb1b2ca
Merged-In: I2578251906f6656b83464d1c4fc4db99165841c9
(cherry picked from commit 43e682abef2a1c65585bef510c390480f0c4a2fd)

4 years agoDO NOT MERGE Fix display freezing when screen size mismatches
Jorim Jaggi [Wed, 22 Aug 2018 13:43:17 +0000 (15:43 +0200)]
DO NOT MERGE Fix display freezing when screen size mismatches

If we have a display size change, make sure to set different
scaling mode such that we can show the buffer even if there is
a size mismatch.

Test: Rotate screen
Test: Change cutout type
Bug: 112876936
Change-Id: Iedc7774d69730a95b98ba46d4f274bc3b7e66bd1
(cherry picked from commit da4997312c79bfb5b5c6fb31833fc2ce401c4457)

4 years agoFix Layout.primaryIsTrailingPreviousAllLineOffsets
Mihai Popa [Tue, 25 Jun 2019 10:15:18 +0000 (11:15 +0100)]
Fix Layout.primaryIsTrailingPreviousAllLineOffsets

The CL fixes a crash in Layout.primaryIsTrailingPreviousAllLineOffsets.
The crash was happening when the method was called for a line beginning
with an empty bidi run. This could happen, for example, for empty text -
I was unable to find any other case. The CL improves the existing test
for the method with this case, which was previously crashing.

The CL also fixes a potential crash in getLineHorizontals. However, this
bug could never happen as in the current code path clamped is always
false (and kept as parameter for parity with getHorizontal).

Bug: 135444178
Bug: 78464361
Test: atest FrameworksCoreTests:android.text.LayoutTest\#testPrimaryIsTrailingPrevious
Change-Id: I47157abe1d74675884734e3810628a566e40c1b4
(cherry picked from commit 7ad499d00716f45fffdf7331493ed21d1b8d9b77)
(cherry picked from commit 9109ce6b0af6fc94b79cf855a10d85e107c768c2)

4 years agoHidProfile: sync isPreferred() with HidHostService
Chienyuan [Tue, 9 Jul 2019 07:09:56 +0000 (15:09 +0800)]
HidProfile: sync isPreferred() with HidHostService

HidHostService allow to connect when priority is PRIORITY_UNDEFINED.
HidProfile should return ture when priority is PRIORITY_UNDEFINED.
Otherwise, the "Input device" toggle in off state when HID device
connected.

Bug: 132456322
Test: manual
Change-Id: Id7bae694c57aec17e019d591c0a677e3cb64f845
(cherry picked from commit 830217f277e31e63d9ab8acd21ee2a8f81ee1c8f)

4 years ago[RESTRICT AUTOMERGE] Correct argument order in permission check
Bryan Ferris [Thu, 27 Jun 2019 21:39:46 +0000 (14:39 -0700)]
[RESTRICT AUTOMERGE] Correct argument order in permission check

The function 'checkAccess' recieves the uid and pid in that order and
forwards them to checkSlicePermission in the same order. However,
checkSlicePermission expects them in the opposite order.

Bug: 135551349
Test: atest FrameworksUiServicesTests
Change-Id: I6e49efeab08f0e2a29d9830e6f81905598ae410c
(cherry picked from commit d2432fc3e35eacb308b620174849b29aa74eee05)

4 years agoClear the Parcel before writing an exception during a transaction
Michael Wachenschwanz [Thu, 16 May 2019 05:58:15 +0000 (22:58 -0700)]
Clear the Parcel before writing an exception during a transaction

This prevents any object data from being accidentally overwritten by the
exception, which could cause unexpected malformed objects to be sent
across the transaction.

Test: atest CtsOsTestCases:ParcelTest#testExceptionOverwritesObject
Bug: 34175893
Change-Id: Iaf80a0ad711762992b8ae60f76d861c97a403013
Merged-In: Iaf80a0ad711762992b8ae60f76d861c97a403013
(cherry picked from commit f8ef5bcf21c87d8617f5e11810cc94350298d114)

4 years ago[RESTRICT AUTOMERGE] Protect VPN dialogs against overlay.
Chalard Jean [Mon, 20 May 2019 04:11:37 +0000 (13:11 +0900)]
[RESTRICT AUTOMERGE] Protect VPN dialogs against overlay.

Bug: 130568701
Test: manual. After this, can't display on top of it
Change-Id: Ib032f800edb0416cc15f01a34954340d0d0ffa78
(cherry picked from commit 4e80dc2861614d25a1f957f50040a8cf04812d11)
(cherry picked from commit 27d47340496580d66f36a734a115e47eaf550972)

4 years agoDO NOT MERGE SurfaceControl: Fix captureLayers JNI
Robert Carr [Tue, 9 Apr 2019 14:42:02 +0000 (07:42 -0700)]
DO NOT MERGE SurfaceControl: Fix captureLayers JNI

Missed a call-point in last refactoring.

This CL should have been included in https://googleplex-android-review.git.corp.google.com/q/topic:%22bp-secure-screen-rotation%22+(status:open%20OR%20status:merged)

Bug: 130211665
Bug: 133054270
Test: Manual
Change-Id: I43fa93eea7d79f5b773497e3bb65750866eca2cb
(cherry picked from commit bf9298f1c9b848ff0db4ae0be3913ad531bafa9e)
(cherry picked from commit fbc22c2b6d54a8a9b589746be67d3992f01212cc)

4 years agoClean up ProcessRecord when reuse a pid.
Hui Yu [Fri, 17 May 2019 20:39:52 +0000 (13:39 -0700)]
Clean up ProcessRecord when reuse a pid.

When Zygote starts a process with a pid, system_server may have this
pid associate with a old process which is killed by the OS but
system_server has not finished cleanup. In this case, clean up the old
ProcessRecord so the new process can use the pid.

This problem is exposed because the asynchronous process start change.
attachApplicationLocked() may happen before handleProcessStartedLocked() and
the mPidsSelfLocked may still have the old ProcessRecord associate with
the new process's pid.

Bug: 131105245
Test: POC test steps in b/131105245.
Change-Id: I775acda5147291d0cf9836b6ffb3f52d1bf9bffe
Merged-In: I775acda5147291d0cf9836b6ffb3f52d1bf9bffe
Merged-In: I5d421f6c68f6b3437d51c94f4aef77e08a7bf002
(cherry picked from commit 3d47e0ceca4e6528a1bec2a7e94a833b8951d93a)

4 years agoUpdate API docs for TelecomManager#endCall.
Tyler Gunn [Tue, 14 May 2019 18:08:06 +0000 (11:08 -0700)]
Update API docs for TelecomManager#endCall.

Make it clear that ending an emergency call is not possible with this
method.

Test: Compile; this is a docs change.
Bug: 132438333
Change-Id: I736b90e31723ee2055cedf16142c4d0f494bf49b
(cherry picked from commit 3acf511895d8d19d5f9189d0159ae1d677a89a42)

4 years ago[RESTRICT AUTOMERGE] Fix NullPointerException when mLockPatternUtils is not set.
Jonathan Scott [Mon, 13 May 2019 12:14:19 +0000 (13:14 +0100)]
[RESTRICT AUTOMERGE] Fix NullPointerException when mLockPatternUtils is not set.

Test: atest LockTaskControllerTest
Bug: 132593073
Change-Id: I1bfacd5992569d67cdaa526b18d1c426a366babb
(cherry picked from commit fa1b986746ad7d9ebab6a34a0bfafd0a93267d5b)

4 years ago[RESTRICT AUTOMERGE] Make LockTaskController default behaviour match ScreenPinningSet...
Jonathan Scott [Mon, 29 Apr 2019 17:03:58 +0000 (18:03 +0100)]
[RESTRICT AUTOMERGE] Make LockTaskController default behaviour match ScreenPinningSettings.

Fixes: 127605586
Test: atest LockTaskControllerTest
Change-Id: I7d4c53fd6740f500d1a0ce18b47b83ed895300a5
(cherry picked from commit 5d6c1e8f451a920695e92fd321bbffe9c75f9aaa)

4 years ago[RESTRICT AUTOMERGE] Careful with screenshots containing secure layers!
Robert Carr [Tue, 2 Apr 2019 21:18:56 +0000 (14:18 -0700)]
[RESTRICT AUTOMERGE] Careful with screenshots containing secure layers!

For purposes of the screen rotation animation the system server is allowed
to capture secure (not protected) layers and trusted not to persist screenshots
which may contain secure layers. However when displaying the screen rotation animation,
the layer the screenshot is placed on will itself not be secure, so if we record
the animation the recording will contain persisted versions of the secure content. Make sure
we use the new API from SurfaceFlinger to set FLAG_SECURE if our screenshot contains secure
content.

Bug: 69703445
Test: Transaction_test#SetFlagsSecureEUidSystem
Change-Id: I0dd36462867da52e6b1451f65f56c2c5d37538f3
(cherry picked from commit bab740f10e0812ba47d19931fdfe2fa7e02bbd0c)

4 years agoRevert "[RESTRICT AUTOMERGE] Careful with screenshots containing secure layers!"
Nikoli Cartagena [Tue, 11 Jun 2019 01:26:23 +0000 (18:26 -0700)]
Revert "[RESTRICT AUTOMERGE] Careful with screenshots containing secure layers!"

This reverts commit 0877ed0c116242b9dbab30954e4f130e4c68e0a0.

5 years ago[RESTRICT AUTOMERGE] Careful with screenshots containing secure layers!
Robert Carr [Tue, 2 Apr 2019 21:18:56 +0000 (14:18 -0700)]
[RESTRICT AUTOMERGE] Careful with screenshots containing secure layers!

For purposes of the screen rotation animation the system server is allowed
to capture secure (not protected) layers and trusted not to persist screenshots
which may contain secure layers. However when displaying the screen rotation animation,
the layer the screenshot is placed on will itself not be secure, so if we record
the animation the recording will contain persisted versions of the secure content. Make sure
we use the new API from SurfaceFlinger to set FLAG_SECURE if our screenshot contains secure
content.

Bug: 69703445
Test: Transaction_test#SetFlagsSecureEUidSystem
Change-Id: I0dd36462867da52e6b1451f65f56c2c5d37538f3
(cherry picked from commit bab740f10e0812ba47d19931fdfe2fa7e02bbd0c)

5 years ago[RESTRICT AUTOMERGE]: Exclude secure layers from most screenshots taken by the system...
Robert Carr [Fri, 15 Feb 2019 23:48:11 +0000 (15:48 -0800)]
[RESTRICT AUTOMERGE]: Exclude secure layers from most screenshots taken by the system server.

In pre-P versions of Android, it was allowed to screenshot secure layers if the
buffer queue producer which was the target of the screenshot was owned by
the system (in this case SurfaceFlinger). This really was a synonym for:
The screen rotation animation was allowed to capture secure layers, but the other
code paths weren't. In O we mistakenly changed this check to always allow the system server
to capture secure layers via the captureScreen path (the captureLayers path used for
TaskSnapshots was unaffected). This can result in data leakage in cases where the
system server takes screenshots on behalf of other parts of the system (e.g. for
the assistant). To mitigate this we provide an explicit switch for the system server
to specify whether it wishes to capture Secure layers. While this is dangerous, I think
it is less dangerous than the previous implicit switch of capturing secure layers based on which
type of BufferQueue was passed in. The flag defaults to not capturing secure layers
and we set it to true in the one place we need it (for the screen rotation animation).
Non privileged clients can still not capture secure layers at all directly.

Test: TransactionTest.cpp#SetFlagsSecureEUidSystem
Bug: 120610669
Change-Id: I9d32c5ac2b005059be9f464859a415167d9ddbd4
(cherry picked from commit dc49e0088a05108a0616704ca5565136f89c0a1f)

5 years agoHwBlob: s/malloc/calloc/
Steven Moreland [Thu, 18 Apr 2019 23:32:42 +0000 (16:32 -0700)]
HwBlob: s/malloc/calloc/

Since this blob is passed between processes.

We could potentially only memset portions of the blob as it is
written to. However, the JHwBlob API itself doesn't have to have
writes in order (even though known usages of it do write in order).
Because of this, keeping track of which bytes to pad would be too
expensive.

Bug: 131356202
Test: boot, hidl_test_java
Change-Id: I48f4d7cb20c4bfe747dd323ae3744d323ad097c9
Merged-In: I48f4d7cb20c4bfe747dd323ae3744d323ad097c9
(cherry picked from commit d8157bc094569bee74976df2585d632f1793e226)

5 years agoSUPL ES Extension - June 2019 rollup
Greg Wroblewski [Fri, 19 Apr 2019 21:04:01 +0000 (14:04 -0700)]
SUPL ES Extension - June 2019 rollup

Bug: 112159033
ASB: 2019-06
Change-Id: Iaf4b0295e726658852272de1cf857d9d55b63276

5 years agoAdd cross user permission check - areNotificationsEnabledForPackage
Julia Reynolds [Wed, 27 Mar 2019 16:15:57 +0000 (12:15 -0400)]
Add cross user permission check - areNotificationsEnabledForPackage

Test: atest
Fixes: 128599467
Change-Id: I13a0ca7590f8c4b44379730e0ee2088aba400c2a
Merged-In: I13a0ca7590f8c4b44379730e0ee2088aba400c2a
(cherry picked from commit 657d164136199126ae241848887de0230699cea0)
(cherry picked from commit 63846a7093ca7c6d89b73fc77bdff267b3ecb4ef)

5 years agoLimit IsSeparateProfileChallengeAllowed to system callers
Pavel Grafov [Wed, 10 Apr 2019 11:47:25 +0000 (12:47 +0100)]
Limit IsSeparateProfileChallengeAllowed to system callers

Fixes: 128599668
Test: build, set up separate challenge
Change-Id: I2fef9ab13614627c0f1bcca04759d0974fc6181a
(cherry picked from commit 1b6301cf2430f192c9842a05fc22984d782bade9)

5 years agoAdded missing permission check to isPackageDeviceAdminOnAnyUser.
Varun Shah [Wed, 20 Mar 2019 18:10:33 +0000 (11:10 -0700)]
Added missing permission check to isPackageDeviceAdminOnAnyUser.

Added a check for the MANAGE_USERS permission to
PackageManagerService#isPackageDeviceAdminOnAnyUser.

To test that the method is still usable:
1) Enable virtual storage via: adb shell sm set-virtual-disk true
2) Follow instructions by clicking on notification to set up virtual storage
3) Go to Settings -> Apps & notifications -> See all X apps
4) Click on any non-system app (example Instagram)
5) Tap Storage and you should see a "Change" button (if not, choose another app)
6) Tap Change and you should see Internal and Virtual storage options listed
7) The above step confirms the method is still usable by Settings

Bug: 128599183
Test: SafetyNet logging (steps listed above)
Change-Id: I989f1daf52a71f6c778ebd81baa6f1bf83e9a718
Merged-In: I36521fa43daab399e08869647326a7ac32d1e512
(cherry picked from commit 18e7dedf6c35f07daf8b7239d501737745ac7f43)

5 years agoDO NOT MERGE Atoms: Add BluetoothClassicPairingEvent
Jack He [Thu, 21 Mar 2019 00:38:11 +0000 (17:38 -0700)]
DO NOT MERGE Atoms: Add BluetoothClassicPairingEvent

* Add BluetoothClassicPairingEvent to log pairing and encryption
  related statistics

Bug: 124301137
Test: test drive with statsd
Change-Id: Idca6f6d340e03af91c5a6fb4102666d44167635b
(cherry picked from commit 6110c95184c6ca0265ebc39235ca81da21c0483d)

5 years agoDO NOT MERGE - SUPL ES Extension - Safer Init and Not After Boot
WyattRiley [Thu, 28 Feb 2019 20:05:56 +0000 (12:05 -0800)]
DO NOT MERGE - SUPL ES Extension - Safer Init and Not After Boot

Safe order of pointer setting and background thread start
Verifying mCallEndElapsedRealtimeMillis is not the initial value

Bug: 112159033
Bug: 115361555
Bug: 125124724
Test: Verified not-after-boot with test code b/115361555#comment14
Test: Reproed NPE with test thread sleep and verify fix
Change-Id: I25dcd5a5b36c218ea8b7ab88d6909382709fd7ab
(cherry picked from commit fbcb41f9fbc4e91e023f3103a391182600312ef7)

5 years agoRevert "Adding SUPL NI Emergency Extension Time"
JP Sugarbroad [Mon, 25 Feb 2019 21:55:49 +0000 (13:55 -0800)]
Revert "Adding SUPL NI Emergency Extension Time"

This reverts commit 13d3aecd1b00d4a0b323d007e997d2546d2babc4.

5 years agoDPM: Fix regression from I54376f60ac53451ace22965d331b47cd8c2e614e
Adrian Roos [Mon, 7 Jan 2019 15:57:31 +0000 (16:57 +0100)]
DPM: Fix regression from I54376f60ac53451ace22965d331b47cd8c2e614e

Fixes an issue where setting a password via DPM would never
satisfy a QUALITY_COMPLEX password requirement.

Change-Id: I3fbc952bd44291ac22728c626b128fc0c1aae232
Merged-In: I3fbc952bd44291ac22728c626b128fc0c1aae232
Fixes: 120915644
Bug: 110172241
Test: atest 'com.android.cts.devicepolicy.DeviceAdminHostSideTestApi24#testRunDeviceOwnerPasswordTest'
Test: Set credential via DPM.resetPassword(), factory reset device to trigger FRP, verify FRP shows.
(cherry picked from commit ea8d82c08a9d489a48ef810d7c40a4d20f806aa0)
(cherry picked from commit b122ae9660526c83d4a7bf1c1f99107afee23001)

5 years agoRESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.
Abodunrinwa Toki [Thu, 29 Nov 2018 13:51:56 +0000 (13:51 +0000)]
RESTRICT AUTOMERGE Do not linkify text with RLO/LRO characters.

Also don't show smart actions for selections in text with unsupported
characters.

Bug: 116321860
Test: atest android.view.textclassifier.TextClassificationManagerTest \
            android.text.util.cts.LinkifyTest \
    android.text.util.LinkifyTest \
    android.widget.TextViewActivityTest

Change-Id: I01b5e936aa4dfc937a98f50e9fc8171666861a61
(cherry picked from commit a69950ce18f85ea8514083a5e175450e17e93565)

5 years agoAdding SUPL NI Emergency Extension Time
WyattRiley [Thu, 6 Dec 2018 19:43:58 +0000 (11:43 -0800)]
Adding SUPL NI Emergency Extension Time

Configurable by carrier config.xml resource

Bug: 118839234
Bug: 115361555
Bug: 112159033
Test: On device, see b/115361555#comment14
Change-Id: I52e61656cca8b6fa6468d32d2e69bf60f4c83c61
(cherry picked from commit a725dd6650846090f70ed9811f1a94f036ab3f29)

5 years agoFRP: save password quality in DPM.resetPassword
Adrian Roos [Thu, 6 Dec 2018 16:50:41 +0000 (17:50 +0100)]
FRP: save password quality in DPM.resetPassword

When setting a password from DPM.resetPassword(), the actual quality of the
password was not passed to LockSettingsService (instead, the minimum required
quality was passed which is often UNSPECIFIED). As a result, during FRP we
would see inconsistent state and skip it.

Bug: 110172241
Test: Set credential via DPM.resetPassword(), factory reset device to trigger FRP, verify FRP shows.
Change-Id: I54376f60ac53451ace22965d331b47cd8c2e614e
Merged-In: I54376f60ac53451ace22965d331b47cd8c2e614e
(cherry picked from commit 7923b3c10cad5059a7d187fa6abc39abdb4173ec)

5 years agoBluetooth: Check descriptors size in BluetoothHidDeviceAppSdpSettings
Jakub Pawlowski [Thu, 29 Nov 2018 17:54:21 +0000 (18:54 +0100)]
Bluetooth: Check descriptors size in BluetoothHidDeviceAppSdpSettings

Bug: 119819889
Test: compilation
Change-Id: If51d0e2af74d99758f79a603d40cc2f5c84e4dde
(cherry picked from commit 63519217e8c0682369b5b3dc11417f79b3b48b7e)

5 years agoRecover shady content:// paths.
Jeff Sharkey [Mon, 24 Sep 2018 19:23:57 +0000 (13:23 -0600)]
Recover shady content:// paths.

The path-permission element offers prefix or regex style matching of
paths, but most providers internally use UriMatcher to decide what
to do with an incoming Uri.

This causes trouble because UriMatcher uses Uri.getPathSegments(),
which quietly ignores "empty" paths.  Consider this example:

    <path-permission android:pathPrefix="/private" ... />

    uriMatcher.addURI("com.example", "/private", CODE_PRIVATE);

    content://com.example//private

The Uri above will pass the security check, since it's not
technically a prefix match.  But the UriMatcher will then match it
as CODE_PRIVATE, since it ignores the "//" zero-length path.

Since we can't safely change the behavior of either path-permission
or UriMatcher, we're left with recovering these shady paths by
trimming away zero-length paths.

Bug: 112555574
Test: atest android.appsecurity.cts.AppSecurityTests
Test: atest FrameworksCoreTests:android.content.ContentProviderTest
Merged-In: Ibadbfa4fc904ec54780c8102958735b03293fb9a
Change-Id: Ibadbfa4fc904ec54780c8102958735b03293fb9a
(cherry picked from commit c084ddbf826b25808c4553e4b5992c6723eac4ea)

5 years agoVerify number of Map entries written to Parcel
Michael Wachenschwanz [Sat, 25 Aug 2018 04:50:35 +0000 (21:50 -0700)]
Verify number of Map entries written to Parcel

Make sure the number of entries written by Parcel#writeMapInternal
matches the size written. If a mismatch were allowed, an exploitable
scenario could occur where the data read from the Parcel would not
match the data written.

Fixes: 112859604
Test: cts-tradefed run cts -m CtsOsTestCases -t android.os.cts.ParcelTest

Change-Id: I325d08a8b66b6e80fe76501359c41b6656848607
Merged-In: I325d08a8b66b6e80fe76501359c41b6656848607
(cherry picked from commit 057a01d1f38e9b46d3faa4059fdd7c8717681ea0)

5 years agoChanging SUPL_ES=1 for SUPL end point control
Wayne Lin [Thu, 30 Aug 2018 09:25:56 +0000 (17:25 +0800)]
Changing SUPL_ES=1 for SUPL end point control

SUPL_ES=1 ensures the GnssLocationProvider and related framework code
accepts incoming SMS SUPL_INIT messages with ES-bit=1
(which allow redirection of the ESLP
end-point e.g. to the current local emergency services provider when
you are travelling) only during an emergency call

Bug: 111899241
Bug: 112159033
Test: Build pass
Change-Id: I7dcd9c173a1d56fcf0da15257db5b8d1322b39d6
(cherry picked from commit 5b63dcc6a617cbab74dbda1f4cd759c75efa3aa5)

5 years agoFixes possible issue with no-op creator.
dwchen [Mon, 20 Aug 2018 17:17:48 +0000 (10:17 -0700)]
Fixes possible issue with no-op creator.

Leaving a no-op CREATOR can lead to issues. We throw a run-time
exception to prevent anyone from using this. The StatsLogEventWrapper is
meant to be write-only since it's only used to send data to statsd.

Bug: 112550251
Test: Tested with provided POC app by external researcher.
Change-Id: I001d84e2a61a1cd8a4f59aa156ca52f73ad0f6e1
(cherry picked from commit 78622d57ad102c054306b01321b6b2dbec3f9d1d)

5 years agoRevert "RESTRICT AUTOMERGE: Revoke permissions defined in a to-be removed package."
Ryan Longair [Wed, 5 Sep 2018 17:38:09 +0000 (10:38 -0700)]
Revert "RESTRICT AUTOMERGE: Revoke permissions defined in a to-be removed package."

This reverts commit 49419138ef2bd3049eeb4b94a6868647e22fb938.

5 years agoFix crash during cursor moving on BiDi text
Seigo Nonaka [Thu, 19 Jul 2018 23:22:02 +0000 (16:22 -0700)]
Fix crash during cursor moving on BiDi text

The crash was introduced by Ib66ef392c19c937718e7101f6d48fac3abe51ad0
The root cause of the crashing is requesting out-of-line access for the
horizontal width. This invalid access is silently ignored by
TextLine#measure() method but new implementation end up with out of
bounds access.

To makes behavior as old implementation, calling getHorizontal instead
of accessing measured result array.

Bug: 78464361111580019
Test: Manually done
Change-Id: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit 960647d582911ae7ab8b9491097898e6c313aaf1)
Merged-In: I5c5778718f6b397adbb1e4f2cf95e9f635f6e5c8
(cherry picked from commit a1076fdaa54ebf56bb32bea43fb278f7470ff307)

5 years agoDO NOT MERGE. Persistable Uri grants still require permissions.
Jeff Sharkey [Tue, 7 Aug 2018 21:02:17 +0000 (15:02 -0600)]
DO NOT MERGE. Persistable Uri grants still require permissions.

When FLAG_GRANT_PERSISTABLE_URI_PERMISSION is requested, we still
need to check permissions between the source and target packages,
instead of shortcutting past them.

The spirit of the original change is remains intact: if the caller
requested FLAG_GRANT_PERSISTABLE_URI_PERMISSION, then we avoid
returning "-1", which would prevent the grant data structure from
being allocated.

Bug: 111934948
Test: atest android.appsecurity.cts.AppSecurityTests
Change-Id: Ief0fc922aa09fc3d9bb6a126c2ff5855347cd030
Merged-In: Ief0fc922aa09fc3d9bb6a126c2ff5855347cd030
(cherry picked from commit d6a6e7127cc341ca875d9d13cf7a864d9f20b479)

5 years agoDO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.
Jeff Sharkey [Wed, 25 Jul 2018 20:52:14 +0000 (14:52 -0600)]
DO NOT MERGE. Extend SQLiteQueryBuilder for update and delete.

Developers often accept selection clauses from untrusted code, and
SQLiteQueryBuilder already supports a "strict" mode to help catch
SQL injection attacks.  This change extends the builder to support
update() and delete() calls, so that we can help secure those
selection clauses too.

Bug: 111085900
Test: atest packages/providers/DownloadProvider/tests/
Test: atest cts/tests/app/src/android/app/cts/DownloadManagerTest.java
Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Change-Id: Ib4fc8400f184755ee7e971ab5f2095186341730c
Merged-In: Ib4fc8400f184755ee7e971ab5f2095186341730c
(cherry picked from commit 506994268bc4fa07d8798b7737a2952f74b8fd04)

5 years agoDO NOT MERGE. Execute "strict" queries with extra parentheses.
Jeff Sharkey [Wed, 25 Jul 2018 20:01:59 +0000 (14:01 -0600)]
DO NOT MERGE. Execute "strict" queries with extra parentheses.

SQLiteQueryBuilder has a setStrict() mode which can be used to
detect SQL attacks from untrusted sources, which it does by running
each query twice: once with an extra set of parentheses, and if that
succeeds, it runs the original query verbatim.

This sadly doesn't catch inputs of the type "1=1) OR (1=1", which
creates valid statements for both tests above, but the final executed
query ends up leaking data due to SQLite operator precedence.

Instead, we need to continue compiling both variants, but we need
to execute the query with the additional parentheses to ensure
data won't be leaked.

Test: atest cts/tests/tests/database/src/android/database/sqlite/cts/SQLiteQueryBuilderTest.java
Bug: 111085900
Change-Id: I6e8746fa48f9de13adae37d2990de11c9c585381
Merged-In: I6e8746fa48f9de13adae37d2990de11c9c585381
(cherry picked from commit 57b04a86802ff879af78e782a8582462323e34e7)

5 years agoRESTRICT AUTOMERGE: Revoke permissions defined in a to-be removed package.
Hongming Jin [Tue, 19 Jun 2018 19:35:37 +0000 (12:35 -0700)]
RESTRICT AUTOMERGE: Revoke permissions defined in a to-be removed package.

Bug: 67319274
Test: run cts-dev --module CtsPermissionTestCases --test android.permission.cts.RemovePermissionTest#permissionShouldBeRevokedIfRemoved
Change-Id: Id23535d6c4d2fcf5c86dc1338af13a561b32154c
(cherry picked from commit fde947837c848b51a830b74b28f96f9808405492)

5 years agoOptimise the hit test algorithm
Mihai Popa [Wed, 9 May 2018 16:31:48 +0000 (17:31 +0100)]
Optimise the hit test algorithm

Layout#getOffsetForHorizontal was running in O(n^2) time, where n is the
length of the current line. The method is used when a touch event
happens on a text line, to compute the cursor offset (and the character)
where it happened. Although this is not an issue in common usecases,
where the number of characters on a line is relatively small, this can
be very inefficient as a consequence of Unicode containing 0-width
(invisible) characters. Specifically, there are characters defining the
text direction (LTR or RTL), which cause our algorithm to touch the
worst case quadratic runtime. For example, a person is able to send a
message containing a few visible characters, and also a lot of these
direction changing invisible ones. When the receiver touches the message
(causing the Layout#getOffsetForHorizontal method to be called), the
receiver's application would become not responsive.

This CL optimizes the method to run in O(n) worst case. This is achieved
by computing the measurements of all line prefixes at first, which can
be done in a single pass. Then, all the prefix measurement queries will
be answered in O(1), rather than O(n) as it was happening before.

Bug: 79215201
Test: manual testing
Change-Id: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
Merged-In: Ib66ef392c19c937718e7101f6d48fac3abe51ad0
(cherry picked from commit 138b106402d86653eaf296a02708737a6e360b58)

5 years agoFix TrackInfo parcel write
Robert Shih [Mon, 9 Jul 2018 20:38:31 +0000 (13:38 -0700)]
Fix TrackInfo parcel write

Bug: 77600398
Change-Id: Ia316f1c5dc4879f6851fdb78fe8b9039579be7bc
(cherry picked from commit 0d2dc943dcaa3d7c8479e22ae62be9753ea2643c)

5 years agoResolve inconsistent parcel read in NanoAppFilter
Arthur Ishiguro [Mon, 25 Jun 2018 18:31:33 +0000 (11:31 -0700)]
Resolve inconsistent parcel read in NanoAppFilter

Bug: 77599679
Test: Compile only
Change-Id: Ib417a5cb4d51744442d2fb14437cabbe5fd1c266
(cherry picked from commit abe5a73a4a81e312a1690fbc10a6b99ce98b699a)

5 years agoBackport Prevent shortcut info package name spoofing
Makoto Onuki [Tue, 12 Jun 2018 20:01:42 +0000 (13:01 -0700)]
Backport Prevent shortcut info package name spoofing

Test: cts-tradefed run cts -m CtsShortcutManagerTestCases -t android.content.pm.cts.shortcutmanager.ShortcutManagerFakingPublisherTest
Bug: 109824443

Change-Id: I90443973aaef157d357b98b739572866125b2bbc
Merged-In: I78948446a63b428ae750464194558fd44a658493
(cherry picked from commit 9e21579a11219581a0c08ff5dd6ac4dc22e988a4)

5 years agovpn: allow IPSec traffic through Always-on VPN
Bernie Innocenti [Mon, 28 May 2018 13:04:37 +0000 (22:04 +0900)]
vpn: allow IPSec traffic through Always-on VPN

This won't leak any traffic outside the VPN as long as there are no
processes owned by uid 0 which generate network traffic (which is
currently the case).

Bug: 69873852
Test: compared the output of 'adb shell ip rule show' before and after
Test: runtest -x frameworks/base/tests/net/java/com/android/server/connectivity/VpnTest.java
Test: local CTS tests run: android.net.cts.VpnServiceTest
Test: local CTS tests run: com.android.cts.devicepolicy.MixedDeviceOwnerTest
Change-Id: I8758e576c9d961d73f62bfcf0559dd7ecee6e8e6
Merged-In: I8758e576c9d961d73f62bfcf0559dd7ecee6e8e6
Merged-In: I1f9b78c8f828ec2df7aba71b39d62be0c4db2550
Merged-In: I8edeb0942e661c8385ff0cd3fdb72e6f62a8f218
(cherry picked from commit 00000fe55a4729f8339afdc7eab5c970b2549813)
(cherry picked from commit ae07a6bf53cc9650039c4f2918baf58d522b49f9)

5 years agoMerge cherrypicks of [4562103, 4560827, 4563998, 4563999, 4564000, 4564001, 4564351...
android-build-team Robot [Tue, 17 Jul 2018 23:29:14 +0000 (23:29 +0000)]
Merge cherrypicks of [456210345608274563998456399945640004564001456435145643524564333456403345604554564034456067445606754563620456160745610624561063] into pi-release

Change-Id: I8b6494e6539f685ea265cd74dfbfa88ab3cb289f

5 years agoLoosen resource file verification
Todd Kennedy [Thu, 12 Jul 2018 20:15:54 +0000 (13:15 -0700)]
Loosen resource file verification

Bug: 77808145
Test: Tried to install corrupt APK prior to the change, install failed
Test: Tried to install corrupt APK after the change, install succeeded
Test: atest CtsAppSecurityHostTestCases:CorruptApkTests
Change-Id: I19a69e52a17c1080beaf2cc575c32f564b1033a3
(cherry picked from commit 28e663cbed28fb6c8c8dec0849e0277daf67651b)

5 years agoFix crash on calling getAppStandbyBucket()
Amith Yamasani [Wed, 11 Jul 2018 17:44:17 +0000 (10:44 -0700)]
Fix crash on calling getAppStandbyBucket()

MATCH_ANY_USER, which was locked down recently, is not
really needed in this context, so removed it.

Bug: 111145886
Test: cts CtsAppUsageHostTestCases
Change-Id: I1bb9df0c7370015365bea414599b2b83084a1846
(cherry picked from commit 99e1424e0aa9e7dc4a5ccbff011d7161201921d1)

5 years agoAcquire service lock in AppTaskImpl.moveToFront()
Wale Ogunwale [Wed, 11 Jul 2018 22:22:01 +0000 (15:22 -0700)]
Acquire service lock in AppTaskImpl.moveToFront()

Oversight from previous refactor in O release done in ag/2987716

Change-Id: I2e2d6e55251eb319ddee0db97eedc1c574736ead
Merged-In: I2e2d6e55251eb319ddee0db97eedc1c574736ead
Fixes: 111336376
Test: builds
(cherry picked from commit bc4d0326a04c19500f44283fbfab581257d3c75e)

5 years agoAdd active admin app to power white list.
Lei Yu [Thu, 28 Jun 2018 21:06:29 +0000 (14:06 -0700)]
Add active admin app to power white list.

So user can't restrict it in settings app.

Bug: 110337989
Test: RunSettingsLibTests
Change-Id: Ie32dc8b2204369c9ca8f704436d5c988f76481ae
Merged-In: Ie32dc8b2204369c9ca8f704436d5c988f76481ae
(cherry picked from commit f5a13f8b3a0ce1a3ee6e49802e32db3f3fb38d6d)

5 years agoMerge cherrypicks of [4392181, 4392182, 4392183, 4392184, 4392201, 4392202] into...
android-build-team Robot [Thu, 21 Jun 2018 00:58:45 +0000 (00:58 +0000)]
Merge cherrypicks of [439218143921824392183439218443922014392202] into pi-release

Change-Id: I8e1428f12ab9bf4cc2b1a322e64b4aa41aa0ae41

5 years agoStabilize hidden API lists
David Brazdil [Fri, 15 Jun 2018 13:05:42 +0000 (14:05 +0100)]
Stabilize hidden API lists

Hidden API lists are auto-generated using a combination of Doclava
/Makefile rules and manually curated lists. As OEMs make their own
changes to the framework, they might arrive at slightly different
lists. This is not desirable as the entire ecosystem should enforce
the same rules. This patch adds the files generated by Doclava to
the code base, which will stabilize the lists for everyone.

The problem is exacerbated by the fact that the Doclava-generated
private-dex.txt contains only classes explored by Doclava. This can
change rather unexpectedly as OEMs make changes and start/stop using
internal classes otherwise only used in unexplored code. If the file
is extended, they might start blacklisting new APIs. If the file
shrinks, they might start whitelisting APIs they should restrict
access to and have trouble passing CTS.

(Avoid merging out of pi trees)

Test: m ; check that produced lists have not changed
Bug: 109824927
Merged-In: I0e9653d9cd7e4b748870bacb6fbcecae535ebb2a
Change-Id: I1463a06d6510e7051a64d5d516f4c589638ca11c
(cherry picked from commit 5999830557004ec70158e91cde2e9ff4e52dbb74)

5 years agoMore light grey APIs.
Nicolas Geoffray [Wed, 13 Jun 2018 20:22:06 +0000 (21:22 +0100)]
More light grey APIs.

bug: 110157261
bug: 110065832
bug: 110179435
bug: 110174713
bug: 110191494
bug: 110282922
bug: 110289776
bug: 110314356
bug: 110340642
bug: 110382035
Bug: 110444248
Bug: 110447432
bug: 110378707

Test: m
Change-Id: I5d7c0f9d471eab22e23cc335f03cebecb642f871
(cherry picked from commit 43536175f2c29b1dcb15e3e104bd1aa11a0f3a4a)

5 years agoFix race condition in MediaHTTPConnection
Marco Nelissen [Tue, 19 Jun 2018 19:38:23 +0000 (12:38 -0700)]
Fix race condition in MediaHTTPConnection

getSize() and getMIMEType() rely on seekTo() having completed.
If seekTo() was called on a different thread, for example because
NuCachedSource2 was doing reads on a background thread, getSize()
could return -1 if it was called after connection was established,
but before the response had been parsed.

Bug: 110230427
Test: manual
Change-Id: I469b47e025f1c7a7ef3123d3347668f0541e6f2d
(cherry picked from commit d4f64f27b0de1c5d21c93b4d73acd05ede28fde2)

5 years agoDon't throw uri exceptions for user chosen sounds
Julia Reynolds [Wed, 13 Jun 2018 14:45:21 +0000 (10:45 -0400)]
Don't throw uri exceptions for user chosen sounds

Bug: 109889733
Test: runtest systemui-notification
Change-Id: I5ed599deca83f97899affce44e3ed8fbcacae366
(cherry picked from commit 218871ee3ffffea964658be327ffd06e1e3eed61)
(cherry picked from commit 89945c5a222ab2761ab086588c1ac5434cca661f)