Commit Graph

8867 Commits

Author SHA1 Message Date
Daniel Chapin
3a54effffd Revert "Prevents an NPE when content provider is slow to start"
This reverts commit 140fc2e9c9.

Reason for revert: b/149176266

Change-Id: I4015fcc1624ee116c4a013c99816d43ce7b24834
2020-02-10 22:12:44 +00:00
Dmitri Plotnikov
140fc2e9c9 Prevents an NPE when content provider is slow to start
Also, extends the client-side timeout to match that
in ActivityManagerService.

Test: atest FrameworksCoreTests:android.content.ContentResolverTest
Fixes: 148987678
Change-Id: I1daf8625bd0306cc6f6f08c3268fa191d37bda7a
2020-02-07 13:58:06 -08:00
Eugene Susla
695cfc2057 Merge "Introduce permission flag for whitelisting permission from auto-revoke" 2020-02-05 21:10:47 +00:00
Tony Mak
4624cdd12e Merge "Make TCS.getDefaultTextClassifierImplementation returns a ... SystemTextClassifier that is backed by ExtServices" 2020-02-05 14:44:39 +00:00
Tony Mak
c5a7432ebf Make TCS.getDefaultTextClassifierImplementation returns a ...
SystemTextClassifier that is backed by ExtServices

1. The default textclassifier is always provided by
   config_servicesExtensionPackage (i.e. ExtServices)
2. OEM can specify a system text classifier by specifying
   config_defaultTextClassifierPackage.
3. System text classifiers can get an instance of the default textclassifier
   by calling TCS.getDefaultTextClassifierImplementation(), so that
   they can add their customization on top of the default TCS.
4. If config_systemTextClassifierPackage is set, the specified package
    is used to process requests from apps and the platform. Otherwise,
   the default textclassifier is used.
5. For testing and droidfooding purpose, text classifier service package
   can be overridden. If the overridden package is neither
   the default one nor the system one, the package is considered as a
   untrusted text classifier, which can only see requests from itself.

Test: m mts && mts-tradefed run mts-extservices
Test: Not setting config_defaultTextClassifierPackage. Select some text and
      make sure smart selection works. Run dumpsys textclassification
      to make sure the default TCS is bound.
Test: Setting config_defaultTextClassifierPackage and repeat the above.
      Make sure the specified OEM text classifier is used.
Test: Set the service override config to be ExtServices.
      Run dumpsys textclassification to make sure everything is unbound.
      Select some text and make sure ExtServices is bound.
Test: Set the service override to be AiAi and repeat the above.
Test: Set the service to be something invalid and repeat the above.
      Observe that no TC is bound and fallback to NO_OP.

BUG: 148049185

Change-Id: Ia2fb549fda49363e0d0ebc4b7e0d31cb76e11ee0
Make TCS.getDefaultTextClassifierImplementation returns a ...
SystemTextClassifier that is backed by ExtServices

1. The default textclassifier is always provided by
   config_servicesExtensionPackage (i.e. ExtServices)
2. OEM can specify a system text classifier by specifying
   config_defaultTextClassifierPackage.
3. System text classifiers can get an instance of the default textclassifier
   by calling TCS.getDefaultTextClassifierImplementation(), so that
   they can add their customization on top of the default TCS.
4. If config_systemTextClassifierPackage is set, the specified package
    is used to process requests from apps and the platform. Otherwise,
   the default textclassifier is used.
5. For testing and droidfooding purpose, text classifier service package
   can be overridden. If the overridden package is neither
   the default one nor the system one, the package is considered as a
   untrusted text classifier, which can only see requests from itself.

Test: m mts && mts-tradefed run mts-extservices
Test: Not setting config_defaultTextClassifierPackage. Select some text and
      make sure smart selection works. Run dumpsys textclassification
      to make sure the default TCS is bound.
Test: Setting config_defaultTextClassifierPackage and repeat the above.
      Make sure the specified OEM text classifier is used.
Test: Set the service override config to be ExtServices.
      Run dumpsys textclassification to make sure everything is unbound.
      Select some text and make sure ExtServices is bound.
Test: Set the service override to be AiAi and repeat the above.
Test: Set the service to be something invalid and repeat the above.
      Observe that no TC is bound and fallback to NO_OP.

BUG: 148049185

Change-Id: Ia2fb549fda49363e0d0ebc4b7e0d31cb76e11ee0
2020-02-04 20:36:52 +00:00
Eugene Susla
7794d109cc Introduce permission flag for whitelisting permission from auto-revoke
This will be the flag set for granted permissions when we want to exempt
it from automatic revocation.

