Commit Graph

18881 Commits

Author SHA1 Message Date
Sergey Nikolaienkov
42c87511db Merge "Make javadoc adhere to implementation" 2020-08-05 04:19:42 +00:00
Siarhei Vishniakou
736e4b0668 Merge "Unify dispatching timeout constants" 2020-08-04 22:56:50 +00:00
Siarhei Vishniakou
1971ba5dc8 Unify dispatching timeout constants
The same constant is defined today with slightly different names in both
WindowMananagerService and ActivityTaskManagerService. To prevent
proliferation, make a constant in aidl and use it here.

Also, the two constants used to be in either nanoseconds or
milliseconds.

Make all constants in milliseconds because aidl does not support "const
long", and 5 seconds' worth of nanoseconds does not fit into an int.

Bug: 143459140
Test: interact with device after booting
Test: adb shell dumpsys input

Change-Id: Ia9b3f56d8eddcc6f2f0132bac9254655b180837f

Change-Id: If4d40b63c41f6fb54b99d167da8db1924945f3ef
2020-08-04 09:55:35 -05:00
Nikolas Havrikov
40ac832663 Make javadoc adhere to implementation
Test: no
Change-Id: I1e62ea5e04be18ecafd747d31120f0a8bc5b4b45
2020-08-04 12:36:57 +02:00
Philip P. Moltmann
4b9dd36b72 Merge "Revert "Check cross-user interactions for permissions and app-op..."" 2020-08-04 02:40:26 +00:00
Philip P. Moltmann
7fa1bd7f79 Revert "Check cross-user interactions for permissions and app-op..."
Revert "Add dedicated host side tests for permissions and appops"

Revert submission 12102534-PermAppOpsCrossUserCheck

Reason for revert: b/162582513
Reverted Changes:
I04256a51e:Check cross-user interactions for permissions and ...
Iea58db070:Add dedicated host side tests for permissions and ...

Change-Id: I4823d6660f3ef403451a74612d961a0bdd477116
2020-08-03 22:29:16 +00:00
Charles Chen
1a364965ee Merge "Annotating context in framework base" 2020-08-03 06:13:18 +00:00
Charles Chen
6591174401 Annotating context in framework base
Bug: 151414704
Test: build & run
Change-Id: I42c8ab699433c51158a1af201da0521413d74dcd
2020-08-03 11:36:54 +08:00
Patrick Baumann
ec9eb593d1 Merge "Inclusive naming of app enumeration changes from R" 2020-08-01 00:03:32 +00:00
Treehugger Robot
a942a8b898 Merge "Update language to comply with Android’s inclusive language guidance." am: 262d80ba06 am: 844fc0e52a am: a42c8fc0c1 am: a3b73fba11 am: 7eea9803a0
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1383078

Change-Id: I81c9cc12a94b4a0ec0805dcdf2246ec1e93eee1e
2020-07-31 23:34:57 +00:00
Treehugger Robot
7eea9803a0 Merge "Update language to comply with Android’s inclusive language guidance." am: 262d80ba06 am: 844fc0e52a am: a42c8fc0c1 am: a3b73fba11
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1383078

Change-Id: Idaec3eb44b854a86cae20f7c955acc0e2698800e
2020-07-31 23:09:44 +00:00
Treehugger Robot
a42c8fc0c1 Merge "Update language to comply with Android’s inclusive language guidance." am: 262d80ba06 am: 844fc0e52a
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1383078

Change-Id: Ic41fd85340530e59a02ce080bd3487e2a876a69e
2020-07-31 22:19:09 +00:00
Patrick Baumann
4bec7098c6 Inclusive naming of app enumeration changes from R
This change renames arguments and fields added for the purpose of app
enumeration in R to be more inclusive.

Test: atest AppsFilterTest AppEnumerationTests
Change-Id: I97ff73291d328b0ce1bf713c726371932c067c10
2020-07-31 21:22:37 +00:00
Michael Wachenschwanz
a57c974945 Update language to comply with Android’s inclusive language guidance.
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Change-Id: I6aac06e56507bb6ce69afd9b3db92be6b03a1400
Test: n/a
2020-07-31 18:54:02 +00:00
Treehugger Robot
4b52d50329 Merge "Update language to comply with Android's inclusive language guidance" am: 98973ea706 am: 9d67d59530 am: 724c877357 am: bd8aa1fe3e
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1378607

Change-Id: I60dac6b53f4fedacb91962b0b7192ae48858347b
2020-07-31 00:37:49 +00:00
Treehugger Robot
724c877357 Merge "Update language to comply with Android's inclusive language guidance" am: 98973ea706 am: 9d67d59530
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1378607

Change-Id: Ifb4996d7ccbb7e47da1bb1b8246fb5da94626d4c
2020-07-30 17:12:24 +00:00
Philip P. Moltmann
0a7348bc43 Merge "Check cross-user interactions for permissions and app-ops operations" 2020-07-30 15:39:58 +00:00
Nicole Borrelli
dd0406becb Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference


Bug: 161896447
Change-Id: I038fbac2bb59e97dc87f082eab98f3838263c909
2020-07-29 22:31:37 +00:00
Joël Stemmer
3a4c61e5c2 Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference

Bug: 161896447
Test: N/A; changes only to comments
Change-Id: I6eb9e3fcc1854b3fe820d52bdcbe9812ed3de2b2
2020-07-29 22:16:36 +01:00
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
Philip P. Moltmann
72b0b2651f Check cross-user interactions for permissions and app-ops operations
We want to be quite permissive here as without being able to check
permissions or appops nothing else works. Hence allow cross-user
interactions if any cross-user permission is granted.

Also we need to prevent infinite recursion as we are checking permission
and appops inside of permission and app-op checks.

Test: atest CtsPermissionHostTestCases CtsAppOpHostTestCases which
      execute the new paths for both full users and profiles
Fixes: 153996875
Change-Id: I04256a51e7f6c3658000ca7941654aea698b3199
2020-07-27 17:12:12 -07: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