Commit Graph

6959 Commits

Author SHA1 Message Date
Ryan Mitchell
b887f68ad1 Use binder-based iterator to retrieve FRROs
If for some reason there are a lot of fabricated overlays in the
resources cache, the binder limit of the list of fabricated overlay
infos could exceed the maximum binder transaction size. Rather than
return all of the frro infos in one transactions, register an iterator
with the native idmap2d service and use multiple binder transactions
to iterate through all of the frros.

Bug: 192948522
Test: Toggle device theme colors several times and observe frro cache
      Reboot device and observe old frros are deleted
Change-Id: I5e9cf3ae9d1d45eda683c24141a0cd4e4301e02f
2021-07-19 16:53:27 +00:00
Ryan Prichard
8bc1c3484c Stop exporting symbols from app_process
Any symbols exported from the executable override everything else in
every linker namespace. Previously, app_process exported the
signal/sigchain API, but that interposition is now handled by
libsigchain.so.

Bug: http://b/190100879
Test: `nm -D --defined-only app_process{32,64}` shows no symbols
Change-Id: I1ab1fc700c34e91535c3e679a471debbb4eb71e3
(cherry picked from commit 6b86dfb159)
2021-06-15 13:14:41 -07:00
Ryan Mitchell
dc628e77a1 Merge changes I6da18cdb,I9de6ba64,I1af88c6d,I154783ff into sc-dev
* changes:
  idmap2: fix cpplint warnings
  OMS: include idmap data in dump
  idmap2: create in-memory FRRO before creating file
  OMS: update shell command --help
2021-06-03 15:02:22 +00:00
Mårten Kongstad
1195a6bd46 idmap2: fix cpplint warnings
Bug: 189963636
Test: frameworks/base/cmds/idmap2/static-checks.sh
Change-Id: I6da18cdbbd2fc33db711696445230a9f316dc143
2021-06-02 21:55:28 +00:00
Mårten Kongstad
99ae898d3c OMS: include idmap data in dump
Teach the overlay manager to ask the idmap service to pretty print the
contents of each idmap file as part of OMS dump. This creates a single
entry point for dumping both OMS and idmap data, and circumvents the
problem of accessing the idmap service if it has been killed due to
inactivity.

Example idmap section:

---- 8< ----
IDMAP OF com.android.theme.color.sand
Paths:
    target path  : /system/framework/framework-res.apk
    overlay path : /product/overlay/AccentColorSand/AccentColorSandOverlay.apk
Debug info:
    W failed to find resource 'string/accent_color_overlay'
Mapping:
    0x0106006e -> 0x7f010000 (color/accent_device_default_dark -> color/accent_device_default_dark)
    0x01060070 -> 0x7f010001 (color/accent_device_default_light -> color/accent_device_default_light)
---- >8 ----

Bug: 189963636
Test: adb exec-out dumpsys
Test: adb exec-out cmd overlay dump
Test: adb exec-out cmd overlay dump <overlay-identifier>
Change-Id: I9de6ba646ad4714c9d0f0d8081fbf632577107e7
2021-06-02 21:54:40 +00:00
Mårten Kongstad
a384fb7637 idmap2: create in-memory FRRO before creating file
Re-order the serialization of an FRRO and creation of the backing file.
This prevents a dangling (empty) file if the serialization fails.

Bug: 189963636
Test: manual: cmd overlay fabricate <bad parameters>, verify no file created in /data/resource-cache
Change-Id: I1af88c6d2d1c3a881beecfb50ccaf541a249f39b
2021-06-02 19:33:50 +00:00
Ryan Mitchell
c0416698db Disable incremental hardening on own resources
When an application is incrementally installed, and a resources
operation fails due to the resources not being fully present,
the app should crash instead of swallowing the error and
returning default values to not alter the experience of
using the application.

Disable IncFsFileMap protections on ApkAssets that are a part of the
application that is running (base and splits).

Bug: 187220960
Test: atest ResourcesHardeningTest
Change-Id: Ibc67aca688720f983c7c656f404593285a54999b
2021-05-27 09:50:36 -07:00
Patrick Baumann
43628ca24c Updates OWNERS files
Bug: 186864416
Test: Builds
Change-Id: I04dfc5c2c7143825334ebc62742e335b8c889492
2021-05-21 14:13:18 -07:00
Ricky Wai
1d42095ddb Merge "Revert "Change mounting storage data and obb flag to on by default"" into sc-dev 2021-05-14 13:32:11 +00:00
Wale Ogunwale
6f5423bb8c Revert "Change mounting storage data and obb flag to on by default"
Revert "Remove storage app data isolation checking in CTS"

