Commit Graph

7783 Commits

Author SHA1 Message Date
Peiyong Lin
d22eebefdb [GraphicsEnvironment] Avoid null access.
Currently when debug layer apk is not installed, GraphicsEnvironment
logs the message and proceeds, which results in null pointer access
crash when later trying to access primaryAbi. Avoid null access by an
early return statement.

Bug: b/175699044
Test: specify not installed debug layer apk and no crash
Change-Id: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
Merged-In: I4f3b86b0a8cfff4fc608b3a59ebf0872db0465ff
(cherry picked from commit c5c17e66ba)
2020-12-15 17:54:45 +00:00
Josh Gao
ca46512d0a FileBridge: fix fd ownership mismanagement.
This patch switches everything over to ParcelFileDescriptor, but the
important part of the change is changing FileBridge.getClientSocket to
return a ParcelFileDescriptor. Previously, it returned a raw
FileDescriptor that was closed by FileBridge, and the only non-test
caller of that function was taking it and constructing a
ParcelFileDescriptor from it, which would also attempt to close the fd,
leading to an fdsan abort.

Bug: http://b/162811367
Test: atest FileBridgeTest
Test: treehugger
Change-Id: I724ea7601bb072c98895f68abc08bb0e339d1db0
(cherry picked from commit 4c392e8057)
2020-11-06 13:12:51 -08:00
Yogisha Dixit
4b1a1f1309 RESTRICT AUTOMERGE
Add a hidden API to check if ambient display is suppressed for a token.

Added 1 method:
boolean isAmbientDisplaySuppressedForTokenByApp(String token, int appUid)

Context:
The Settings team is working on adding a string to the AOD settings page when ambient display is suppressed by Bedtime mode: b/168790245.

The current PowerManager#isAmbientDisplaySuppressedForToken(String token) method will only work if the calling app is also the app that suppressed the ambient display. That is, if Digital Wellbeing called suppressAmbientDisplay("winddown"), then isAmbientDisplaySuppressedForToken("winddown") will only return true for Digital Wellbeing. It will return false for Settings app

This CL adds a hidden API PowerManager#isAmbientDisplaySuppressedForTokenByApp(String token, int appUid) that will return true if the given app is suppressing ambient display with the given token. Settings can then call isAmbientDisplaySuppressedForTokenByApp("winddown", digitalWellbeingUid) to get whether ambient display is suppressed by Bedtime mode.

Test: atest FrameworksServicesTests:PowerManagerServiceTest
Bug: 169241595
Change-Id: I41aecc4ff0ab159d67e62193af27362a96c3174c
(cherry picked from commit 784b62a517)
2020-11-03 11:21:43 +00:00
Michael Groover
1aef206a3a Fix unique identifiers best practices links in device ID API docs
Bug: 168447060
Test: m docs
Change-Id: I483e0cf4915862254461200deb5d3dc7302bafb4
Merged-In: I483e0cf4915862254461200deb5d3dc7302bafb4
2020-09-24 19:56:04 +00:00
Bradley Allen
4b53e60c6a Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc am: 7fad6c94d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: I07f725e2e54412998152f0e0bc08c3a491182f34
2020-09-10 16:02:39 +00:00
Bradley Allen
7fad6c94d6 Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev am: 5d7be413bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12548368

Change-Id: Ib44d0aee6a87a79dcc668337c945d67678e4c43d
2020-09-10 15:51:51 +00:00
Bradley Allen
5d7be413bc Merge "docs: Added links to the Android 11 summary pages on developer.android.com." into rvc-dev 2020-09-10 15:23:01 +00:00
Martijn Coenen
f902374308 Merge "Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode transition." into rvc-qpr-dev 2020-09-10 10:21:49 +00:00
Seigo Nonaka
c0b541b0ec Accept repeated locale as an input of LocaleList construction. am: 41b1674f77 am: 8b4cd9aef3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540040

Change-Id: If6140b007349d0c4be79c98acc816c9de3c55e61
2020-09-09 20:57:20 +00:00
Seigo Nonaka
8b4cd9aef3 Accept repeated locale as an input of LocaleList construction. am: 41b1674f77
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12540040

Change-Id: I69509d7ddadb1787f56ce31f0ff2fb617537b2ce
2020-09-09 20:33:10 +00:00
Bradley Allen
cefc89c911 docs: Added links to the Android 11 summary pages on developer.android.com.
Test: http://go/forrest-run/L06800000688439076
Bug: 163618180
Change-Id: Ibe136020df4ef60183f3726fc0f6336b58c37f99
2020-09-09 17:41:07 +00:00
Seigo Nonaka
373ac57b2d Accept repeated locale as an input of LocaleList construction.
Repeated locale has not been accepted and IllegalArgumentException
is thrown. Instead of throwing exception, dropping repeated locale
instead.

