Commit Graph

9640 Commits

Author SHA1 Message Date
TreeHugger Robot
61ea220266 Merge "Create SmsManager from a context" 2020-07-29 03:01:30 +00:00
Jackal Guo
9881ab9aa5 Merge "Correct protectionToString" 2020-07-24 02:41:04 +00:00
Jiyong Park
5a63c65998 Merge "Introduce uses-native-library tag" 2020-07-23 08:56:41 +00:00
Jackal Guo
1fbb8a68d4 Correct protectionToString
The information of protectionLevel companion is missing when dumping
to string.

Bug: 161855740
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Change-Id: Ifa9099541df1c287e5883a801ed14d34dad6287b
2020-07-22 11:20:39 +08:00
Philip P. Moltmann
7ebd559ba9 Create SmsManager from a context
Test: atest CtsAppOpsTestCases:android.app.appops.cts.AppOpsLoggingTest#sendSms
Bug: 161451649, 132365432
Change-Id: I072e13f44f1f7f433ecba8716a6f9b1236275de1
2020-07-20 19:21:23 -07:00
Jiyong Park
6a5b8b1f6d Introduce uses-native-library tag
Since Android 7.0, partners were able to export some of their native
shared libraries to apps. So far, the native libraries were provided to
all apps regardless of whether they are actually needed or not. Even
worse, it was impossible to prevent the installation of an app to the
device where the some (or all) of the required native libs don't exist;
the apps had to manually handle the case, which sometimes impossible
when the dependency is so fundamental.

This change introduces a new tag <uses-native-library> to the app
manifest. Similary to the existing <uses-library> tag which is for
(java) shared libraries, the new tag is used to describe the depedencies
to the native shared libraries.

Apps targeting Android S or higher are required to use the tag to import
the native shared libraries. Libraries that are not depended on won't be
available to the app even if the libraries are listed in the
public.libraries*.txt files. Furthermore, when the dependency can't be
satisfied for an app, the package manager refejects installing the app.

The dependency can be optional using the `android:required` attribute.
When it is set to true, the absence of the lib on the device doesn't
prevent the app from being installed. However, the app has to gracefully
deal with the absence.

The changed behavior only affects apps targeting S or higher. Existing
apps are unaffected; they still get all the public native libraries
regardless of whether they have <uses-native-library> tags or not; the
tags are simply ignored.

This is the first version of the implementation and therefore needs
further refinements. The followings are two major TODOs.

1) The native shared lib dependencies of the java shared libraries
are not enforced. For example, if an app depends on a java shared
library foo and foo depends on some native shared libraries, the
classloader where code from foo is loaded still gets all native shared
libraries. This should be fixed.

2) New APIs should be added. SharedLibraryInfo should be extended to
represent native shared libraries. The meaning of
ApplicationInfo.sharedLibraryFiles should be revised. Finally, the new
tag should be made public.

Bug: 142191088
Test: atest CtsUsesNativeLibraryTest
Change-Id: Iceb038aa86872d23e9faf582ae91b1fdcaf5c64c
2020-07-21 08:42:00 +09:00
Mårten Kongstad
3abb504a08 idmap2: remove the 'scan' command
The 'scan' command has been replaced by 'create-multiple'. Remove the
unused code.

Also remove unused functions and #includes from FileUtils, and the
obsolete JNI plumbing.

Test: atest idmap2_tests OverlayDeviceTests OverlayHostTests
Change-Id: Iae073c13ce64b5db48f22f7e723bc8c0c5fcd2c9
2020-07-20 13:55:41 +00:00
Songchun Fan
69131f8965 Merge "[resolver] only keep one preferred activity if selected with always=true" 2020-07-16 22:42:03 +00:00
Songchun Fan
201c064d3b [resolver] only keep one preferred activity if selected with always=true
With this change, if user selects a preferred activity with "Always"
checked, there will only be one mAlways=true intent filter
for a given action.

BUG: 161394369
Test: manual
Test: atest FrameworksServicesTests
Change-Id: I3d5ee0130f6f07530bb53f9c1509d5121a46a34a
2020-07-16 13:15:31 -07:00
Christopher Tate
44c4994dca Don't clone the locale redundantly in Configuration.setTo()
When updating an existing Configuration instance, don't create a new
clone of the pattern's embedded Locale unless it is materially different
from the existing instance's own.

