Commit Graph

18829 Commits

Author SHA1 Message Date
Jiyong Park
5a63c65998 Merge "Introduce uses-native-library tag" 2020-07-23 08:56:41 +00:00
Sergey Nikolaienkov
9c9fb8870f Merge "Wire test API to reset the state of AppErrors" 2020-07-22 12:14:40 +00:00
Bernardo Rufino
abcf240b5f Merge "Replace "whitelist" wording from BAL's code" 2020-07-22 10:08:06 +00:00
Bernardo Rufino
92927b0221 Replace "whitelist" wording from BAL's code
Replace with "allow" and others where applicable. Check
go/inclusive-documentation. #inclusivefixit

Test: Builds
Test: atest ActivityStarterTests BackgroundActivityLaunchTest
Change-Id: Ifdaeedba36bfb2bdc48bb78ac9d3760217f00865
2020-07-22 08:54:22 +01:00
Neil Fuller
42c9c1fb8b Merge "Add removeListener, update tests, hide binder" 2020-07-21 09:18:38 +00: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
Christopher Tate
6e8b38a29f Eliminate redundant churn in SharedPreferences
Don't clone-then-discard, just work from what we have already, and start
fresh for potential new work.

Bug: 161534313
Test: atest android.content.cts.SharedPreferencesTest
Change-Id: I6edb2b09537f5e77cc2ad3e4d2f32a89b945ad80
2020-07-17 11:11:04 -07:00
Neil Fuller
d760ca71c9 Add removeListener, update tests, hide binder
Add a removeListener method to allow deregistration of interest in
config changes, update tests. Also, hide binder interfaces on the
android.app methods.

Test: Treehugger / atest of touched test files
Bug: 149014708
Bug: 159888952
Change-Id: Ic1a14c34334eb276724d97c4e763360d51cb035b
2020-07-17 16:47:11 +01:00
Nikita Ioffe
89f7de19c3 Promote NO_ISOLATED_STORAGE app op to SystemApi(MODULE_LIBRARIES)
This app op was introduced to support --no-isolated-storage
instrumentation flag in MediaProvider mainline module. Because it was
very late in the release cycle, app op wasn't exposed as @SystemApi in
rvc-dev, even though there CTS tests written around it, and
MediaProvider module depends on it.

To make things fair, expose it as @SystemApi.

Test: atest CtsScopedStorageHostTest
Bug: 159708202
Change-Id: Ifddf2cb920285eda5f859972937b0f9084fc32a3
2020-07-17 14:59:34 +01: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
Lee Shombert
b99a7abd16 Merge "Enhance PropertyInvalidatedCache debug" 2020-07-15 15:57:04 +00:00
TreeHugger Robot
9ed4468e71 Merge "Inroduce UNIFORM_OPS sampling." 2020-07-15 10:16:40 +00:00
Lee Shombert
e2fbc3b811 Enhance PropertyInvalidatedCache debug
Bug: 159039903

A set of small changes to the class to allow for addition debugging.
1. Distinguish a cache that is disabled because the nonce has not
   set from a cache that is disabled because it is corked.
2. Count the times the cache was bypassed because it was corked, unset,
   or disabled.  This does not count the times the cache was bypassed
   because it was locally disabled.  Add these counts to dumpsys.
3. Count the number of times a cache is invalidated, corked, and
   recorked (corked while already corked).  Add these counts to dumpsys.
4. Log some additional information if cache inconsistency is detected.
5. Record cache overflows and cache high-water marks.

Test: Run the following tests with and without the changes.  Verify that
the changes do not affect behavior.
 * CtsContactsProviderTestCases
 * FrameworksServicesTests
 * FrameworksServicesTests:UserManagerServiceCreateProfileTest
 * PlatformScenarioTests
 * PtsChreTestCases
 * FrameworksServicesTests:UserManagerServiceUserInfoTest
 * FrameworksServicesTests:UserManagerServiceIdRecyclingTest
 * CtsProviderTestCases
 * FrameworksServicesTests:UserSystemPackageInstallerTest
 * FrameworksServicesTests:PackageManagerSettingsTests
 * FrameworksServicesTests:UserLifecycleTests
 * CtsCalendarProviderTestCases
 * BluetoothInstrumentationTests
Pull a bug report and verify that the new counters are included.

Change-Id: I38d5545947d6f09c7e62e094c7b2858aab4a8cf9
2020-07-15 00:37:04 +00:00
Jing Ji
f67b5b5ff8 Use the processName from ProcessRecord instead of ApplicationInfo
... in the AppError

The processName could be different in case the crashing component
specifies a different one other than the global process name.

Bug: 161165487
Test: atest android.jobscheduler.cts
Test: Manual - induce a crash in a receiver w/ different proc name \
               verify the proc name is showing up in dumpsys