Bug: 152410253
Test: atest LocaleListTest
Change-Id: I80f243678ac3024eaeb0349f770cff897df7f332
2020-09-08 22:35:39 +00:00
Seigo Nonaka
41b1674f77 Accept repeated locale as an input of LocaleList construction.
Repeated locale has not been accepted and IllegalArgumentException
is thrown. Instead of throwing exception, dropping repeated locale
instead.

Bug: 152410253
Test: atest LocaleListTest
Change-Id: I80f243678ac3024eaeb0349f770cff897df7f332
2020-09-08 20:22:48 +00:00
Martijn Coenen
27c52fcaa8 Don't kill for REQUEST_INSTALL_PACKAGES on default/error mode
transition.

When handling unknown sources, PackageManager transitions from
MODE_DEFAULT to MODE_ERRORED, causing us to kill the app before the user
has even decided whether to allow external sources or not.

Since MODE_DEFAULT and MODE_ERRORED are the same from a storage point of
view, ignore transitions between the two.

This required some AppOps changes to store the previous mode and pass it
in.

Bug: 162849988
Test: run Epic installer
Change-Id: Ic866216f877e9b727fe70556f66dd998966fe0a2
Merged-In: Ic866216f877e9b727fe70556f66dd998966fe0a2
2020-09-08 14:23:31 +00:00
Marco Ballesio
12f3e8d6d4 freezer: reentrant enable/disable method
the app freezer state can be toggled in multiple situations when a
debugging tool like heapdump is invoked, or when system_server dumps its
binder connections. All these uses are potentially concurrent and a
robust method to handle reentrancy is necessary to avoid leaving the
freezer in a state incompatible with a specific operation.

This patch moves freezer enable and disable operations from Process to
CachedAppOptimizer (ActivityManager), introduces a new ActivityManager API
to centralize all freezer state changes to ActivityManager and modifies
client code accordingly.

Bug: 151225245
Test: manually verified that no regression are introduced on freezer
behavior, verified that concurrent behavior is handled properly

Change-Id: I7d588cc6e0499012dce64ed4e42ff2adb336062d
Merged-In: I7d588cc6e0499012dce64ed4e42ff2adb336062d
2020-08-27 16:05:57 -07:00
Marco Ballesio
6ca459dc17 freezer: switch to cgroup v2 freezer
cgroup v2 freezer has a single hierarchy and is mounted under
/sys/fs/cgroup. Proper v2 freezer support in a system can be checked by
verifying that the file "cgroup.freeze" is present in a freezer subgroup.

Bug: 154548692
Test: manually verified that processes are frozen and unfrozen

Change-Id: Ib966a957490ec986eb14aba6492832c96e147896
Merged-In: Ib966a957490ec986eb14aba6492832c96e147896
2020-08-27 16:05:41 -07:00
Bradley Allen
d015d7299a Merge "docs: Removed Q preview language and added a link to the Android 10 page on developer.android.com." into rvc-dev am: 6dfedd05a7
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12347462

Change-Id: I7bd9a90e3b66e4a842bdcaa33f62328fd9928af7
2020-08-12 16:46:29 +00:00
Bradley Allen
462481663c docs: Removed Q preview language and added a link to the Android 10 page on developer.android.com.
Test: http://go/forrest-run/L62500000661914456
Bug: 149267624
Change-Id: I73b92cf0af8f78117448db9a89d7685f45bc512d
2020-08-11 18:56:15 +00:00
Santos Cordon
31c24e048f Allow Power-button to temporarily ignore proximity sensor.
If a device has an active proximity wakelocks while proximity
is in the "near" state, a press of the power button will temporarily
ignore proximity sensor allowing the screen to turn back on.
It will stop being ignored where there is a change to the
proximity sensor state.

Bug: 162443904
Test: atest PowerManagerServiceTests, atest DisplayManagerTests
Change-Id: I2656cca3e643e278cd5e5fedc2d74d9cbca82c2b
2020-08-03 16:26:51 +00:00
Lais Andrade
c2777148df Propagate AudioAttributes flags to VibrationAttributes
Set supported flags from AudioAttributes into VibrationAttributes on the
builder constructor.

Fix: b/161761418
Test: manual
Change-Id: I4a8e1db278843b2f9f19aba43b0b8f264cb696bd
2020-07-23 18:05:09 +00:00
Jorim Jaggi
d42ab1b938 Pass in callsite of SurfaceControl constructor explicitly (1/3)
Creating a new Throwable (and filling in the stack trace) can take
up to 150us. Since we do this on the critical path when sending
over SurfaceControl via binder multiple times, this is too much.
Instead, add an option to pass in callsite manually.

