Commit Graph

9600 Commits

Author SHA1 Message Date
Makoto Onuki
4290301e85 Remove unnecessarily @System/TestApi annotations
We can't expose APIs if the enclosing class is hidden, so these
annotations are redundant. We need to remove them so that we can enable the
check.

Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
2020-06-23 10:51:50 -07:00
Philip P. Moltmann
3a69660910 Remove legacy support for "featureId".
"featureId" was the old name of "attributionTag". This was never shipped
in any public build and is hence just dead code.

Bug: 151105954
Test: atest CtsAppOpsTestCases
Change-Id: I7570e7f84cc3f6cabaa769c700c3ceaf7eed0ae9
2020-06-19 19:57:27 -07:00
TreeHugger Robot
d9584c4171 Merge "Update Java doc for FLAG_ACTIVITY_LAUNCH_ADJACENT" into rvc-dev am: 8411d73710 am: a4c19e96b8 am: 4fb95e641b am: 235018df3f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11905502

Change-Id: I50b048e9f25953006b0e81eb7a27ddcafc7f6cd2
2020-06-18 18:04:53 +00:00
Automerger Merge Worker
f2debfb6c6 Merge "Merge "Relax minimum signature scheme version for apps on system partition" into rvc-dev am: 67cb3a610d am: 24fd285d50 am: 72afc021f8" into rvc-qpr-dev-plus-aosp am: 0219a70087
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11885723

Change-Id: I63aba7891013ea7a221d8d38429ebbfef0618d81
2020-06-18 18:02:17 +00:00
TreeHugger Robot
235018df3f Merge "Update Java doc for FLAG_ACTIVITY_LAUNCH_ADJACENT" into rvc-dev am: 8411d73710 am: a4c19e96b8 am: 4fb95e641b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11905502

Change-Id: Ic58713aa5fda6bbe6b291e0699ff97fe07e8e5c7
2020-06-18 17:04:45 +00:00
Michael Groover
72afc021f8 Merge "Relax minimum signature scheme version for apps on system partition" into rvc-dev am: 67cb3a610d am: 24fd285d50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11885723

Change-Id: I87b313c9ef2d7006ac36be0f830f9f07f55f4121
2020-06-18 16:47:12 +00:00
TreeHugger Robot
8411d73710 Merge "Update Java doc for FLAG_ACTIVITY_LAUNCH_ADJACENT" into rvc-dev 2020-06-18 16:40:32 +00:00
Michael Groover
67cb3a610d Merge "Relax minimum signature scheme version for apps on system partition" into rvc-dev 2020-06-18 16:13:30 +00:00
jun.h.cho
c3540cc2f9 Update Java doc for FLAG_ACTIVITY_LAUNCH_ADJACENT
The behavior of the adjacent flag is changed. It can be changed to split-screen mode if supported by the system.

Fixes: 155050369
Test: n/a
Change-Id: Ia19e0228442e7c8847d403ee2def841f1c0b712b
2020-06-18 07:55:15 -07:00
Michael Groover
b71e398935 Relax minimum signature scheme version for apps on system partition
Android 11 requires a minimum V2 APK signature for apps targeting SDK
version 30+; however some apps on a system partition can only be signed
with the V1 signature scheme. This commit relaxes the minimum signature
scheme version to allow for these apps on a system partition.

Bug: 158728035
Test: atest PackageManagerTest
Test: atest PackageManagerTests
Test: atest PkgInstallSignatureVerificationTest
Change-Id: I1a95fd6894cc937e00ad1ac54d1846b51b48e9cd
2020-06-17 11:02:18 -07:00
TreeHugger Robot
d4ab7ece55 Merge "Do not change value read from manifest." 2020-06-16 16:49:18 +00:00
TreeHugger Robot
994d891cd3 Merge "Add tron metrics to track iorap." into rvc-dev am: f40975ee76 am: 1c53e8cfa4 am: cd8eece1c1 am: 4441700f86
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11833622

Change-Id: I2289dda307d571fa78363809b1ca7c25d8db987e
2020-06-16 03:04:43 +00:00
TreeHugger Robot
cd8eece1c1 Merge "Add tron metrics to track iorap." into rvc-dev am: f40975ee76 am: 1c53e8cfa4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11833622

