Commit Graph

19470 Commits

Author SHA1 Message Date
Rubin Xu
5834f23224 Merge "Remove some getCallerIdentity variants in DevicePolicyManagerService" 2020-11-24 22:17:28 +00:00
Rubin Xu
750185ba76 Remove some getCallerIdentity variants in DevicePolicyManagerService
CallerIdentity object should only wrap around caller-provided and
authenticated (uid, ComponentName, PackageName) tuple. In some
instances the caller does not provide ComponentName or PackageName,
and CallerIdentity should keep track of this instead of trying to
infer the associated ComponentName or PackageName. This is because
there is one-many mapping from uid to package name, so the inference
can be imprecise as well as losing information of what the caller
supplied originally. Instead all the isXX() access control methods
should handle the case that ComponentName or PackageName might
be missing.

Bug: 167960209
Test: atest OrgOwnedProfileOwnerTest
Test: atest MixedDeviceOwnerTest
Test: atest MixedManagedProfileOwnerTest
Test: atest MixedProfileOwnerTest
Test: atest FrameworksServicesTests:DevicePolicyManagerTest
Change-Id: I8d2dfeb2e5137ea06f941855d2e5608998a86912
2020-11-24 14:56:17 +00:00
TreeHugger Robot
5f430b6a4a Merge "Empty text treated like null text" 2020-11-24 00:30:06 +00:00
Hui Yu
3357e7f9f4 Merge "BG-FGS-launch restriction exemptions." 2020-11-24 00:26:36 +00:00
Jeff DeCew
4346696937 Empty text treated like null text
This fixes an edge case with my Maps navigation notifications where the vertical alignment was obviously wrong.

Bug: 163626038
Test: manual
Change-Id: Id2d336acca20483e578d0070151065988aea9ea8
2020-11-23 15:23:21 -05:00
TreeHugger Robot
7f98fd5330 Merge "Do not hide app name when title is empty." 2020-11-23 19:49:36 +00:00
Hui Yu
20f42909f8 BG-FGS-launch restriction exemptions.
1. Add a new permission START_FOREGROUND_SERVICES_FROM_BACKGROUND.
2. Add a new bind flag BIND_ALLOW_FOREGROUND_SERVICE_STARTS_FROM_BACKGROUND
3. BroadcastOptions.setTemporaryAppWhitelistDuration() is currently
protected with CHANGE_DEVICE_IDLE_TEMP_WHITELIST permission, also open
it for START_ACTIVITIES_FROM_BACKGROUND and
START_FOREGROUND_SERVICES_FROM_BACKGROUND permission.
4. Exempt SYSTEM_ALERT_WINDOW permission.
5. if Context.startForegroundService() or Service.startForeground() is
restricted by BG-FGS-launch restriction, and app's targetSdkVersion is S
and above, throw a IllegalStateException.

Bug: 171305836
Test: atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagFGS
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsBindingFlagActivity
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsStartSystemAlertWindow
atest cts/tests/app/src/android/app/cts/ActivityManagerFgsBgStartTest.java#testFgsStartFromBGException

Change-Id: Iff3ed65e174a8406d4d6045cda42bdde6cecf30d
2020-11-23 11:19:59 -08:00
TreeHugger Robot
dfde1bd0f4 Merge "Documented what's returned by DPM.getUserRestrictions()." 2020-11-23 16:58:21 +00:00
Jeff DeCew
32525d92b5 Do not hide app name when title is empty.
This fixes an awkward edge case where apps omit a title because they depend on the app name to contextualize the text in the notification body.

Bug: 163626038
Test: manual
Change-Id: I452bdfcfd956d195aed575ace3b9f0556bc2d6df
2020-11-23 11:44:56 -05:00
Todd Kennedy
569435e0eb Implment get/query APIs for properties
Bug: 169258655
Test: atest CtsContentTestCases:PackageManagerGetPropertyTest
Test: atest CtsContentTestCases:PackageManagerQueryPropertyTest
Change-Id: I91d58cd42e7f1f10b0e494ff9f318a9e3fa073db
2020-11-21 08:12:13 -08:00
TreeHugger Robot
ea4af47814 Merge changes I8e5fe162,Ic780f98a,I8973907c
* changes:
  Collapsed DecoratedCustomView notifications show app name instead of title.
  Fix snooze/bubble button padding
  Fix Gmail undo state.