Bug: 159056748
Change-Id: I46c339c15a07192d61c4c546e46f260684a47120
Merged-In: I46c339c15a07192d61c4c546e46f260684a47120
Exempt-From-Owner-Approval: Large scale refactor
2020-06-26 15:35:23 +02:00
TreeHugger Robot
3fa2d86fd0 Merge "Add additional info to device ID docs in TelephonyManager and Build" into rvc-dev 2020-06-24 16:15:32 +00:00
Michael Groover
e0de018109 Add additional info to device ID docs in TelephonyManager and Build
Android 10 introduced additional restrictions to access persistent
device identifiers. This commit updates the javadocs for
TelephonyManager and Build to provide additional details regarding
the requirements and how to check if these requirements are met.

Fixes: 158471988
Test: m docs -j
Change-Id: I02932a22ecc5b761aa1a92d59d09d31863c34235
2020-06-23 19:52:51 -07:00
Jing Ji
471ef84e33 Merge "Fix memory leak in StrictMode violation throttling" into rvc-dev 2020-06-23 00:04:49 +00:00
Jing Ji
6985fb39f0 Fix memory leak in StrictMode violation throttling
* Add hashCode() to the base Violation class for dup detections
* Discard obsoleted violation fingerprints if possible

Bug: 159128771
Bug: 159626227
Test: run cts -m CtsOsTestCases -t android.os.cts.StrictModeTest
Test: Manual - Loop generation of StrictMode violations
Test: Manual - Check heap dump
Change-Id: I19a0922fe010fad97b6b819e73acb7db08f84930
2020-06-22 14:22:32 -07:00
TreeHugger Robot
960e49335a Merge "Revert non-API changes to not throw UserOperationException any more" into rvc-dev 2020-06-22 21:05:23 +00:00
Robin Lee
7ac6636159 Revert non-API changes to not throw UserOperationException any more
Bug: 158697055
Test: atest android.admin.cts.DevicePolicyManagerTest.
Test: atest android.server.pm.UserManagerTest
Change-Id: I07785d053befab6be9e3076e058cac67ff8f702e
2020-06-19 20:45:44 +00:00
Hunter Knepshield
9568960297 Merge changes from topic "bugreport-stub" into rvc-dev
* changes:
  Reevaluate some carrier-associated apps' status on SDK changes.
  Add new "addedInSdk" attribute to carrier-associated apps.
2020-06-18 17:01:01 +00:00
Luke Huang
7144459282 Merge "Disable sockets and DNS if process lacks INTERNET permission." into rvc-dev 2020-06-18 03:03:06 +00:00
Luke Huang
6f214e8ebe Disable sockets and DNS if process lacks INTERNET permission.
This is a Client-only solution.
  - Add to NetdClient a per-process std::atomic_boolean
    similar to netIdForProcess and netIdForResolv.
  - The boolean says whether the process should be
    allowed Internet connectivity.
  - Add an @hide method to NetUtils.java to set the boolean;
    call it from the initialization code of the new
    process just after forking from zygote.
  - Make netdClientSocket and dnsOpenProxy check the
    boolean. If the boolean is false, return EPERM from
    socket calls.

Bug: 150028556
Test: atest NetworkUtilsTest
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If002280fbad493dfc2db3d9d505c0257d49a9056
Exempt-From-Owner-Approval: OWNERS already approved identical patchset 5
2020-06-18 03:02:06 +00:00
Adam Bookatz
36bacceee5 Clarify doc for users, clarifying profiles
Test: N/A
Bug: 159173436
Change-Id: I3c105559801a72ef1d91d9db2d42a816e27e24f6
Merged-In: I3c105559801a72ef1d91d9db2d42a816e27e24f6
2020-06-18 00:08:51 +00:00
Hunter Knepshield
1172ffa7c2 Add new "addedInSdk" attribute to carrier-associated apps.
Previously, the sysconfig wasn't capable of understanding
carrier-associated apps that were added after a device's initial launch
(i.e. via OTA) because the logic in CarrierAppUtils explicitly avoids
disabling such apps a second time.

Most of this change is just plumbing everything through. For now, it's
all @hide due to R API deadlines. It will be made public in S.

Bug: 154872019
Test: manual, QA, atest FrameworksTelephonyTests:CarrierAppUtilsTest
Change-Id: I530a4f73146b09879547ca2e0c26428957fef37a
2020-06-16 16:48:38 -07:00
Nikita Ioffe
27d6605c52 Merge "Respect MANAGE_EXTERNAL_STORAGE in checks for READ/WRITE_EXTERNAL_STORAGE" into rvc-dev 2020-06-16 10:02:49 +00:00
Nikita Ioffe
fc3a740282 Respect MANAGE_EXTERNAL_STORAGE in checks for READ/WRITE_EXTERNAL_STORAGE
Test: test app mentioned in the bug
Bug: 158316513
Change-Id: I254479d6616d2e09349fcd9c569c5092dbdefaca
2020-06-15 13:01:06 +01:00
Alex Buynytskyy
0403545508 Don't provide read logs for shell-initiated installations.
Only if the application is profileable.