Revert submission 14325408-enable_storage_iso_2

Reason for revert: b/187939590
Reverted Changes:
I6391b7381:Change mounting storage data and obb flag to on by...
Ic2f3d1be2:Remove storage app data isolation checking in CTS
Iffa8339b1:Change mounting storage data and obb flag to on by...

Bug: 187939590
Bug: 148049767
Change-Id: I7fa2947593d0fe743def804bf4f7b57920978e40
2021-05-14 10:30:54 +00:00
Jing Ji
fa42613b96 Fix the argument list to logcat from am instrument
Bug: 186570682
Test: am instrument
Change-Id: I3290022c865ca16150c3392657f1fe9d31834fc5
2021-05-07 21:11:24 -07:00
Ricky Wai
b11309b1fc Change mounting storage data and obb flag to on by default
Change mounting storage data and obb flag to on by default

Test: unbundled/launcher/nexus_unit_test_multi_device_platform
Test: atest android.appsecurity.cts.ExternalStorageHostTest
Test: atest AdoptableHostTest
Test: pass cts/cts_postsubmit_cf_stable-cloud-tf

Bug: 148049767
Change-Id: Iffa8339b10427bea96aa90030463ed18c96eafce
2021-04-29 15:59:00 +00:00
Kholoud Mohamed
da3d4e8608 Merge "Revert "Revert "Changed dpm shell commands to use 'cmd device_policy'""" into sc-dev 2021-04-28 08:59:23 +00:00
Kholoud Mohamed
4b2ce108a8 Revert "Revert "Changed dpm shell commands to use 'cmd device_policy'""
This reverts commit dc70c57eaf.

Reason for revert: Fixed failing test

Change-Id: Ib434365f441d69853ea3af6da7f3c663c16e5e1e
2021-04-27 12:54:46 +00:00
Jooyung Han
ed4e70f537 resolve merge conflicts of 2028343503 to sc-dev
Change-Id: I2c9c8597a967a3af3b9bf07df562c6e0f51ca3dd
2021-04-27 04:15:41 +00:00
Jooyung Han
2028343503 Merge "Make OverlayablePolicy as enum type" am: 8e87bfb4fb am: 7e9f9ed9f9
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1686174

Change-Id: I0127ff53eec8c1e8d9847574a097160fc3e84be6
2021-04-27 03:14:42 +00:00
Robert Horvath
79ff669777 Merge "Conditionally show bootanimation for quiescent boots" into sc-dev 2021-04-26 10:59:51 +00:00
Jooyung Han
274b7bbfbd Make OverlayablePolicy as enum type
It's been used as a container of constants. "enum" suits better.

Fixes: 179836191
Test: m
Change-Id: Icbcda5707c0d2528dcbfad7e5add8d50bc4ec5b9
2021-04-26 13:52:40 +09:00
Martin Stjernholm
8cf06f75a6 Merge "Revert "Changed dpm shell commands to use 'cmd device_policy'"" into sc-dev 2021-04-23 15:56:02 +00:00
Martin Stjernholm
dc70c57eaf Revert "Changed dpm shell commands to use 'cmd device_policy'"
This reverts commit e311f273d4.

Reason for revert: Suspected to break git_sc-dev: https://android-build.googleplex.com/builds/tests/view?invocationId=I95100008561539923&testResultId=TR98321419962361792

Bug: 186208038
Change-Id: I0dc3ee2d509f395677600590d0cbb42b4d9f1682
2021-04-23 13:54:54 +00:00
Kholoud Mohamed
3a7975ee33 Merge "Changed dpm shell commands to use 'cmd device_policy'" into sc-dev 2021-04-23 10:02:54 +00:00
kholoud mohamed
e311f273d4 Changed dpm shell commands to use 'cmd device_policy'
Added the missing commands to DevicePolicyManagerServiceShellCommand and
changed 'adb shell dpm' to call 'adb shell cmd device_policy'