Change-Id: I14c76c58d66ff900db24963fcbde70f708ead5eb
2020-06-16 02:45:52 +00:00
TreeHugger Robot
f40975ee76 Merge "Add tron metrics to track iorap." into rvc-dev 2020-06-16 02:20:26 +00:00
Alex Buynytskyy
3c7b637abf Do not change value read from manifest.
Current code modifies the flag 'profilable' based on another flag
'debuggable'.

Test: refactoring CL. Existing unit tests still pass.

Change-Id: Ib6564eb494a977b97fc2107f144bc87d4bd1e36a
2020-06-15 12:26:59 -07:00
yawanng
35a0090975 Add tron metrics to track iorap.
Bug: 158007508
Test: Make and manually check the log using
"adb logcat -b events | grep sysui_multi_action".
Change-Id: I8365bbaa0abf65bdffd8da9462a2295a5e37b3c2
2020-06-15 17:01:04 +00:00
TreeHugger Robot
9b55f5ffd1 Merge "Don't provide read logs for shell-initiated installations." into rvc-dev am: e0ba6d9dff am: 95a411a87d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11778056

Change-Id: Ib82b69429655ab0245b08aeab615766e41296e7c
2020-06-15 16:59:31 +00:00
Alex Buynytskyy
3697d9e45d 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
2020-06-12 14:39:18 -07: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
TreeHugger Robot
a7565c1bd1 Merge "Apply theme shape clipping to group convo avatars" into rvc-dev am: 0561690cac am: e97c7fbfec am: bd1153d52d am: 56640d5623
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11820082

Change-Id: I75d4cffbe410dc41309dbfbb8db772bbd3adacea
2020-06-11 19:22:00 +00:00
TreeHugger Robot
bd1153d52d Merge "Apply theme shape clipping to group convo avatars" into rvc-dev am: 0561690cac am: e97c7fbfec
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11820082

Change-Id: Id487db769b688dbc29c4a6b2d8de4e7b0e3d9b1f
2020-06-11 18:59:56 +00:00
TreeHugger Robot
0561690cac Merge "Apply theme shape clipping to group convo avatars" into rvc-dev 2020-06-11 18:22:46 +00:00
TreeHugger Robot
240097557a Merge "Fix PackagePartitions contains null check" into rvc-dev am: ca4709a9a5 am: 26c2956206 am: c27c0e20e9 am: 71df094390
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11825431

Change-Id: Ie212068bcea1767a4e615e69c2420b7d1970010f
2020-06-10 21:11:16 +00:00
TreeHugger Robot
26c2956206 Merge "Fix PackagePartitions contains null check" into rvc-dev am: ca4709a9a5
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11825431

Change-Id: Ia1521e95d4b2776e789ec8ce30d4a06bc91455b2
2020-06-10 20:45:22 +00:00
Steve Elliott
86bc69a491 Apply theme shape clipping to group convo avatars
Fixes: 158493588
Test: manual
Change-Id: I57b5e0712822b345c9dcce74b8a6d6ff33409de6
2020-06-10 15:23:33 -04:00
Winson
6bdadaf0a0 Fix PackagePartitions contains null check
The subfolders can be null depending on the partition.

Bug: 158671002

Test: manual was tested as part of not yet merged
	Ie09ccf4b64a0be26d19c9034a68ca4877ca49b81

Change-Id: Ic3a07867cb50b6b0b0e265e9540c52ee94c68050
2020-06-10 11:07:12 -07:00
Charles Munger
bc2260794c Merge "Deprecate public PackageManager constructor." am: 2b745800a8 am: 061ce932ce am: d3c43f0789 am: b0f12b4b89 am: 981761c088
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1314369

Change-Id: I9922765a6d2355a488db34d32fec35a44bf8d564
2020-06-09 01:10:47 +00:00
Charles Munger
d3c43f0789 Merge "Deprecate public PackageManager constructor." am: 2b745800a8 am: 061ce932ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1314369