Test: lint/presubmit
Bug: 146513245
Change-Id: I21b6ecb62726643de635d0d5197f7f889a2ab87a
2020-02-04 10:56:24 -08:00
Dianne Hackborn
f27a9578e5 Merge "Work on issue #143085640: Per-process network access control" 2020-02-04 17:30:52 +00:00
WAYNE YANG
6bfbee076b Merge "Added a new "retailDemo" protection level." 2020-02-04 06:56:48 +00:00
TreeHugger Robot
99e390e9af Merge "Allows forceQueryable to be set on install" 2020-02-04 01:55:44 +00:00
TreeHugger Robot
b91132c6fc Merge "More documentation on ACTION_DATA_LOADER" 2020-02-03 23:29:46 +00:00
Songchun Fan
17249d37fc More documentation on ACTION_DATA_LOADER
BUG: 148285952

Test: just adding comments
Change-Id: I5e309167b1fadc19304b8def259f4f3473b815d9
2020-02-03 22:02:16 +00:00
Songchun Fan
bf3e455597 Merge "Change app code path" 2020-02-03 21:06:52 +00:00
TreeHugger Robot
7fa9abc93b Merge "This change includes multiple things:" 2020-02-03 20:17:35 +00:00
Song Pan
5604437f79 This change includes multiple things:
1. Add a test API for GTS tests to recover the saved rules after the test.
2. Fix a bug where we incorrectly hashed the certificate hashes again.
3. Do not skip the integrity verification for rule providers if one settings is
enabled. This is because otherwise installs from GTS test will not be checked.

Bug: 145674131
Test: manual run of GTS test.
Test: atest AppIntegrityManagerServiceImplTest
Change-Id: Ia61265b1e9d20d310b695ad20982da80b5d659ba
2020-02-03 18:30:28 +00:00
atrost
09c1f3fab3 Add description to THROW_SECURITY_EXCEPTIONS
Having a change id without a description will fail m offline-sdk-docs
once https://android-review.googlesource.com/q/topic:%22compatdocs%22
is merged.
The description is based on the comment on rethrowSecurityException.

Test: m offline-sdk-docs
Bug: 144927670

Change-Id: I49af09b92432f823b10967b02b81f5d8e0ffd593
2020-02-03 17:11:08 +00:00
Dianne Hackborn
fc0839ae30 Work on issue #143085640: Per-process network access control
Fix some issues when apps start declaring processes, add validation
that apps don't use processes they haven't declared (if they
declared some).  Also add package dump output for the processes it
has declared.

Bug: 143085640
Test: atest CtsAppSecurityHostTestCases:UseProcessTest
Change-Id: If1d13bf402d2b0aea06f0c2c02d5e392c774c812
2020-02-02 13:39:32 -08:00
wayneyang
8126b1fe0f Added a new "retailDemo" protection level.
Permissions that have the new wellbeing protection flag will be granted
to the retail demo app, as defined by the OEM in the system resource.

The PACAKGE_USAGE_STATS permission is updated to use the retailDemo
flag.

Bug: 146043112
Test: atest CtsPermission2TestCases:PermissionPolicyTest
Change-Id: I30b451e6e88a4d65af5e5f774bcd30a14721a8a9
2020-02-02 22:34:37 +08:00
Patrick Baumann
5ff0f9ea6a Allows forceQueryable to be set on install
This change adds a --force-queryable flag to adb install to allow, for
development and testing purposes, the ability to install a package so it
is visible to all other packages on the device.

Bug: 142386643
Test: atest AppEnumerationTests
Change-Id: Id793ac39a4dfb022fc5e4c0c1230a3da77bf41c6
2020-02-01 03:55:57 +00:00
Songchun Fan
f56f1c5c58 Change app code path
Incremental (go/incremental-apk) requires bind-mounting on /data/app/...
directories. The purpose of this change is to avoid leaking package names in
/proc/mounts.

Default apk path of an installed app:
Before: /data/app/[packageName]-[randomString]/base.apk
After: /data/app/~~[randomStringA]/[packageName]-[randomStringB]/base.apk

BUG: b/147371381 b/148237378
Test: manual
Change-Id: Ib05b187dc006272603709a95534c40744cd62f0c
2020-01-31 09:14:16 -08:00
Andrii Kulian
e11e951f66 Merge changes from topic "add_bundle_to_window_context"
* changes:
  Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
  Add bundle options to Context#createWindowContext API
