Commit Graph

8908 Commits

Author SHA1 Message Date
TreeHugger Robot
456ffd240f Merge "Two API changes:" 2020-02-11 10:13:19 +00:00
Rhed Jao
0132d90b3f Merge "Support rich content for accessibility shortcut target" 2020-02-11 00:18:28 +00:00
TreeHugger Robot
35c66ff599 Merge "Revert "Prevents an NPE when content provider is slow to start"" 2020-02-10 23:59:40 +00:00
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
TreeHugger Robot
842482edaa Merge "Make ACTION_LOAD_DATA a protected intent" 2020-02-10 20:36:33 +00:00
Song Pan
76a0bb8920 Two API changes:
1. Add a new formula type "INSTALLER_ALLOWD_BY_MANIFEST" that evaluates to true
when installer is specified in the manifest.

This CL only adds this class without actually removing the part where we
propagate allowed installers. That will be changed in a new CL.

2. Change the AppIntegrityComponent API so that it is type-safe.

Test: atest frameworks/base/services/tests/servicestests/src/com/android/server/integrity
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Bug: 148780440, 147835536
Change-Id: Icfb996b2f6de241d9790a423dd01992edaf35117
2020-02-10 20:32:57 +00:00
TreeHugger Robot
e39ec317ca Merge "Allow cross-profile interaction when called from the system process." 2020-02-10 19:34:53 +00:00
TreeHugger Robot
28345b2cba Merge "Incremental install via adb." 2020-02-10 19:22:46 +00:00
Jay Aliomer
03906f0e10 Merge "Dark theme helper" 2020-02-10 18:50:11 +00:00
Philip P. Moltmann
41308eced1 Merge "Revert "Activity start: Send featureId from context->AppOpsManager"" 2020-02-10 16:31:33 +00:00
Philip P. Moltmann
e7421e92d9 Revert "Activity start: Send featureId from context->AppOpsManager"
Revert "Adjust monkey to changed internal APIs"

Revert "Test featureId is correctly used in startActivity"

Revert submission 10111030-activityStarter_featureId

Reason for revert: presubmit test breakage
Reverted Changes:
Ic7056b492: Activity start: Send featureId from context->AppOp...
I8e2a07da7: Adjust monkey to changed internal APIs
I7a6af6fb1: Test featureId is correctly used in startActivity

Change-Id: I48c55a962c990b22ea49e923baa7c73b121d179b
2020-02-10 16:14:12 +00:00
Alex Buynytskyy
cd4d3875e2 Incremental install via adb.
- passing V4 signature to IncFS,
- cleanup and use InstallationFile everywhere,
- pass params to DataLoader creation,
- minor refactor for PackageManagerShellCommandDataLoader to prepare for
Incremental data loading.

Test: atest PackageManagerShellCommandTest
Bug: b/136132412 b/133435829
Change-Id: Iacc3e4c51c0fa3410b076147ce153a1303246189
2020-02-10 07:06:34 -08:00
Patrick Baumann
172c497117 Merge "Adds queries->provider tag" 2020-02-10 14:37:56 +00:00
Omer Nebil Yaveroglu
b994372efb Change the way we handle app and installer certificates to be prepared
for the case that there might be multiple certificates signing the app.

Bug: 148373316
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: Ic1e86aeff6c087266739682fe4fe206200a87420
2020-02-09 18:52:29 +00:00
Philip P. Moltmann
6e406c8ae7 Merge "Activity start: Send featureId from context->AppOpsManager" 2020-02-08 22:54:50 +00:00
Philip P. Moltmann
9c5226fe36 Activity start: Send featureId from context->AppOpsManager
The expected usage pattern for noteOp is to get the
Context#getOpPackageName() and Context#getFeatureId() in the calling app
and the call

noteOp(callingPackageName, Binder.getCallingUid(), callingFeatureId)

As the featureId parameter is new this parameter has to been piped all
through from the ...Manager classes running in the app all way deep into
the bowels of the system server.

There is a special featureId==null for the "default" feature. This is
used in two cases:
- In case the system server (packageName == null || packageName ==
  "android") makes a call
- In the case there is no caller. In this case I left annotations in the
  code to make clear that the default feature is used

Raw binder interfaces (defined in AIDL files) are not supposed to be
used by apps. Still historically this has happened and we ended up with
@UnsupportedAppUsage tags in these files. Also AIDL does not support
two methods with the same name but different parameters. I.e. in the
case when I had to add a paramater to a method tagged as UnsupportedAppUsage I
- created a new method ...WithFeature with the additional paramter
- set a maxTargetSDK for the old method and mention the public API to
  use in the deprecation method