Bug: 158238023
Fixes: 158238023
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest PackageParserTest
Change-Id: I8575830ec3f29850297fdbfbaa157072d6350a28
Merged-In: I8575830ec3f29850297fdbfbaa157072d6350a28
2020-06-12 13:30:45 -07:00
Adam Bookatz
a677e1c6f9 Merge "Default isUserSwitcherEnabled showEvenIfNotActionable" into rvc-dev 2020-06-12 00:47:47 +00:00
Lais Andrade
ef5d8751e6 Add details to VibrationEffect waveform documentation
Explain the time unit of timings argument and copy explanation of
amplitude values to the summary segments of the javadocs.

Fix: 140846849
Test: N/A
Change-Id: Ia6fd6cb5d0e16076a54f24f7c3d2f3d4ca78d5bd
2020-06-11 16:39:36 +00:00
Adam Bookatz
600210d7cb Default isUserSwitcherEnabled showEvenIfNotActionable
In ag/11573771, the default value for isUserSwitcherEnabled() was
put as false, but it was supposed to be true (as it had been
in patch 1 of that cl).

Bug: 157881376
Test: manual
Change-Id: I456e7eb9527dad8da5d5f99ecbfc8bcf40b7bdcc
2020-06-11 00:22:37 +00:00
TreeHugger Robot
8434b9fc88 Merge "Apply app data isolation on isolated or app zygote processes" into rvc-dev 2020-06-08 11:03:56 +00:00
Ricky Wai
e986bc4cad Apply app data isolation on isolated or app zygote processes
Fix: 158088415
Test: atest AppDataIsolationTests
Change-Id: Ic55464397039645938822ac20eb12e375bbe4a72
2020-06-05 11:50:50 +01:00
TreeHugger Robot
d5fb11a761 Merge "Get the instance count as the initial value" into rvc-dev 2020-06-05 03:34:32 +00:00
Jeff Sharkey
0a8e32c124 Logging to aid bug investigation.
We're trying to figure out where volumes are disappearing.

Bug: 158059178
Test: none
Change-Id: I68959f0a163e2fece13fcb08a6c9f55ec1beb0f6
2020-06-04 17:35:38 -06:00
Peiyong Lin
1371b76afd Merge "Allow to load implicit layer from /vendor/app." into rvc-dev 2020-06-04 00:40:15 +00:00
Peiyong Lin
eb1c5a4c28 Allow to load implicit layer from /vendor/app.
Currently when loading implicit layers from apks, NativeLoaderNamespace
doesn't allow to dlopen the binaries if they come from apks from
/vendor/app. Implicit layers ship within /vendor/app should work like
other implicit layers. This patch extracts the construction of library
paths of the implicit layers and includes those paths when
NativeLoaderNamespace is created as the part of the permitted library
paths.

Bug: b/157832445
Test: atest android.gputools.cts.CtsRootlessGpuDebugHostTest
Test: setup debug layer and use adb logcat to check vulkan loader output
Change-Id: Ie2ca989bcab890578b5aa540d07f2aee2a0182bd
2020-06-03 21:30:08 +00:00
Zhen Zhang
2260f7102f Merge "Allow low ram device to have multiple users and managed profies" into rvc-dev 2020-06-03 17:19:30 +00:00
Martijn Coenen
0a8ef2b45f Merge "Use killProcessGroup when killing app zygote." into rvc-dev 2020-06-02 06:54:46 +00:00
Jeff Sharkey
c99a508218 Merge "Revert "Apps shouldn't be disabling StrictMode checks."" into rvc-dev 2020-06-01 15:55:14 +00:00
Jeff Sharkey
3080fb7c9e Revert "Apps shouldn't be disabling StrictMode checks."
This reverts commit 14e961870a.

Reason for revert: satayev@
Bug: 156336269

Change-Id: Ic0d3a650156c06f58fce4c28157191f4497469f0
2020-06-01 15:54:41 +00:00
Jeff Sharkey
fd71805e1c Merge "Support getStorageVolume() for synthetic volumes." into rvc-dev 2020-06-01 14:18:32 +00:00
Jeff Sharkey
4d96602de0 Merge "Apps shouldn't be disabling StrictMode checks." into rvc-dev 2020-06-01 14:16:54 +00:00