2020-11-21 00:44:43 +00:00
TreeHugger Robot
76e3e7682a Merge "Allow preload voice recognition service can blame app." 2020-11-20 22:40:16 +00:00
Ashwini Oruganti
cb5e8c5087 Merge "Update the docs for FLAG_UPDATE_CURRENT and FLAG_IMMUTABLE" 2020-11-20 21:30:14 +00:00
Jeff DeCew
fa5c76c245 Collapsed DecoratedCustomView notifications show app name instead of title.
Previously, we never showed a title in the decorations, and
we still don't in the expanded decorations.  Rather than
making devleopers deal with the discrepancy, it's easier to
just show the app name for these views.  It makes them a
tad less desirable, but we could potentially give developers
a flag to opt into the title in the future.

Bug: 163626038
Bug: 173528244
Bug: 173742646
Test: manual
Change-Id: I8e5fe162c1ccdddcd39ea36f2b28fcc6aefd1f83
2020-11-20 14:39:44 -05:00
Jeff DeCew
4d19b03fd5 Fix Gmail undo state.
We forced all notifications to have an expanded
state, but the Gmail undo notification is totally
broken in that case.  This check exempts an obviosuly
bad expanded state from having to exist, fixing
Gmail's undo flow in the process.

Fixes: 173774694
Bug: 163626038
Bug: 173550917
Test: manual
Change-Id: I8973907ceb06ccf06c0a685fc0f2a2d283794fe5
2020-11-20 14:39:43 -05:00
Garfield Tan
943f93a8b7 Merge "Add window focused state to TaskInfo." 2020-11-20 18:33:19 +00:00
Joanne Chung
16617b0d50 Allow preload voice recognition service can blame app.
1. allow preload voice recognition service can blame app.
2. refine duplicate method

Bug: 170795434
Test: manual.
Change-Id: Ided2b19661d937ff0b4ec881f2e629afe47435e5
2020-11-20 12:55:48 +00:00
Stanislav Zholnin
d250fced40 Merge "Migrate PermissionState and AppOps tests to new owners" 2020-11-20 09:40:17 +00:00
Garfield Tan
f677d826f9 Add window focused state to TaskInfo.
Add a helper method Task#dispatchTaskInfoChangedIfNeeded to avoid
checking for isOrganized() every time we need to dispatch a task info
change.

Bug: 165794880
Test: Window focused state is pushed to WM shell.
Change-Id: I3e1272884f4ca9021c82b0df71ff2f7c5a6fea83
2020-11-19 17:46:07 -08:00
Ashwini Oruganti
11a9f15e5f Update the docs for FLAG_UPDATE_CURRENT and FLAG_IMMUTABLE
to add how they interact with each other. This seems to be a common
confusion for users. This change adds more context around what the two
flags mean in terms of allowing changes to a PendingIntent and that it
should be fine to use both together.

Bug: 160794467
Test: Green builds
Change-Id: I66f3744ca95252bdfebf8c9711eec7e8bfd059c8
2020-11-19 15:42:10 -08:00
felipeal
ca1110be85 Documented what's returned by DPM.getUserRestrictions().
Test: none
Fixes: 173729240

Change-Id: I435704e76d45af919e301f59f0bd18ffb539e4d8
2020-11-19 12:59:06 -08:00
TreeHugger Robot
4e3d12dd50 Merge "Add PeopleSpaceTile object for UI functionality" 2020-11-19 20:15:38 +00:00
Nate Myren
6156e9810f Merge "Allow exemption for VoiceRecognitionService if no VoiceInteraction" 2020-11-19 19:09:22 +00:00
Anna Zappone
7d7a8b6fa8 Add PeopleSpaceTile object for UI functionality
Primarily based off ShortcutInfo.

Test: PeopleSpaceTileTest
Change-Id: I2292bca47f52d36c3e85cc5c9e10a3b280358253
2020-11-19 17:44:22 +00:00
Bernardo Rufino
f48a5e3d13 Merge "Optionally wait animations on syncInputTransactions/injectInputEvent" 2020-11-19 14:07:13 +00:00
Mariia Sandrikova
08cea83323 Merge "Move TaskInfo comparison from TaskOrganizerController to TaskInfo" 2020-11-19 09:32:32 +00:00
Bernardo Rufino
ab008846a8 Optionally wait animations on syncInputTransactions/injectInputEvent
I need to perform a touch while animating in CTS to test ag/13067140,
but current methods all wait for animations to complete, which defeats
the purpose.

