Commit Graph

18861 Commits

Author SHA1 Message Date
TreeHugger Robot
30d358d21e Merge "Clarify the difference between foreground and visible." 2020-07-28 20:35:59 +00:00
Kweku Adams
8defab21ee Clarify the difference between foreground and visible.
Bug: N/A
Test: N/A
Change-Id: I5a446232a6179b3297566e626b77935007f3d67a
2020-07-28 12:08:12 -07:00
TreeHugger Robot
5948d5c209 Merge changes from topic "max_bounds"
* changes:
  Verify DisplayArea bounds in WindowMetricsTests
  Add DisplayArea support for WM#getMaximumWindowMetrics
2020-07-28 09:11:34 +00:00
Julia Reynolds
41be51a5cf Merge "Let apps see if their conversations have been demoted" 2020-07-27 18:41:14 +00:00
Julia Reynolds
cecd53dc71 Let apps see if their conversations have been demoted
Test: cts
Bug: 154140688
Change-Id: Ief3c2535f3f253e60470c63fde9325e06ceda484
2020-07-27 11:31:00 -04:00
Bernardo Rufino
a5a75052d6 Merge "Toast on broadcast receiver notification trampolines" 2020-07-27 14:30:58 +00:00
Treehugger Robot
46b6294cc2 Merge "Remove gendered language" am: 35616155b5 am: 5c018260e0 am: fc99d35ccf am: 268f3268b1 am: a106418487
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371586

Change-Id: Ie38483d40b3f35b07d5e2a9478ad5ed7a43a9902
2020-07-27 14:27:59 +00:00
Alan Stokes
a12326e5c0 Merge "Don't include inaccessible data dirs in library paths." 2020-07-27 14:27:10 +00:00
Treehugger Robot
a106418487 Merge "Remove gendered language" am: 35616155b5 am: 5c018260e0 am: fc99d35ccf am: 268f3268b1
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371586

Change-Id: I1072e86f369ecf9fd682c733a703cedb010f66a4
2020-07-27 14:14:16 +00:00
Treehugger Robot
fc99d35ccf Merge "Remove gendered language" am: 35616155b5 am: 5c018260e0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1371586

Change-Id: I04e61237104aca879ceed99f3d24cff76fe4570b
2020-07-27 13:43:16 +00:00
Julia Reynolds
078d29378a Merge "Replace 'whitelist' with 'allowlist'" 2020-07-27 13:20:46 +00:00
Bernardo Rufino
99e0b9a01c Toast on broadcast receiver notification trampolines
Show a warning toast when an app starts an activity inside a broadcast
receiver in response to a notification or notification action click.
This is to gather dogfood feedback in preparation for blocking such
activity starts. See go/notification-trampolines for more info. For now,
only taking care of broadcast receivers, the services case will be in a
future CL.

The toast is only shown once per package. This is to avoid annoying
dogfooders.

The actual block will be gated on targetSdk, however since very few
apps (any?) will be targeting the latest SDK on dogfood and we are still
allowing the activity start, we're going to show a toast regardless of
targetSdk to collect more feedback.

A side-effect of the way we implemented the rule that allowed
notification trampolines in BAL is that in the case that the user clicks
on a broadcast/service-trampoline notification of an app that also
happens to be in the foreground (on top for example) we can't
differentiate if an activity start came from the broadcast/service or
from the activity itself (or some other part of the app). Because of
this, in this case, we won't show the warning toast (and I'd say we
might not block the launch in the future, but this discussion can wait).

Implementation:

We determine at PendingIntent fire time if the receiver is allowed to
start activities. However, we pass a boolean to represent the grant to
start activities and this boolean also takes into account another case
that allows such starts. To correctly identify at activity start time
that it was allowed due to notification-click scenario we pass in the
token that was embeded in the PendingIntent (and was validated in the
PendingIntentRecord) by notification manager.

The set of components in ProcessRecord becomes a map to contain the
originating tokens. Since now WindowProcessController needs to have the
token to trace back the grant, I've replaced the boolean flag with the
map from ProcessRecord. We move the grant rule to the bottom of the
method areBackgroundActivityStartsAllowed() to make sure the start was
allowed exclusively due to notification-click interaction.

We then let notification manager register a callback with activity task
manager that will be called whenever a background activity start is
allowed exclusively due to a token provided in that callback. In that
callback we show the warning toast.

Test: atest BroadcastRecordTest BackgroundActivityLaunchTest
      ActivityStartControllerTests ActivityStarterTests
      RecentsAnimationTest WindowProcessControllerMapTests
      WindowProcessControllerMapTests
Test: Posted a broadcast-trampoline notification, clicked on it and
      observed the toast was shown.
Change-Id: Ica479d7d2f6b5f2ddaac4c59e12d0b25cd637717
2020-07-27 13:27:28 +01:00
Jin Seok Park
d08c338d88 Merge "Add hasEnabledNotificationListener API" 2020-07-26 04:43:02 +00:00
TreeHugger Robot
8409b66798 Merge "Move task to back when the back button is pressed on root task" 2020-07-24 23:07:31 +00:00
Jing Ji
a266d4c988 Merge "Java docs update: Advise not to include PII in setProcessStateSummary" into rvc-dev am: fcaa94e2dc am: 62b56170ac am: 7249ed0952 am: b84490176f
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12202766