Bug: 161264248
Test: boot & run
Test: atest AppConfigurationTests
Test: atest ConfigChangeTests
Test: atest LocaleListTest
Change-Id: I5dc0598b89305c488ba50c1774ecdabf939a6ccc
2020-07-15 16:35:00 +00:00
Hall Liu
8cd98c280a Merge "Skip carrier priv check for trusted UIDs" into rvc-dev am: f1a6972937 am: a9d9ea8a3e am: ccc8daf8cf am: 44021f4644
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12141306

Change-Id: I32c52b8e0265148243519f3819781a0c3408a028
2020-07-14 00:48:53 +00:00
Hall Liu
ccc8daf8cf Merge "Skip carrier priv check for trusted UIDs" into rvc-dev am: f1a6972937 am: a9d9ea8a3e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12141306

Change-Id: Iacee9cf6860df0bde8ba367b0085151813909465
2020-07-14 00:01:15 +00:00
Hall Liu
12a3f5cfdc Skip carrier priv check for trusted UIDs
Checking carrier privileges for UIDs with lots of shared apps can incur
a significant performance hit. For UIDs that are fixed and trusted
(system and phone), skip the permission check and always allow.

Also, double the cache size for getPackageInfo in order to reduce the
rate of cache misses.

Bug: 160971853
Test: manual verification -- observed lower rate of cache misses for
getPackageInfo from com.android.phone.

Change-Id: I1399cab579308479d7cf191b8795441cbcd3ff65
2020-07-13 12:45:00 -07:00
Patrick Baumann
5408281e2c Merge "Don't assume host is wildcard if not provided" into rvc-dev am: a1b6280ec8 am: 8f65482603 am: 8b9e0911d0 am: 5954d91e0d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118654

Change-Id: I53913826ec0b6cacf2aeb268a925c3d706e02298
2020-07-10 00:18:54 +00:00
Patrick Baumann
8f65482603 Merge "Don't assume host is wildcard if not provided" into rvc-dev am: a1b6280ec8
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118654

Change-Id: Id420df09eff3c591d4bab1ef7640d7ddf071b93a
2020-07-09 23:44:38 +00:00
Patrick Baumann
a1b6280ec8 Merge "Don't assume host is wildcard if not provided" into rvc-dev 2020-07-09 23:31:56 +00:00
Patrick Baumann
aab67c2b9d Don't assume host is wildcard if not provided
This change ensures that while parsing a package, we require an explicit
wildcard in the queries->intent->data->host field. Prior to this change,
we were defaulting to wildcard when not provided. This resulted in,
e.g. someone trying to get visibility to just browsers actually getting
access to all packages that handle any web intent.

Fixes: 160868841
Test: atest AppEnumerationTests IntentFilterTest
Change-Id: I771845467928b6655fe19efe89bd2ca548dca6e5
2020-07-09 12:28:54 -07:00
Charles Chen
1e3eece9cf Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev am: 5c25605da0 am: a91c84fa14 am: 6263253bae am: 9e19211dc0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105622

Change-Id: Iff671143234e00a2330638011c46be8f064dfad2
2020-07-08 18:33:46 +00:00
Charles Chen
6263253bae Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev am: 5c25605da0 am: a91c84fa14
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105622

Change-Id: I394f915b6577d1972b22e61d11af430a220aad06
2020-07-08 18:09:30 +00:00
Charles Chen
8d53c79a02 Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev am: 5c25605da0
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105622

Change-Id: Ic5670956e2cec2fd6e63a9d0e6c4fa86f2ec991e
2020-07-08 17:59:55 +00:00
Charles Chen
5c25605da0 Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev 2020-07-08 17:46:09 +00:00
Charles Chen
3b8e8d7631 Fix NPE when invoking Context#isUiContext
Add null checks in both ContextWrapper and before obtaining
ContextImpl#getOuterContext.

Test: atest ContextTest#testIsUiContext_ContextWrapper
fixes: 160037462
Change-Id: Ic6a71dd9ac4b195d219d6e5431f2f2b199a400fa
2020-07-08 23:58:58 +08:00
TreeHugger Robot
f52f74dc23 Merge "Remove references to undocumented WHITELIST_AUTO_REVOKE_PERMISSIONS from javadoc" into rvc-dev am: d99b74a975 am: 54e6bc1dbb am: ae0129e47c am: 4a23a4e5ed
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087983

Change-Id: I179084c4d78f91bb13cd81e9400a1ae7380eaeca
2020-07-08 03:48:19 +00:00
TreeHugger Robot
ae0129e47c Merge "Remove references to undocumented WHITELIST_AUTO_REVOKE_PERMISSIONS from javadoc" into rvc-dev am: d99b74a975 am: 54e6bc1dbb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087983