Creating new methods that optionally wait for animations to complete.

Test: atest WindowUntrustedTouchTest on child CL
Bug: 172787052
Change-Id: I4832ea2c62531a73098d2817930638ccb5f40765
2020-11-19 08:30:08 +00:00
Riddle Hsu
6e4f57488d Merge "Add a new launch type for hot start with relaunched activity" 2020-11-19 06:52:27 +00:00
TreeHugger Robot
6b4c503a24 Merge "Adapt margin for actionless notifs with snooze button" 2020-11-18 23:03:51 +00:00
Mariia Sandrikova
1b44edeea9 Move TaskInfo comparison from TaskOrganizerController to TaskInfo
Bug: 170216257
Test: atest WMShellUnitTests
Change-Id: I7ef6913172f57fbfad116a04e9e324ed9dc6535a
2020-11-18 17:09:03 +00:00
Lyn Han
3ff7884df3 Adapt margin for actionless notifs with snooze button
Bug: 171817112
Test: visual
  Expanded hun/shade/ls notif bottom margin looks good
    - with and without snooze button
    - with and without actions

Change-Id: Ifbd57fcf699c431a51c0713ef54126e72d648614
2020-11-18 06:24:20 -08:00
Tiger Huang
2af48c7f99 Merge "Don't handle the system UI visibility at server side" 2020-11-18 13:30:06 +00:00
Treehugger Robot
e02785ee8a Merge "Migrate CALLBACK_ON_CLEAR_CHANGE" am: 6f7c5e0914 am: 62d7bd9555 am: f669aaa6ce am: 4c7226a1a4
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492844

Change-Id: I1e9e845e11dcfd764739dd7f6aa1211155326545
2020-11-18 10:48:22 +00:00
Treehugger Robot
4c7226a1a4 Merge "Migrate CALLBACK_ON_CLEAR_CHANGE" am: 6f7c5e0914 am: 62d7bd9555 am: f669aaa6ce
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492844

Change-Id: Ica16e03e57745c946c42d4b8e09385fbac793ae4
2020-11-18 09:58:10 +00:00
Paul Hu
3f3766a881 Merge "Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API" am: c5ec644861 am: cb9a7b819c am: b12dfe489f
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466224

Change-Id: Id6b1eab77eee4fb38e9fe8e97bac28c2caec61c0
2020-11-18 09:57:10 +00:00
Treehugger Robot
f669aaa6ce Merge "Migrate CALLBACK_ON_CLEAR_CHANGE" am: 6f7c5e0914 am: 62d7bd9555
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1492844

Change-Id: I40fc10b8f269530f671d8511435c5c62d0c1f655
2020-11-18 09:28:59 +00:00
Paul Hu
b12dfe489f Merge "Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API" am: c5ec644861 am: cb9a7b819c
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1466224

Change-Id: Ifba72e9bd6cb8551d825898e2ffc8ad34bf238b3
2020-11-18 09:28:18 +00:00
Treehugger Robot
6f7c5e0914 Merge "Migrate CALLBACK_ON_CLEAR_CHANGE" 2020-11-18 09:19:29 +00:00
Paul Hu
c5ec644861 Merge "Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API" 2020-11-18 08:35:15 +00:00
Tiger Huang
44a8e4daf0 Don't handle the system UI visibility at server side
The system UI visibility has been deprecated. Except disable flags, it
should be converted to the new APIs before being sent to WMS. This CL
renames mSystemUiVisibilitiy to mDisableFLags in WindowState.

Bug: 149813814
Test: atest TaskSnapshotControllerTest TaskSnapshotPersisterLoaderTest
Change-Id: I6730ba664359656ee814c7bc959844d6ed4aaeb9
2020-11-18 15:54:09 +08:00
Paul Hu
29f0617cc5 Merge "Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API" 2020-11-18 07:11:39 +00:00
Riddle Hsu
59c2e7cf8a Add a new launch type for hot start with relaunched activity
An existing activity may be relaunched when moving from background
to front if the current configuration is changed and the activity
cannot handle the change.

The relaunch type was reported as a hot start because its process
is alive and the original activity exists. But the relaunch needs to
destroy the original activity and create a new instance, which may
even take longer time than a warm start. So the case should be
separated from hot start.