Fixes: 173381875
Test: atest com.android.bedstead.nene.devicepolicy.DevicePolicyTest
Test: atest com.android.bedstead.nene.devicepolicy.ProfileOwnerTest
Test: atest com.android.bedstead.nene.devicepolicy.DeviceOwnerTest
Test: manually tested the migrated commands
Change-Id: Id86382f11cf8197230ef62c33961e01b0b541358
2021-04-22 18:21:49 +01:00
Chun-Yi Lee
1b90144b39 Merge "Move CtsDevicePolicyManagerTestCases to group presubmit-large" into sc-dev 2021-04-22 12:30:10 +00:00
Nicolas Geoffray
db45defb94 Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." am: 87c254de0e am: 10e844df41 am: 55b2ba298c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1681127

Change-Id: I1ee402945af4207affb77d61eb76a21c175ac1fc
2021-04-21 09:54:52 +00:00
Nicolas Geoffray
55b2ba298c Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." am: 87c254de0e am: 10e844df41
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1681127

Change-Id: I6c86286bdb5eb45231ea1106d0e439970b3ec7bc
2021-04-21 09:28:44 +00:00
Nicolas Geoffray
87c254de0e Merge "bootanimation: ensure that if a percent is shown, we'll get to 100." 2021-04-21 08:56:29 +00:00
easoncylee
ac72e3c10c Move CtsDevicePolicyManagerTestCases to group presubmit-large
The test config takes longer than 15mins to run. Move it to a dedicated
group for running slow presubmit Test Mapping test.

Some more context is in the referenced bug, e.g, b/174495337
The group will work exactly the same as presubmit for now.

Bug: 174654670
Bug: 174495337
Test: none
Change-Id: I71b6e5b285d0f12b43bf5312f9cde814d2f5f7da
2021-04-21 07:10:36 +00:00
Daulet Zhanguzin
f84ac0f599 Fix build error due to null annotations in core platform API
Change https://r.android.com/1667508 adds nullability annotations to
the core platform APIs which broke this code with the error:

javadoc: error - In doclet class com.google.doclava.Doclava,  method
start has thrown an exception
java.lang.reflect.InvocationTargetException
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for
androidx.annotation.RecentlyNonNull not found

Bug: 183938110
Bug: 185929373
Test: m checkbuild

Change-Id: I83e3071f851720a9f719cb226f0e84fd731a8f37
Merged-In: I83e3071f851720a9f719cb226f0e84fd731a8f37
2021-04-20 22:06:32 +01:00
Nicolas Geoffray
a12987512c bootanimation: ensure that if a percent is shown, we'll get to 100.
Seeing 100 while booting is not finished, or seeing eg 90 while booting
is not finished isn't user-friendly.

Test: update ART module, see percent progress
Change-Id: I5509c83f661f937f00a7d28c789df509e3528a37
2021-04-20 15:15:06 +01:00
Daulet Zhanguzin
db11353c46 Merge "Fix build error due to null annotations in core platform API" into rvc-qpr-dev-plus-aosp am: b016acc8c3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14236420

Change-Id: Iedceb78f447cdaaadf1a816f0ea073c3043d70fa
2021-04-20 13:14:59 +00:00
Daulet Zhanguzin
fc7efcbaa6 Fix build error due to null annotations in core platform API
Change https://r.android.com/1667508 adds nullability annotations to
the core platform APIs which broke this code with the error:

javadoc: error - In doclet class com.google.doclava.Doclava,  method
start has thrown an exception
java.lang.reflect.InvocationTargetException
com.sun.tools.javac.code.Symbol$CompletionFailure: class file for
androidx.annotation.RecentlyNonNull not found

Bug: 183938110
Test: m checkbuild

Change-Id: I83e3071f851720a9f719cb226f0e84fd731a8f37
Merged-In: I83e3071f851720a9f719cb226f0e84fd731a8f37
2021-04-20 09:13:18 +00:00
Robert Horvath
8c878d61bb Conditionally show bootanimation for quiescent boots
Allow bootanimation to play if the boot is quiescent and the system
property ro.bootanim.quiescent.enabled is set to true.
This allows the bootanimation to become visible if the display is
turned on during the bootanimation. If OEMs want this behavior and the
device implements suppression of video/audio during quiescent boot,
they can set the system property
ro.bootanim.quiescent.enabled.

Bug: 185118020
Test: PRODUCT_PRODUCT_PROPERTIES += ro.bootanim.quiescent.enabled=true
      adb reboot quiescent
      Spam `adb shell input keyevent POWER` during boot