Change-Id: I232e22992440b51dcd41b77cc76e0db3dd83787e
2020-06-09 00:44:29 +00:00
Charles Munger
e73a6a704e Deprecate public PackageManager constructor.
BUG=63112905

Change-Id: I0277737eb9e683073f27d2ddea30c93f78ec4b91
2020-06-08 17:37:31 +00:00
TreeHugger Robot
9f15ba2e1a Merge "Fix up discrepancies between v1 and v2 package parsing" into rvc-dev 2020-06-04 18:12:56 +00:00
Automerger Merge Worker
bcb6c7aff5 Merge "Merge "Deprecate docs for auto revoke manifest and Intent APIs" into rvc-dev am: c43f49dfc4 am: 5ec84ee3a3 am: de433322e2" into rvc-qpr-dev-plus-aosp am: 1a593e5ee6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11722408

Change-Id: If4436bcd35962f297dbe12e147fcb6462007306f
2020-06-04 01:57:27 +00:00
Eugene Susla
de433322e2 Merge "Deprecate docs for auto revoke manifest and Intent APIs" into rvc-dev am: c43f49dfc4 am: 5ec84ee3a3
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11722408

Change-Id: Ic33f82bceb3257f976bac23640c61edc6739f808
2020-06-04 01:36:26 +00:00
Eugene Susla
f42f5f69a7 Merge "Deprecate docs for auto revoke manifest and Intent APIs" into rvc-dev am: c43f49dfc4
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11722408

Change-Id: I0878a342bc43867bf2113e23cdf564afa30e2f1c
2020-06-04 01:23:16 +00:00
Eugene Susla
c43f49dfc4 Merge "Deprecate docs for auto revoke manifest and Intent APIs" into rvc-dev 2020-06-04 01:08:10 +00:00
Eugene Susla
c7cae60a64 Deprecate docs for auto revoke manifest and Intent APIs
Test: presubmit
Bug: 153607914
Change-Id: I9c8d0aa1432ca00b729f19749e751cb117374b0a
2020-06-03 13:46:00 -07:00
Winson Chiu
5b66a3d0eb Merge "Fix up discrepancies between v1 and v2 package parsing" into rvc-dev-plus-aosp 2020-06-03 20:41:27 +00:00
Ashwini Oruganti
e8728dbf78 Merge "Require explicit android:exported in manifests" 2020-06-03 17:53:57 +00:00
TreeHugger Robot
44c8645f27 Merge "Add PackageInstaller SessionParams restrictions" into rvc-dev am: a817a0515e am: 0310dbe4fc am: 3de943756f am: 304cd07d0b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11621266

Change-Id: Ic5271e7297504f480d571f4c0cb2c248e78f74b1
2020-06-03 17:31:36 +00:00
Winson
10d51880e2 Add PackageInstaller SessionParams restrictions
To mitigate a boot loop with reading a massive
install_sessions.xml file, this restricts the amount of
data that can be written by limiting the size of
unbounded parameters like package name and app label.

This introduces a lowered max session count. 50 for general
applications without the INSTALL_PACKAGES permission, and
the same 1024 for those with the permission.

Also truncates labels read from PackageItemInfo to 1000
characters, which is probably enough.

These changes restrict a malicious third party app to ~0.15 MB
written to disk, and a valid installer to ~3.6 MB, as opposed to
the >1000 MB previously allowed.

These numbers assume no install granted runtime permissions.
Those were not restricted since there's no good way to do so,
but it's assumed that any installer with that permission is
highly privleged and doesn't need to be limited.

Along the same lines, DataLoaderParams are also not restricted.
This will have to be added if that API is ever made public.

However, installer package was restricted, even though the API is
hidden. It was an easy add and may have some effect since the value
is derived from other data and passed through by other system
components.

It's still possible to inflate the file size if a lot of
different apps attempt to install a large number of packages,
but that would require thousands of malicious apps to be installed.

Bug: 157224146

Test: atest android.content.pm.PackageSessionTests