This is really not pretty. Once there is no more app using the old
internal API this hack can be removed.

Additionally this change removed all internal calls to
AppOpsService.noteOperation and AppOpsService.checkOperation and
replaces them with the public API equivalent. This sometimes means to
move the resolution of the mAppOpsManager to be lazy.

Exempt-From-Owner-Approval:: Just piping through arguments
Bug: 136595429
Test: atest --test-mapping frameworks/base/services/core/java/com/android/server/am/
      atest CtsAppOpsTestCases added test to cover activity start
      atest WmTests
Change-Id: Ic7056b492cb1c9a79158e6c2b4864898a0eb5b2a
2020-02-08 22:53:43 +00:00
Patrick Baumann
9918123bac Adds queries->provider tag
This change adds support for the <provider> tag inside of the <queries>
tag to support more succinct declaration that an app would like to see
the provider of a given authority.

Test: atest AppEnumerationTests AppsFilterTest
Bug: 136675067
Change-Id: Ie0f73213fae7a3a0619238e44063d4e5be157201
2020-02-07 17:08:30 -08:00
JW Wang
b82819fc4d Merge "Add a test API PackageManager#MODULE_APEX_NAME (2/n)" 2020-02-08 01:01:36 +00:00
Mehdi Alizadeh
4c9fbc50b7 Merge "Adds methods in LauncherApps to allow cache/uncache shortcuts" 2020-02-08 00:59:43 +00:00
Dmitri Plotnikov
cf21292622 Merge "Prevents an NPE when content provider is slow to start" 2020-02-07 23:33:50 +00:00
Songchun Fan
7aa29e43db Make ACTION_LOAD_DATA a protected intent
Such that it can only be sent by the system.

BUG: b/133435829
Test: manual
Change-Id: Idf7be3ee3571b24b3d43b75754f9292f17937a22
2020-02-07 23:02:34 +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
JW Wang
76d19db2e4 Merge changes Ie95789c9,I3d800491,I31f6b981,Ia3a4116b,I7edd3cf7
* changes:
  Rewrite handling of failed sessions (2/n)
  Rewrite the broadcast receiver for ACTION_CANCEL_ENABLE_ROLLBACK (1/n)
  Remove #mNewRollbacks (10/n)
  Put rollbacks into #mRollbacks (9/n)
  Add a flag to facilitate merging 2 rollback collections (8/n)
2020-02-07 14:36:33 +00:00
Rhed Jao
649b2fb00a Support rich content for accessibility shortcut target
Two attributes are added in AccessibilityShortcutInfo:
- animatedImageDrawable
- htmlDescription

Bug: 148929247
Test: atest AccessibilityShortcutInfoTest
Change-Id: Ibf41775cbfee0fdd946541bbae45ac088d11d693
2020-02-07 18:56:56 +08:00
JW Wang
70bdd97927 Put rollbacks into #mRollbacks (9/n)
Now we check Rollback#isNewRollback for rollbacks that were originally
in #mNewRollbacks.

for (Rollback newRollback : mNewRollbacks) {
  // Do something with newRollback...
}

will be replaced by:

for (Rollback newRollback : mRollbacks) {
  if (newRollback.isNewRollback()) {
    // Do something with newRollback...
  }
}

Since mRollbacks includes new rollbacks, be careful not to apply
operations not appropriate to new rollbacks when iterating over
mRollbacks. Luckily most of the code is future-proof that needs no
changes.

Note now #mNewRollbacks is always empty. We will remove it in the next
CL.

Bug: 147400979
Test: atest RollbackTest StagedRollbackTest
Change-Id: Ia3a4116b352228adc0b152d42c85920f375beb28
2020-02-07 14:29:52 +08:00
Chester Hsieh
c997463eb7 Merge "Allow test builds to optionally skip verification" 2020-02-07 04:33:54 +00:00
TreeHugger Robot
94a9f216a4 Merge "Incremental Delivery: Add device feature." 2020-02-07 02:56:57 +00:00
Mehdi Alizadeh
0de8c29c87 Adds methods in LauncherApps to allow cache/uncache shortcuts
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: I012bcc39194616a895606cdb9beb57a0f4af11d5
2020-02-06 22:58:14 +00:00
Chester Hsieh
750b5ed85c Allow test builds to optionally skip verification
Currently, every build a developer creates will be verified
against the Play Store verification system. For developers, this
is a completely useless step, takes up resources, and eats into
iteration time.