Change-Id: I3a7eb23bede2a56d534e8da0a2a021b939fe680d
2020-07-23 22:49:15 +00:00
Jing Ji
b84490176f Merge "Java docs update: Advise not to include PII in setProcessStateSummary" into rvc-dev am: fcaa94e2dc am: 62b56170ac am: 7249ed0952
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12202766

Change-Id: I85e8c4292f69e560c0036a6732d3c5a8f30225e5
2020-07-23 22:33:53 +00:00
Jing Ji
7249ed0952 Merge "Java docs update: Advise not to include PII in setProcessStateSummary" into rvc-dev am: fcaa94e2dc am: 62b56170ac
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12202766

Change-Id: I2793a40476d8ed6411637dd16b027e1f7bac9806
2020-07-23 22:20:01 +00:00
Jing Ji
ec8b28277b Merge "Java docs update: Advise not to include PII in setProcessStateSummary" into rvc-dev am: fcaa94e2dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12202766

Change-Id: Ic02eba2cecd33c8bd607360e111e891f24b6ab34
2020-07-23 22:06:47 +00:00
Kweku Adams
7d13ed48e0 Merge "Remove dead code." 2020-07-23 17:57:30 +00:00
Julia Reynolds
100ea3d3f0 Remove gendered language
Test: atest
Bug: 161908447
Change-Id: Ie331cf630b94e600326e77dfa81d01fb3f8627f6
2020-07-23 13:04:05 -04:00
Julia Reynolds
0d3caed705 Replace 'whitelist' with 'allowlist'
Test: atest
Bug: 161889253
Change-Id: I94a43c1c995052b034d8a5377786e1a15e4c9c59
2020-07-23 12:58:17 -04:00
Alan Stokes
e8527305da Don't include inaccessible data dirs in library paths.
When constructing a classloader for a different app, don't include
it's private data dir in libraryPermittedPath if we don't have access
to it. (Which we often won't, although it depends on target SDK,
whether it has a shared UID, etc.)

This avoids generating SELinux denials at boot and other times,
e.g. when initialising WebView.

Bug: 161356067
Test: Boots, denials not seen, WebView works.
Change-Id: Ib246af979783e80fde3313f8aed6c3b7a886e6b2
2020-07-23 11:27:59 +01:00
Jiyong Park
5a63c65998 Merge "Introduce uses-native-library tag" 2020-07-23 08:56:41 +00:00
Jing Ji
3bda3bf8c6 Java docs update: Advise not to include PII in setProcessStateSummary
Bug: 161812603
Test: m -j offline-sdk-docs & manual verify the javadoc
Change-Id: I741bbf7b83badcd7f1610f31bbd41a49b8b975fb
2020-07-22 11:03:30 -07: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
Jin Seok Park
e1f4d51d55 Add hasEnabledNotificationListener API
This CL adds a system API to NotificationManager for checking whether
the NotificationListener for the current package name and user id is
enabled or not.

This replaces existing implementation which was using binder calls
directly to NotificationManagerService.

Bug: 160762852
Test: atest CtsMediaHostTestCases:\
    android.media.session.cts.MediaSessionManagerHostTest\
    #testGetActiveSessions_withSession2

-> MediaSessionManager#getActiveSessions verifies call by checking if
the notification listener is currently enabled.

Change-Id: Ic730b0abfe08c40171062421b2015be9cc05310a
2020-07-20 16:01:23 +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
Prabir Pradhan
2dec42fa66 Move task to back when the back button is pressed on root task
This CL changes the behavior of pressing the back button on a root
activity so that the task is moved to the back, instead of the activity
being finished.

This removes the IRequestFinishCallback which IActivityTaskManager would
previously have triggered to make the Activity finish itself.

Bug: 146418616
Test: atest WmTests
Test: manual: flash crosshatch, press back button on a root activity,
observe task is moved to back.

Change-Id: I48ec35f841ab3b306fe80845150000c390908f5e
2020-07-15 15:24:02 -07:00
Lee Shombert
b99a7abd16 Merge "Enhance PropertyInvalidatedCache debug" 2020-07-15 15:57:04 +00:00
Rubin Xu
ac51bf8a40 [DO NOT MERGE] Rollup changes from R related to CertInstaller and KeyChain
This change includes the following commits that are related to
CertInstaller and KeyChain:

7a5c8fe4afd KeyChain: Unify manual and programmatic key installation flows
a894225c7da Added functionality to select type of certificate to be installed from the Settings app
a9131939a35 Add KeyChain.KEY_ALIAS_SELECTION_DENIED constant.
485be505f19 Fix KeyChain.KEY_ALIAS_SELECTION_DENIED

Bug: 161347472
Test: builds & manual testing
Change-Id: I560bade479b41a5b88f81ea6dfdecba689c2f4ad
2020-07-15 15:50:14 +01:00
TreeHugger Robot
9ed4468e71 Merge "Inroduce UNIFORM_OPS sampling." 2020-07-15 10:16:40 +00:00
Charles Chen
5a24a59d0c Verify DisplayArea bounds in WindowMetricsTests
Also add some test APIs to report max bounds value.

Test: atest WindowMetricsTests
Bug: 151414021
Change-Id: I6d0127925d51d2bd2b2879ce133504a46c66350e
2020-07-15 11:28:44 +08: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
0f1b2c45bc Merge "Fix javadoc error in ApplicationExitInfo#getDefiningUid()" into rvc-dev am: 42ef19d57c am: 6cca58b722
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12118644

Change-Id: I7fb03437a0897b7be93b7cd38040713aa99259f3
2020-07-09 18:18:25 +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