Change-Id: Iec42bee08d19d4ac53b361a92be6bc1401d9efc8
2020-06-02 12:58:53 -07:00
Winson
4548256900 Fix up discrepancies between v1 and v2 package parsing
For Activity aliases, it's possible some values are already
set, which means they cannot be assumed to be 0, and can't be
overwritten if a attribute in the alias is undefined. For the
parsing v2 refactor, this was cleaned up to avoid
redundant != 0 checks, but those checks are indeed necessary.
This copies over the old logic and uses it exactly.

In some future cleanup, there should be a more structured way
of doing this, since it's not immediately obvious which values
are overridden or not. For example, description is always
overwritten even if no new value is provided in the alias.

This also fixes up the comparison tests and other bugs that
popped up because of them. The core issue was that when
auto-generating the dumpToString methods, the Alt+Insert
macro default selects all the fields in the current class,
but not all the parent classes, so some shared fields like
name/icon were not considered.

A notable case that was found when running the comparison tests
is that persistableMode is now "fixed" with v2. Previously,
a bug in PackageParser caused this value to be dropped if
the ActivityInfo object ever had to be copied. This is a change
from Q behavior, but there's no good way to reconcile this, and
it's better to be correct and consistent than broken, so this
fix was left in and excluded from the comparison tests.

Bug: 150106908

Test: manual run through steps in bug
Test: atest com.android.server.pm.parsing

Merged-In: I1301e28540314d0e643b73af7146c1a366eca6b5
Change-Id: I1301e28540314d0e643b73af7146c1a366eca6b5
2020-06-02 18:25:01 +00:00
TreeHugger Robot
5dbe9b099f Merge "Fix up discrepancies between v1 and v2 package parsing" 2020-06-02 15:50:33 +00:00
Zimuzo Ezeozue
5fd1767ab1 Merge "Support apps sharing file:// URIs with the camera API" into rvc-dev am: efbc3f2d5e am: d371efcfb2 am: 46ca9f3ddd am: b8dd27d216
Original change: undetermined

Change-Id: I7b34b29c6cef114420491bb1710f240e38b3981d
2020-06-02 11:37:20 +00:00
Zimuzo Ezeozue
efbc3f2d5e Merge "Support apps sharing file:// URIs with the camera API" into rvc-dev 2020-06-02 10:45:33 +00:00
Automerger Merge Worker
463207a1e8 Merge "Merge "[wm] Introduce meta-data tag (android.supports_size_changes)" into rvc-dev am: 247144d4a2 am: 925463ba53 am: e9f14eeb22" into rvc-qpr-dev-plus-aosp am: 66b1ad0ddf
Original change: undetermined

Change-Id: I531d037518115630bb7d7a1eeef4cb31ccca9c19
2020-06-01 22:12:23 +00:00
Zim
c7496a3a62 Support apps sharing file:// URIs with the camera API
The camera API, MediaStore.ACTION_IMAGE_CAPTURE requires apps to pass
a content:// URI with write permissions to the camera. Unfortunately,
apps haven't been doing this and we only started hitting problems in R
for two reasons:
1. The FileUriExposedException that should crash apps when they try to
share file:// URIs acroos binder is skipped. This is because, the
image_capture intent is passed across binder as a field in a
ChooserActivity Intent and the child intents are not checked for
file URI exposed
2. Prior to R, when camera gets a file:// URI, camera issues a file
open(2) in its process. This open(2) succeeds because the camera had
write_external_storage permission which gave it write access to all
files on external storage

Now, camera targets R and (2) fails because camera does not have write
access to files owned by other apps. To workaround, we do the
following in the apps process when it targets < R:
a. When we detect a file:// URI for the camera in an Intent, we create
the file on disk if it is not already created.
b. Scan the file to insert it in the database and retrieve a
content:// URI
c. Replace the file:// URI with the content URI in the image_capture
intent

This works because, the system will ensure the camera is granted write
access to the content URI.

Test: Manual
Bug: 156336269
Change-Id: I4849ff5e806a8207650ff7534846c36ecdc6d3c0
2020-06-01 20:33:52 +01:00
Winson
69738c7547 Fix up discrepancies between v1 and v2 package parsing
For Activity aliases, it's possible some values are already
set, which means they cannot be assumed to be 0, and can't be
overwritten if a attribute in the alias is undefined. For the
parsing v2 refactor, this was cleaned up to avoid
redundant != 0 checks, but those checks are indeed necessary.
This copies over the old logic and uses it exactly.