This CL disables verification for debug development builds that
are reinstalled over ADB. This keeps users who install OTA safe,
and lets devs avoid the cost of verification.

There is no reduction in safety for the end user as:
1) Verification can only be skipped when installing over ADB and
   the "-t" as well as the new "--disable-verification" flags are
   specified ("-t" isn't strictly necessary).
2) The user can already disable verification over ADB by simply
   setting a flag.

Test: atest PackageVerifierTest#testAdbSkipVerification
Bug: 138672462
Change-Id: Id0bef5126f2fb49a8e30fc235193636a1c2bab2e
2020-02-06 14:28:06 -08:00
Alex Buynytskyy
d8b25b838f Incremental Delivery: Add device feature.
Feature is present if ro.incremental.enable set to true.

Test: builds
Bug: b/136132412 b/133435829

Change-Id: I99ad307cbd3428e0b3964a369930658ee1c8ac0f
2020-02-06 14:05:55 -08:00
TreeHugger Robot
45a25406e5 Merge "Add missing annotation permission for UPDATE_APP_OP_STATS" 2020-02-06 20:30:38 +00:00
Omer Nebil Yaveroglu
e5a165f39d Fix the isHashed value to true for all certificate keys.
Bug: 148955753
Test: atest frameworks/base/core/tests/coretests/src/android/content/integrity
Change-Id: I7c19fa9a37a3ab94453e9520c14f964fdc952439
2020-02-06 18:05:28 +00:00
Alex Kershaw
fd3e83b265 Add missing annotation permission for UPDATE_APP_OP_STATS
Bug: 136249261
Bug: 140728653
Test: Manual
Change-Id: I4b3f9ecefb9764470f9d7ae30f64bb7ee10bbc78
2020-02-06 17:52:59 +00:00
Alan Stokes
8ee6bc3af6 Run AppSecurityTests in postsubmit.
Because we care if they break.

Putting the change here because this covers changes in at least
android/content/pm and services/core/.../pm (the latter has a
TEST_MAPPING that imports this one).

Test: atest :postsubmit
Bug: 137951074
Change-Id: Ie03397c857d6a94702549ba325631558ed04a9db
2020-02-06 15:18:03 +00:00
JW Wang
6ff12da997 Add a test API PackageManager#MODULE_APEX_NAME (2/n)
This API is used by the GTS to check mainline modules distributed as
apk-in-apex are included in the whitelist.

Bug: 148386485
Test: N/A (included in another CL)
Change-Id: I25b1c0703e3f345756a5ba91de070025042714f4
2020-02-06 22:32:22 +08:00
Mehdi Alizadeh
7a2b81b7d3 Merge "Adds locus Id to ShortcutQuery to find shortcuts based on LocusId" 2020-02-06 02:50:38 +00:00
Mehdi Alizadeh
03127b010f Merge "Adds LauncherApps#ShortcutChangeCallback" 2020-02-06 02:49:55 +00:00
Jay Aliomer
5948319efc Dark theme helper
Since adding custom and auto night mode, applications have been
making mistakes in checking if the device is in dark theme.

The API for checking dark theme is not very clear. They use
UiModeManager.getNightMode and checking if it is a yes or no thinking
that it refers to Dark theme. Where it is the service scheduler modes.

The most famous example of such mishap is the gboard app (b/145820343) and the dialer
(b/148142709).

We had to test all google apps that implement dark theme on android.

Test: atest UiModeManagerTest and Config tests
Fixes: 148606412
Change-Id: I45dbd9daa057b14d5dd2e88115f666db99d19145
2020-02-05 23:54:34 +00:00
TreeHugger Robot
808fd231da Merge "remove unused methods" 2020-02-05 22:44:19 +00:00
Mehdi Alizadeh
ae808ff765 Adds locus Id to ShortcutQuery to find shortcuts based on LocusId
Bug: 148085173
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
Test: atest DataManagerTest

Change-Id: Ie789582a43db6d53130f4a0e5bff646a3c08c71e
2020-02-05 13:53:47 -08:00
Mehdi Alizadeh
9f68019066 Adds LauncherApps#ShortcutChangeCallback
This CL only defines the APIs and the aidl layer. LauncherAppsService
changes will be added in a separate CL.

Bug: 148085769
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: I9590cd7e2ad2b0336280f23a2766e242158ceb4a
2020-02-05 13:53:44 -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
Pinyao Ting
1299f13b6c remove unused methods
Bug: 147764499
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: Ie70abcc729557787cc06a65abce41f93e7f35dc6
2020-02-04 16:58:40 -08: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