Also:
- Make WaitResult#launchState is always populated by
  ActivityMetricsLogger, so "am start -W" can get consistent
  launch type.
- Remove dead code in ActivityRecord#ensureActivityConfiguration
  that it already early returns if !attachedToProcess.

Bug: 172528316
Test: atest ActivityMetricsLaunchObserverTests#testLaunchState
Change-Id: I3ef64ce1e23b2f13d42fa2b12bc31c0cdb4652fc
2020-11-18 15:11:20 +08:00
Evan Rosky
dc21941fe4 Merge "Track changes during transitions and report to player" 2020-11-18 01:17:12 +00:00
Stanislav Zholnin
46e15c2cd0 Migrate PermissionState and AppOps tests to new owners
Bug: 173359936
Test: atest AppOpsTests && atest PermissionStateTests
Change-Id: I3b4ba703f6a94c16f23e33f8358e2d5361a934e7
2020-11-18 00:32:42 +00:00
Evan Rosky
7274d2d186 Track changes during transitions and report to player
Current tracked changes include bounds, visibility, and
"existence".

bounds and visibility are fairly straightforward, call
collect() before doing operations and it will record the
state. Once the transition is finished, it will compare
that recorded state with the finished state.

"existence" is more complicated. It's the difference
between show/hide vs open/close. Because Task instances
are basically always around, their existence depends on
the circumstances around when/how activities are started.
For that we have to explicitly indicate when a container
is going to change its existence via
collectExistenceChange().

Bug: 169035306
Test: atest TransitionTests
Change-Id: I78d4cda6b726202507b757f93c742d49e51e2d7b
2020-11-17 15:17:44 -08:00
Mariia Sandrikova
2b54b5d709 Merge "Make positioning in letterbox mode configurable." 2020-11-17 22:45:44 +00:00
Mariia Sandrikova
49fc5569f0 Make positioning in letterbox mode configurable.
Changes:
- Allow to specify in config_letterboxPortraitGravity and config_letterboxLandscapeGravity desired alignment for letterboxed apps.
- Add ADB commands to allow overriding these config values for testing
- Move positioning logic for letterbox mode from WM Core to WM Shell.

Test: atest LetterboxTaskListenerTest LetterboxConfigControllerTest
Test: go/wm-smoke
Test: manual with adb shell dumpsys activity service SystemUIService WMShell (get)set-letterbox-portrait-gravity / (get)set-letterbox-landscape-gravity
Fix: 170216257, 170215849
Change-Id: I8e6392faab05bec1bf61b9691f3bd9b8b09b9621
2020-11-17 20:15:31 +00:00
Jeff DeCew
f4b91ee076 Fix DecoratedCustomViewStyle
* Fix HUN state's end margins
* Restore previous max height of collapsed state
* Restore previous behavior of hiding the progress
  bar if content is greater than ~25dp
* Remove min height which isn't necessary now that
  the largeIcon has moved up a line.
* Fix headerless title's padding with the separator.

Bug: 163626038
Test: manual
Change-Id: I1fa1efa76192f081ac801a732812eef7f5bfa536
2020-11-17 14:38:14 -05:00
paulhu
030fd23caa Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. But it needs
BroadcastOptions#setMaxManifestReceiverApiLevel to restrict the
receiving of CONNECTIVITY_ACTION intent. Thus, expose it as a
system API to support the usage.

Bug: 170593746
Test: atest FrameworksNetTests
Test: atest CtsNetApi23TestCases
Test: atest KeyChainTests
Change-Id: Ic45552174c3f9e74141db4495bb99a582000b574
Merged-In: Ic45552174c3f9e74141db4495bb99a582000b574
2020-11-17 16:10:26 +00:00
paulhu
52437ab083 Expose BroadcastOptions#setMaxManifestReceiverApiLevel as system API
Connectivity service is going to become a mainline module which
will not able to access hidden APIs. But it needs
BroadcastOptions#setMaxManifestReceiverApiLevel to restrict the
receiving of CONNECTIVITY_ACTION intent. Thus, expose it as a
system API to support the usage.

Bug: 170593746
Test: atest FrameworksNetTests
Test: atest CtsNetApi23TestCases
Test: atest KeyChainTests
Change-Id: Ic45552174c3f9e74141db4495bb99a582000b574
2020-11-18 00:07:32 +08:00