Change-Id: Ied1658091edbd16d75a61e15e3501a92b222ab42
2020-07-14 13:31:27 -07:00
Ruslan Tkhakokhov
77c7e4858a Merge changes from topic "fsd2d-1"
* changes:
  Add BackupManager API to start migration
  [FSD2D] Add migration-aware methods to AppBackupUtils
2020-07-11 10:13:23 +00:00
Philip P. Moltmann
d1a1e1d764 Merge "Allow client side permission check in AppOpsManager" 2020-07-10 18:07:53 +00:00
Ruslan Tkhakokhov
2f2e13c1b6 Add BackupManager API to start migration
Add an override of BackupManager#requestBackup where type of the
operation (a regular backup or a migration) can be specified.

Bug: 160407842
Test: atest UserBackupManagerServiceTest
Change-Id: Ia54fa26b040c3ec3612672585561794ff831afef
2020-07-10 18:25:01 +01:00
TreeHugger Robot
e25aa04eeb Merge "Do not schedule relaunch for local activities" 2020-07-10 05:16:01 +00:00
Jing Ji
7dd929dfdd Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev am: 42ef19d57c am: 207e715943 am: b3342aba8b am: 4ac3593c9c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118644

Change-Id: Ie3b5b7a19f1e96fb9103650b8c5f6a1895eac6be
2020-07-09 18:30:38 +00:00
Jing Ji
4ac3593c9c Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev am: 42ef19d57c am: 207e715943 am: b3342aba8b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118644

Change-Id: Ibeed9ee6a99f5bc0f928c0264df5980a34c83f6d
2020-07-09 18:19:04 +00:00
Jing Ji
207e715943 Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev am: 42ef19d57c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118644

Change-Id: I2a3a7609ca76fb24c5298589951b1cc3d4634c3d
2020-07-09 18:13:59 +00:00
Stanislav Zholnin
7af6359bbe Inroduce UNIFORM_OPS sampling.
Introduce strategy which uniformly samples OPs, without biasing in
favour of specific ops.
Use this strategy half of the time.

Test: atest RuntimeMessageCollectionTest && statsd_testdrive 10069
Bug: 143519689
Change-Id: I481d3a9ef9c66f04577b57432cecdf2c02055e58
2020-07-09 18:12:33 +00:00
Jing Ji
42ef19d57c Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev 2020-07-09 18:11:00 +00:00
Philip P. Moltmann
6cb24816c3 Allow client side permission check in AppOpsManager
Fixes: 157548188
Test: None
Change-Id: Ib3535df346741a6ab23668ce937c00318917f805
2020-07-09 11:08:49 -07:00
Jing Ji
219da992ad Fix javadoc error in ApplicationExitInfo#getDefiningUid()
Bug: 160875447
Test: m -j offline-sdk-docs & manual verify the javadoc
Change-Id: Iae09584b42990092166be3c9a2bb792fa2d0abef
2020-07-09 09:33:10 -07:00
Riddle Hsu
65f41d56de Merge "Simplify handling activity config a bit" 2020-07-09 14:43:55 +00:00
Neil Fuller
6ec0d5dfed Merge "Renames / tidy ups" 2020-07-09 07:35:30 +00:00
Riddle Hsu
64413843b5 Simplify handling activity config a bit
- Remove parameter movedToDifferentDisplay because it can be
  retrieved by comparing current display id and new id. Then
  some logic can be shared.
- REPORT_TO_ACTIVITY was used to distinguish whether to report
  new configuration to the activity according it is process or
  activity level change. Since the conditions had been separated
  by different methods, its usages can be removed.

Bug: 160780522
Test: atest MultiDisplayActivityLaunchTests
Change-Id: I914963261ba339ba8c7bb5c50d7a8b25791db12e
2020-07-09 01:48:46 +00: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
9e19211dc0 Merge "Fix NPE when invoking Context#isUiContext" into rvc-dev am: 5c25605da0 am: a91c84fa14 am: 6263253bae
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12105622

Change-Id: Ibd9f56546ba9001c2d6f7786f3205227f5393a53
2020-07-08 18:21:51 +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
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
Darryl Johnson
ed1f9947f5 Merge "Ensure split-screen support isn't reported on devices with small displays." 2020-07-08 15:21:43 +00:00
Ruslan Tkhakokhov
2e5a1c222f [FSD2D] Add migration-aware methods to AppBackupUtils
This CL will be part of a series to implement backup / restore of all
app data during a device-to-device migration. Detailed overview of the changes at go/br-fsd2d-design-doc-app-data.

Bug: 160407842
Test: atest AppBackupUtilsTest
Change-Id: I35ce627f1d372437d8ba8495029c6df15db31552
2020-07-08 14:56:12 +01:00
Nikolas Havrikov
045951b133 Wire test API to reset the state of AppErrors
Bug: 159443507
Test: Built and flashed onto local adt-3 device
Test: Ran tests from ag/12034683
Test: Attempted to execute resetAppErrors via
  adb shell service call activity 219