2020-01-31 01:16:34 +00:00
Andrii Kulian
e57f2dc246 Exempt-From-Owner-Approval: Fix usages of WindowManager.getDefaultDisplay() in f/b
Replace the existing usages of now-deprecated API
WindowManager.getDefaultDisplay() with WindowMetrics or
Context.getDisplay() in frameworks/base.

Bug: 128338354
Test: Build, auto test
Change-Id: I02d38a022c5e0e6e9d699f03d35b65d6c8126da9
2020-01-31 01:15:21 +00:00
Mehdi Alizadeh
505fb76065 Adds CACHED shortcuts and methods to retrieve and remove
Adds a new flag to ShortcutInfo to mark it as cached. Also adds new
APIs in ShortcutManager to remove or retrieve a cached shortcut.

Bug: 148084870
Test: atest com.android.server.pm.ShortcutManagerTest1 \
            com.android.server.pm.ShortcutManagerTest2 \
            com.android.server.pm.ShortcutManagerTest3 \
            com.android.server.pm.ShortcutManagerTest4 \
            com.android.server.pm.ShortcutManagerTest5 \
            com.android.server.pm.ShortcutManagerTest6 \
            com.android.server.pm.ShortcutManagerTest7 \
            com.android.server.pm.ShortcutManagerTest8 \
            com.android.server.pm.ShortcutManagerTest9 \
            com.android.server.pm.ShortcutManagerTest10
Change-Id: I859b416ccd4228eec10a436550ff98866a62af66
2020-01-29 22:06:40 +00:00
Sudheer Shanka
5257270180 Merge "Make Context.BLOB_STORE_SERVICE public." 2020-01-29 21:12:55 +00:00
TreeHugger Robot
8dee3654a9 Merge "Require signature scheme V2+ for target SDK R+" 2020-01-29 20:47:00 +00:00
Sudheer Shanka
f56f7589bf Make Context.BLOB_STORE_SERVICE public.
Bug: 143559646
Test: atest cts/tests/BlobStore/src/com/android/cts/blob/BlobStoreManagerTest.java
Change-Id: I2ae498803614761f1eab0927ab9e3c77dd65e1a1
2020-01-29 10:52:32 -08:00
Dmitri Plotnikov
715a1c654b Merge "Add async version of getProviderMimeType" 2020-01-29 17:59:51 +00:00
Omer Nebil Yaveroglu
84f7c3fb53 Implement the necessary methods for identifying the DENY / FORCE_ALLOW
causes for logging purposes.

Bug: 147095027
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity/
Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/integrity
Change-Id: Id502287b22fc54fd1585f81b313fb466d1f8442c
2020-01-29 12:21:14 +00:00
Ryan Mitchell
1e80cd76ed Merge changes from topic "res-loader"
* changes:
  Refactor ResourcesLoader Tests
  Refactor ResourcesLoader APIs
2020-01-29 06:57:47 +00:00
Andrii Kulian
ea325634d3 Add bundle options to Context#createWindowContext API
Add Bundle parameter to createWindowContext method to allow
passing window-related options.

Bug: 128338354
Test: Build, auto test
Change-Id: I19cf9335068ecf94c9d94a99be0e8f1021f78e34
2020-01-28 17:52:57 -08:00
Dmitri Plotnikov
d55a387f78 Add async version of getProviderMimeType
Fixes: b/147646960
Test: atest FrameworksCoreTests:android.content.ContentResolverTest

Change-Id: I04c15ac008fe14b215f954af150226dc94f22232
2020-01-28 17:35:45 -08:00
Ryan Mitchell
4579c0aea2 Refactor ResourcesLoader APIs
This changes refactors the ResourcesLoader APIs.
The main changes are:

Rather than pairing a ResourcesLoader with a ResourcesProvider, a
ResourcesProvider is paired with an AssetsProvider which is only
responsible for overriding the values of file-base resources and
assets. An AssetsProvider can be shared between multiple
ResourcesProviders.

ResourcesLoader now holds a list of ResourcesProviders.

ResourcesLoaders are part of ResourcesKeys and requests for resources
with the same loaders will use the same underlying ResourcesImpl. This
allows the loader specific code in RM to be cleaned up.

ResourcesLoaders and Resources objects use callbacks to notify RM
of changes to the Resources instance that may require a new
ResourcesImpl.

When a context is created from another context, the new context will
include the loaders of the original context. Change to list of either
context's loaders will not change the loaders of the other context,
but changes to the providers a loaders uses will update all Resources
objects that use that loader.

Activity resources will include the loaders of the application context
at the time of the Activity's creation.