In some future cleanup, there should be a more structured way
of doing this, since it's not immediately obvious which values
are overridden or not. For example, description is always
overwritten even if no new value is provided in the alias.

This also fixes up the comparison tests and other bugs that
popped up because of them. The core issue was that when
auto-generating the dumpToString methods, the Alt+Insert
macro default selects all the fields in the current class,
but not all the parent classes, so some shared fields like
name/icon were not considered.

A notable case that was found when running the comparison tests
is that persistableMode is now "fixed" with v2. Previously,
a bug in PackageParser caused this value to be dropped if
the ActivityInfo object ever had to be copied. This is a change
from Q behavior, but there's no good way to reconcile this, and
it's better to be correct and consistent than broken, so this
fix was left in and excluded from the comparison tests.

Bug: 150106908

Test: manual run through steps in bug
Test: atest com.android.server.pm.parsing

Merged-In: I1301e28540314d0e643b73af7146c1a366eca6b5
Change-Id: I1301e28540314d0e643b73af7146c1a366eca6b5
2020-06-01 17:53:18 +00:00
Winson
66e9f33cc5 Fix up discrepancies between v1 and v2 package parsing
For Activity aliases, it's possible some values are already
set, which means they cannot be assumed to be 0, and can't be
overwritten if a attribute in the alias is undefined. For the
parsing v2 refactor, this was cleaned up to avoid
redundant != 0 checks, but those checks are indeed necessary.
This copies over the old logic and uses it exactly.

In some future cleanup, there should be a more structured way
of doing this, since it's not immediately obvious which values
are overridden or not. For example, description is always
overwritten even if no new value is provided in the alias.

This also fixes up the comparison tests and other bugs that
popped up because of them. The core issue was that when
auto-generating the dumpToString methods, the Alt+Insert
macro default selects all the fields in the current class,
but not all the parent classes, so some shared fields like
name/icon were not considered.

A notable case that was found when running the comparison tests
is that persistableMode is now "fixed" with v2. Previously,
a bug in PackageParser caused this value to be dropped if
the ActivityInfo object ever had to be copied. This is a change
from Q behavior, but there's no good way to reconcile this, and
it's better to be correct and consistent than broken, so this
fix was left in and excluded from the comparison tests.

Bug: 150106908

Test: manual run through steps in bug
Test: atest com.android.server.pm.parsing

Change-Id: I1301e28540314d0e643b73af7146c1a366eca6b5
2020-06-01 17:52:58 +00:00
Kwangho Lim
2141f707b7 [wm] Introduce meta-data tag (android.supports_size_changes)
Introduce meta-data tag "android.supports_size_changes" which will indicated that an activity works well with size changes like display changing size.

Test: Manual - Run by adding metadata to the app running with SizeCompatMode.
Bug: 155041354
Change-Id: I0f358f63c9e14c63294275c0bfcd08744bee1108
2020-06-01 08:34:38 -07:00
TreeHugger Robot
92cb1b7124 Merge "Add test for permission APEX." into rvc-dev am: e40b321ee6 am: 7a4f041cc0 am: fc5d27390c am: a82376011e
Change-Id: Iac0ef2d1dc0bb8067585c216ea9b315a8a18e60b
2020-05-29 22:37:51 +00:00
Ashwini Oruganti
c4e90ac06a Require explicit android:exported in manifests
Starting S+, if an intent filter is defined, we are requiring that the
android:exported flag also be explicitly defined in the manifest. With
this change apps targeting S+  that do not meet this requirement will
fail to install.

There is no change in the default behavior of the `android:exported`
flag when there is no intent filter defined (i.e. the flag defaults to
false in these cases).

Bug: 150232615
Test: Flashed the build on a device and tested with test apps
Change-Id: I36efeebf28f21a4d4277f40a17e38d2183514037
2020-05-29 14:48:28 -07:00