Change-Id: I3723d9aae18679b4292c6efb8549563063d64b98
2020-07-08 10:45:18 +02:00
Louis Chang
c9aa51b173 Do not schedule relaunch for local activities
IllegalArgumentException was thrown when reporting size config
for local activities while relaunch.

Bug: 120008604
Test: start ActivtiyGroup activities and update display cutout

Change-Id: If376012cd0741bc7436dc45aeb2f0216aee32a02
2020-07-08 12:30:22 +08:00
Jin Seok Park
913f61f009 Merge changes I9b6da97e,I1ab89d12
* changes:
  Remove using hidden API: MediaSessionManager(Context)
  Remove using ServiceManager API in MediaSessionManager
2020-07-08 02:52:58 +00:00
TreeHugger Robot
9d28be4326 Merge "Do not hide the bell icon." into rvc-qpr-dev am: 0581ca685b am: a372bf7835
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12091686

Change-Id: I2773ed04f3822d6a5f3e1774220c6dbc68b70e6c
2020-07-08 00:01:38 +00:00
TreeHugger Robot
a372bf7835 Merge "Do not hide the bell icon." into rvc-qpr-dev am: 0581ca685b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12091686

Change-Id: I18c5693b134e661a4c6538ba9502274152ca8e70
2020-07-07 23:50:05 +00:00
Jeff DeCew
43a6de043e Do not hide the bell icon.
Bug: 156887617
Test: Update a notification between 10-30 seconds after the last update, watch bell icon stay visible.
Change-Id: Ib737fd78ac5afa26ee0e456ffbee6c6dc0a5c835
2020-07-06 21:31:37 -04:00
Darryl L Johnson
138c24fb13 Ensure split-screen support isn't reported on devices with small displays.
Several partners with devices that have small displays have run into
issues w/ CTS-on-GSI testing as these builds hardcode support for
split-screen. This prevents split-screen from being reported as
supported if the display isn't compatible according to the CDD.

Bug: 158310372
Test: android.server.wm.SplitScreenTests#testMinimumDeviceSize()

Change-Id: I0dfd6caca5116dccc115d64b755998171abe831f
2020-07-06 09:41:50 -07:00
Jin Seok Park
431f3af83b Remove using hidden API: MediaSessionManager(Context)
Replace with SystemServiceRegistry.registerContextAwareService,
which is a @SystemApi. See ag/9734296 for reference.

Bug: 160380016
Test: atest
    CtsMediaTestCases:android.media.cts.MediaSessionManagerTest
Change-Id: I9b6da97e0e0f5181ce8681a399ca090e67f6fd4e
2020-07-06 15:33:47 +09:00
Jin Seok Park
8f79003bec Remove using ServiceManager API in MediaSessionManager
MediaSessionManager calls ServiceManager#getService(string) to get
ISessionManager, but it is a hidden API that will not be made into
@SystemApi (ag/6329675).

Instead, create a wrapper class that can only retrieve specified
media service binders. (ag/10123575 for reference)

Bug: 159955826
Test: atest
    CtsMediaTestCases:android.media.cts.MediaSessionManagerTest
Change-Id: I1ab89d1217e8e3d071b38da772ee96889e9859b1
2020-07-05 16:09:14 +09:00
TreeHugger Robot
a97aa2f6dc Merge "Fix Bundle#getParcelableArray call" into rvc-dev am: d70c7dda50 am: 72217807c6 am: 63178d96bd am: 5fa1f6a30e
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12034230

Change-Id: I6ec64bec0571c432cc521e4f0d630cfac314a899
2020-07-03 03:34:51 +00:00
TreeHugger Robot
63178d96bd Merge "Fix Bundle#getParcelableArray call" into rvc-dev am: d70c7dda50 am: 72217807c6
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12034230

Change-Id: I771521370a581188f14bff35c7b04ba4b4c6c636
2020-07-03 03:03:22 +00:00
TreeHugger Robot
e7322068cc Merge "Fix Bundle#getParcelableArray call" into rvc-dev am: d70c7dda50
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12034230

Change-Id: I18687d77b5383d35b5cd079345be1cbac64dd532
2020-07-03 02:40:20 +00:00
TreeHugger Robot
d70c7dda50 Merge "Fix Bundle#getParcelableArray call" into rvc-dev 2020-07-03 02:22:57 +00:00
Charles Chen
82a951abc3 Merge "Revert "Revert "Enable IMS and its config context to obtain UI component""" into rvc-dev am: 8deb612a14 am: f9ccadb06d am: 2712b5e401 am: 718528f4bb
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12004931

Change-Id: I669e79f51cd8a2390c53308b30cbe1d94a3b39c5
2020-07-02 00:28:39 +00:00