Change-Id: I4c31e6069b8d23baea3d0ce94c858cb8e0ca8540
2020-07-08 03:28:39 +00:00
TreeHugger Robot
038d147eab Merge "Remove references to undocumented WHITELIST_AUTO_REVOKE_PERMISSIONS from javadoc" into rvc-dev am: d99b74a975
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12087983

Change-Id: Ibf148f64366a3f6c935b8950ed0b2e87b16e1547
2020-07-08 03:16:29 +00:00
Eugene Susla
aad46b8980 Remove references to undocumented WHITELIST_AUTO_REVOKE_PERMISSIONS from javadoc
Fixes: 160119966
Test: presubmit
Change-Id: If7db38ae7d96441cabab1141e93abf357daf8164
2020-07-06 10:23:25 -07:00
Alex Buynytskyy
4925e3a220 Fix transfer API.
Transfer API should throw security exception when transfering the
session which is not installing the original installer.
Moving it onto commit stage and still fail the installation.

Fixes: 158805288
Test: atest InstallSessionTransferTest
Test: atest -p frameworks/base/services/core/java/com/android/server/pm
Change-Id: I8511d4357788e70f83bcbd366908b42a691afbcb
2020-07-02 21:24:08 -07:00
TreeHugger Robot
a578b1a6f6 Merge "Revert "Throw an explicit exception if content provider process times out"" 2020-07-01 19:00:54 +00:00
Kholoud Mohamed
567adca54b Revert "Throw an explicit exception if content provider process times out"
This reverts commit 16e83d2a45.

Reason for revert: Droidcop-triggered revert due to breakage 
https://android-build.googleplex.com/builds/quarterdeck?testMethod=testConstructor_protectedCancellableEsc&testClass=android.app.cts.DialogTest&atpConfigName=suite%2Ftest-mapping-presubmit-retry_cloud-tf&testModule=CtsAppTestCases&fkbb=6633955&lkbb=6642068&lkgb=6633902&testResults=true&badBuildCount=147&branch=git_master&target=cf_x86_phone-userdebug

, bug https://buganizer.corp.google.com/issues/160310602

Change-Id: I3b04175290a9044ff26800ecc4b382c68f76597e
2020-07-01 14:22:04 +00:00
Alex Buynytskyy
e7beb39f3c Disable Incremental installation of system apps + test.
Bug: 160271473
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I04ab98418c37e0dfa56bd1e2a5fded6a23e8d9df
2020-06-30 22:09:13 -07:00
Alex Buynytskyy
50d99e60af Correct parsing of application/profileable tag + cts.
Bug: 160244186
Test: atest PackageManagerShellCommandIncrementalTest
Change-Id: I60de8c5300818a2c14c8532b29a023d1b0e0f5b5
2020-06-30 13:38:57 -07:00
Dmitri Plotnikov
16e83d2a45 Throw an explicit exception if content provider process times out
Fixes: 149110957
Test: atest FrameworksCoreTests:android.content.ContentResolverTest

Change-Id: If4beac53d8b47c31503fd980f9a1e38d34e9c671
2020-06-26 13:40:14 -07:00
TreeHugger Robot
e45fa0e00e Merge "Require explicit android:exported in manifests for services" 2020-06-26 15:29:57 +00:00
Ashwini Oruganti
553bada329 Require explicit android:exported in manifests for services
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: Icc34b533cd7420e5754f7a1e7ae9fde937febf7d
2020-06-24 12:37:01 -07:00
Makoto Onuki
42bec243c0 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.

Exempt-From-Owner-Approval:Cherry-pick from goog/master
Bug: 159121253
Test: treehugger (i.e. this shouldn't trigger "API has changed" error.)
Merged-in: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
Change-Id: Ie1841a670bdf6c6f4b25a1fc5deed8ec2d18cda2
2020-06-24 18:02:10 +00:00
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
32bb7140ef Merge "Update Java doc for FLAG_ACTIVITY_LAUNCH_ADJACENT" into rvc-dev am: 8411d73710
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11905502

Change-Id: Iacb5eb08a2bd9e69a6c54c4f66eda12de6e46a4a
2020-06-18 16:46:59 +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
a61dae35a9 Merge "Relax minimum signature scheme version for apps on system partition" into rvc-dev am: 67cb3a610d
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11885723

Change-Id: Ia6bca552833917bdc84e7a445e070074d39d7d1d
2020-06-18 16:23:13 +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