Bug: 147359613
Test: atest ResourceLoaderTests
Change-Id: I2957c803d3f0c1280abfd3c723d76b18df2c3789
2020-01-28 15:35:14 -08:00
Michael Groover
33df7c415a Require signature scheme V2+ for target SDK R+
With the recent sha-1 news, and since minSdk less than 18 for RSA and
minSdk less than 21 for DSA require sha-1, APK signature verification
will now require a minimum of a V2 signature for apps targeting R+.

Bug: 148313868
Test: atest PkgInstallSignatureVerificationTest
Change-Id: I8f518102a0b7cef190cbca59d140d380ae41c326
2020-01-28 14:31:29 -08:00
Jonathan Scott
4f3fb47cec Merge "Add crossProfile to ApplicationInfo." 2020-01-28 16:51:09 +00:00
Jonathan Scott
f9b99f5fa1 Add crossProfile to ApplicationInfo.
Test: Manual
Change-Id: I11b5d9919e4463cdaf89826360bc12ae68dbd0af
Bug: 142538125
Bug: 142537267
2020-01-28 15:55:58 +00:00
Jovana Knezevic
873cc29e53 Merge "Switching to pre-created users should not be supported." 2020-01-27 20:59:22 +00:00
Jayant Chowdhary
1636af3a1a Merge "camera2: Add apis for querying concurrent streaming support." 2020-01-27 18:24:07 +00:00
TreeHugger Robot
c99357ab0a Merge "Add hinge angle sensor feature to PackageManager" 2020-01-27 16:54:07 +00:00
Brad Ebinger
854d2ff9a5 Merge "Make remaining UCE related APIs @SystemApi" 2020-01-27 16:47:44 +00:00
Remi NGUYEN VAN
d2d2ea298a Merge "Add support for Ethernet tethering" 2020-01-27 13:01:29 +00:00
Remi NGUYEN VAN
84229e0a8e Add support for Ethernet tethering
Ethernet tethering can be started via
startTethering(TETHERING_ETHERNET).

Test: flashed, enabled ethernet tethering, verified internet access on
      downstream.
Bug: 130840861

Change-Id: I34842acd94b972e440c3622f7617df10c18acf65
2020-01-27 19:31:08 +09:00
Jayant Chowdhary
a24f94b1fe camera2: Add apis for querying concurrent streaming support.
- getConcurrentStreamingCameraIds
- isConcurrentSessionConfigurationSupported

Bug: 77960042

Test: CTS
Test: GCA (Sanity)

Change-Id: I669901ec4b0c897f80193c99939181ac2ddd8b60
Signed-off-by: Jayant Chowdhary <jchowdhary@google.com>
2020-01-26 19:01:05 -08:00
Amit Mahajan
a45fad224b Merge "Move EXTRA_SERVICE_STATE from Intent to ServiceState." 2020-01-25 00:19:42 +00:00
TreeHugger Robot
f61162a002 Merge "Combine package parsing thread pools" 2020-01-24 23:18:57 +00:00
Yuliya Kamatkova
56f7c7f37c Merge "Add Activity#setLocusContext API. Plumb LocusID to the System Server. Add locus update event to the Usage Stats. Test: Build and run on a test device with a test app. Bug: 147594233, 147100454" 2020-01-24 21:10:54 +00:00
Suprabh Shukla
30295f5421 Merge "Add an unsuspend button option to SuspendDialogInfo" 2020-01-24 21:08:21 +00:00
Ying Xu
4b0dec268d Merge "[Telephony Mainline] Remove hidden API usages in CarrierAppUtils" 2020-01-24 20:55:31 +00:00
Anthony Stange
d07018c25d Add hinge angle sensor feature to PackageManager
Bug: 144139857
Test: compile
Change-Id: Icfe8e8769bc89cc457d8ecd2b7eb60c034e4f531
2020-01-24 15:14:25 -05:00
Ömer Nebil Yaveroğlu
8d22767445 Merge "Various API changes including:" 2020-01-24 19:48:30 +00:00
Winson Chiu
6fe95622e9 Merge "Only throw SecurityException for OverlayManager callers targeting R" 2020-01-24 19:40:05 +00:00
Yuliya Kamatkova
48c38076ef Add Activity#setLocusContext API. Plumb LocusID to the System Server.
Add locus update event to the Usage Stats.
Test: Build and run on a test device with a test app.
Bug: 147594233, 147100454

Change-Id: I1e058ac87244d47719606d8dcfaea2df4bff43d2
Signed-off-by: Yuliya Kamatkova <yuliyak@google.com>
2020-01-24 11:19:10 -08:00