Test: Repeat the above test with the property set to 0
Change-Id: I54a4ad552704106ca06c4992fed4a2d501aa3fa5
2021-04-15 16:47:59 +02:00
Bill Yi
4167bf213c Merge RQ2A.210405.006 to aosp-master - DO NOT MERGE
Merged-In: I735b41ed53ce7d374b5d36c4aee79f73d0334234
Merged-In: I9999bfe514fffa9f300643e74942db5ae556670a
Change-Id: If4b670a158e561d8feb03e12aef2d295c5109d43
2021-04-13 19:36:45 -07:00
Jeffrey Huang
090ceb3af9 Merge "Close the FD after opening the file" into sc-dev 2021-03-31 19:57:57 +00:00
Jeffrey Huang
ab40ab67ce Close the FD after opening the file
Bug: 183758470
Test: Manually took incident report and verified the file is deleted
Change-Id: I040306c2365bcf98efde94fcc15575c9131f3b0e
2021-03-30 15:03:39 -07:00
Svet Ganov
8d2ed50604 Runtime permission attribution improvements
When an app is proxying access to runtime permission protected
data it needs to check whether the calling app has a permission
to the data it is about to proxy which leaves a trace in app ops
that the requesting app perofmed a data access. However, then the
app doing the work needs to get the protected data itself from the
OS which access gets attributed only to itself. As a result there
are two data accesses in app ops where only the first one is a
proxy one that app A got access to Foo through app B - that is the
one we want to show in the permission tracking UIs - and one
for the data access - that is the one we would want to blame on
the calling app, and in fact, these two accesses should be one -
that app A accessed Foo though B. This limitation requires fragile
one off workarounds where both accesses use the same attribution
tag and sys UI has hardcoded rules to dedupe. Since this is not
documented we cannot expect that the ecosystem would reliably
do this workaround in apps that that the workaround in the OS
would be respected by every OEM.

This change adds a mechaism to resolve this issue. It allows for
an app to create an attribution context for another app and then
any private data access thorugh this context would result in a
single app op blame that A accessed Foo though B, i.e. we no longer
have double accounting. Also this can be nested through apps, e.g.
app A asks app B which asks app C for contacts. In this case app
B creates an attribution context for app A and calls into app C
which creates an attribution context for app B. When app C gets
contacts the entire attribution chain would get a porper, single
blame: that C accessed the data, that B got the data from C, and
that A got the data form B. Furthermore, this mechanism ensures
that apps cannot forget to check permissions for the caller
before proxying private data. In our example B and C don't need
to check the permisisons for A and B, respectively, since the
permisisons for the entire attribution chain are checked before
data delivery. Attribution chains are not forgeable preventing
a bad actor to create an arbitrary one - each attribution is
created by the app it refers to and points to a chain of
attributions created by their corresponding apps.

This change also fixes a bug where all content provider accesses
were double counted in app ops due to double noting. While at
this it also fixes that apps can now access their own last ops.
There was a bug where one could not pass null getting the attributed
ops from a historical package ops while this is a valid use case
since if there is no attribution everything is mapped to the null
tag. There were some app op APIs not being piped thorough the app
ops delegate and by extension through the app ops policy. Also
now that we have nice way to express the permission chain in a
call we no longer need the special casing in activity manager to
handle content provider accesses through the OS. Fixed a bug
where we don't properly handle the android.os.shell calls with
an invlaid tag which was failing while the shell can do any tag.

Finally, to ensure the mechanims is validated and works end-to-end
we are adding support for a voice recognizer to blame the client
app for the mic access. The recognition service can create a blaming
context when opening the mic and if the mic is open, which would
do all permission checks, we would not do so again. Since changes
to PermissionChercker for handling attribution sources were made
the CL also hooks up renounced permissoins in the request permission
flow and in the permission checks.

bug:158792096
bug:180647319

Test:atest CtsPermissionsTestCases
     atest CtsPermissions2TestCases
     atest CtsPermissions3TestCases
     atest CtsPermissions4TestCases
     atest CtsPermissions5TestCases
     atest CtsAppOpsTestCases
     atest CtsAppOps2TestCases

Change-Id: Ib04585515d3dc3956966005ae9d94955b2f3ee08
2021-03-29 16:49:33 +00:00
Ricky Wai
5b7bdf95bc Merge "Revert "Change mounting storage data and obb to on by default"" into sc-dev 2021-03-19 16:03:54 +00:00
Ricky Wai
6a47d1fe93 Revert "Change mounting storage data and obb to on by default"
Revert submission 13469849-turn_on_iso-sc-dev

Reason for revert: Failing existing CTS b/182843583
Reverted Changes:
If819ee161:Change mounting storage data and obb to on by defa...
I46a095448:Change mounting storage data and obb to on by defa...

Change-Id: I7b33baebe150ab78551c7b4368320f056cdcbceb
2021-03-19 14:21:46 +00:00
Nicolas Geoffray
f920684a60 Merge "Make libsigchain a regular shared library dependency of app_process." am: 2fea6f3f77 am: 5040afaa3e am: 07618a5539
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1621159

Change-Id: Ide62fa6706d8d473f00372864e989c8579d3bf44
2021-03-17 15:57:46 +00:00
Ricky Wai
4f1ad7e423 Merge "Change mounting storage data and obb to on by default" into sc-dev 2021-03-15 14:03:43 +00:00
Nicolas Geoffray
26949eca35 Make libsigchain a regular shared library dependency of app_process.
Bug: 142944043
Test: m, art_libsigchain_test
Change-Id: Iecdb32d9f1906113bbc6fb4bbbe9cee086fca58d
2021-03-09 13:20:20 +00:00
Tyler Gunn
4b033d7316 Merge "CallDiagnosticService API" am: c90335033b am: 9882ff4bf8 am: d3bf1aa209
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1607109

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: Ie91efc29698d27946f83b751bef2fe89d612c9a2
2021-03-03 00:16:56 +00:00
Tyler Gunn
c90335033b Merge "CallDiagnosticService API" 2021-03-02 21:33:02 +00:00
Tyler Gunn
d582184178 CallDiagnosticService API
The CallDiagnosticService API is an OEM-backed API which allows an OEM
provided app to monitor the state of ongoing telephony calls on the
device and to help the user navigate connectivity or audio issues
related to these calls.  It also provides a means for the app to send
and receive device to device messages between devices during an ongoing
call (where supported) in order to facilitate a better calling experience.

Test: Added new CTS test suite for API.
Test: Manual test of CDS behavior using telecom command line option to
override the active CDS to the telecom test app implementation.
Bug: 163085177

Change-Id: I1f37408d2aa6c630f0f9e3d6b6eb8a390d804d7e
2021-02-25 23:08:29 +00:00
Chris Ye
e43039e0dd Merge "Add onDeviceSetReport to HID command tool" into sc-dev 2021-02-25 03:04:38 +00:00
Ruslan Tkhakokhov
a2fdf3f5fb Get OperationType from transport
This CL was merged earlier (ag/13484966) and then reverted due to the
new behaviour breaking D2D transfers.

Merge it again with all changes being controlled by a flag (default
off), see UserBackupManagerService:getOperationTypeFromTransport in this
CL. View the diff between patchsets 1 and 2 to only see what's changed
between the earlier reverted code and the fixed version of it (i.e. with
the flag).

The flag can be changed via adb for now, we will set it to true by
default once other components are ready.

Bug: 174216309
Test: atest UserBackupManagerServiceTest
Change-Id: I7473c9b4f8d0c4d20155be76930279184ffb17c4
2021-02-24 23:21:21 +00:00
Chris Ye
5dea9a9082 Add onDeviceSetReport to HID command tool
When UHID device receives UHID_SET_REPORT event, call onDeviceSetReprot
callback function to set the report output.

Bug: 161633625
Test: atest android.hardware.input.cts.tests.SonyDualshock3UsbTest#testLights
Change-Id: I02923203ddf5a2f2090a11434db19925bbaeaf05
2021-02-24 21:39:12 +00:00
TreeHugger Robot
5c9a0355f8 Merge "Allow syncs to be scheduled as EJs." into sc-dev 2021-02-24 20:12:50 +00:00
Bob Badour
745e7ee830 Merge "[LSC] Add LOCAL_LICENSE_KINDS to frameworks/base" into sc-dev 2021-02-24 18:43:29 +00:00
Michael Wright
69a0c089e9 Merge "Consolidate OWNERS for input" am: 471c70287e am: 916d84985b am: 863092a877
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1600293

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I83f41b7b86208b6ada82728c08043e76f57ac44a
2021-02-24 00:23:09 +00:00