Commit Graph

104026 Commits

Author SHA1 Message Date
Tiger Huang
d8bb9b4dd8 Merge "Prevent unnecessary updateRequestedState" into rvc-dev 2020-05-08 13:37:42 +00:00
Joanne Chung
cdbd09bbcf Merge "Prevent crash when AutofillManager.isEnabled() is called" into rvc-dev 2020-05-08 10:14:55 +00:00
Joanne Chung
ee55616ad3 Prevent crash when AutofillManager.isEnabled() is called
If we cannot get flag information from the AutofillManagerService
after the timeout, we should not crash the process, we need to
handle the enabled information properly.

Also fix NPE because of null component name while calling
AutofillManagerServiceImpl.isWhitelistedForAugmentedAutofillLocked().

Bug: 151273845
Test: atest CtsAutoFillServiceTestCases
Test: manual. Copy the text from Messenger and paste on search bar,
no crash occurred and can paste text correctly.

Change-Id: I8d7ca35226052944fd68fef60a013a65a7fb57c1
2020-05-08 16:48:52 +08:00
Ryan Lin
2df7af78be Merge "Fix Voice shortcuts not working system-wide in R" into rvc-dev 2020-05-08 02:26:37 +00:00
Alex Johnston
80542add04 Merge "Restrict creation of secondary users" into rvc-dev 2020-05-07 15:20:31 +00:00
Alex Johnston
9ace11127c Restrict creation of secondary users
Background
* Secondary users should be disabled
  when the device is an organization-owned
  managed profile device.
* This is because supporting secondary
  users would complicate the semantics of
  user restrictions.

Changes
* Add DISALLOW_ADD_USER as a base restriction
  when the device is an organization-owned
  managed profile device.
* Handle removal case when the device is no
  longer in this mode.
* Remove the ability of other admins to apply
  DISALLOW_ADD_USER.

Manual Testing Steps
* Provision an organization-owned managed
  profile device.
* Check Settings > System > Multiple users
  and verify that a user cannot be added.
* Check WP TestDPC 'Set user restrictions
  on parent' and verify 'Disallow add user'
  is not present.

Bug: 155281701
Test: Manual testing
      atest com.android.server.devicepolicy.DevicePolicyManagerTest
Change-Id: I83348fc8b854cef20383803124000540b5b130cb
2020-05-07 13:58:31 +01:00
Jorim Jaggi
b3c02592e1 Merge "Cancel existing animations when detaching View" into rvc-dev 2020-05-07 11:36:11 +00:00
Tiger Huang
fbfc3abfde Prevent unnecessary updateRequestedState
If the client didn't change any insets, we don't need to update the
requested state while receiving controls. The requested state at the
server side can still be up-to-date for free.

This CL also sends the requested state to window manager if the local
state is not the same as the dispatched state.

Fix: 155752039
Test: atest InsetsControllerTest
Change-Id: I676a88d3ef823d8717d03e80261e6e7a5f7e8c5f
2020-05-07 14:01:38 +08:00
Feng Cao
254545cae5 Merge "Support re-attaching the inline suggestion view to window" into rvc-dev 2020-05-07 05:23:15 +00:00
Philip P. Moltmann
f7d1f1a40c Merge "Forward dumps from PermissionControllerManager to permissionmgr" into rvc-dev 2020-05-07 05:07:27 +00:00
Riddle Hsu
b76f9472df Merge "Do not stop dream service if dream activity is relaunching" into rvc-dev 2020-05-07 04:51:38 +00:00
Feng Cao
b46851c964 Support re-attaching the inline suggestion view to window
* Before this change, when the inline suggestion view is detached from
  the IME window (e.g. due to layout change), the remote view content
  will not show again even after the view is reattached to the window
  on the IME side. This patch fixes it by requesting the remote view
  owner (the ext services) for a new SurfacePackage when the view is
  re-attached to the window (see javadoc of SurfaceControlViewHost for
  why this works).
* This patch also fixes the issue where the SurfaceControlViewHost was
  never released in the ext services. This is done by notifying the
  ext services (through system server) when the view is detached from
  the IME window, and then the system server will release the
  SurfaceControlViewHost if after N(=500) ms the view is not re-attached
  to a window.
* After the SurfaceControlViewHost is released, if the view is
  re-attached to the window later, a new SurfaceControlViewHost will be
  created to back the same InlineContentView.
* The current code structure also lays a foundation for a subsequent
  change to allow reusing the same remote view for inline suggestions
  during filtering.

Test: atest CtsAutofillServiceTestCases (sanity test)

Bug: 153615023
Bug: 154683107

Change-Id: Idc587e1e82a96b792c351796464821b7aad7cd89
2020-05-06 19:30:39 -07:00
Kevin Chyn
73407d6559 Merge "Revert "Check Read permissions when getDocumentMetadata"" into pi-dev am: 3d599fd941 am: c1f5869518 am: 38691f7626
Change-Id: I2179cb6e443d25c859ab6c433b11aec63153f256
2020-05-07 01:28:25 +00:00
Kevin Chyn
38691f7626 Merge "Revert "Check Read permissions when getDocumentMetadata"" into pi-dev am: 3d599fd941 am: c1f5869518
Change-Id: I1ea9173d607acdcbd03de42aa793b018c23828e3
2020-05-07 01:15:56 +00:00
Kevin Chyn
c1f5869518 Merge "Revert "Check Read permissions when getDocumentMetadata"" into pi-dev am: 3d599fd941
Change-Id: I18eb6c4cd9c42f3cc1d1051b47aafeeffb6b0c16
2020-05-07 01:02:48 +00:00
Kevin Chyn
f21b907b1b Revert "Check Read permissions when getDocumentMetadata"
This reverts commit c94646177c.

Reason for revert: 155930637

Change-Id: Id452d316d1c1721fce715474df009ebe0fb719e8
2020-05-07 00:39:46 +00:00
Philip P. Moltmann
5ab27fca5c Forward dumps from PermissionControllerManager to permissionmgr
Test: adb shell dumpsys permissionmgr
Bug: 155680199
Change-Id: Iab5da24277eb6333ef047ab84dfcb65b7c4c2ff2
2020-05-06 17:24:40 -07:00
Diksha Gohlyan
3bea45c642 Merge "Check Read permissions when getDocumentMetadata" into pi-dev am: 4371baafc1 am: ada451e47c
Change-Id: Id40f7456923144e3496df2028c771325ad1f480e
2020-05-06 23:16:07 +00:00
Diksha Gohlyan
ada451e47c Merge "Check Read permissions when getDocumentMetadata" into pi-dev am: 4371baafc1
Change-Id: Ib242d6ed7ff376a71f85a03aa06f2c0453638310
2020-05-06 23:05:34 +00:00
Taran Singh
e974c347fd Merge "Revert "Keeps the served view of the window when focus to the ne..."" into rvc-dev 2020-05-06 21:06:34 +00:00
Taran Singh
0dbd6c4bd6 Revert "Keeps the served view of the window when focus to the ne..."
Revert "Refine FocusHandlingTest"

Revert submission 11182377-fix_b_152373385

Reason for revert: Fix b/155781821
Reverted Changes:
If20cdb43e:Keeps the served view of the window when focus to ...
I50402165b:Refine FocusHandlingTest
Bug: 152373385
Bug: 155781821

Change-Id: I44469caf5a5ceaf247c4e6b0694da9da1f3c0eb1
2020-05-06 20:37:09 +00:00
Galia Peycheva
1255a2d20b Merge "Override DreamActivity enter and exit animations" into rvc-dev 2020-05-06 20:30:21 +00:00
Jorim Jaggi
31e5254daf Cancel existing animations when detaching View
Test: WindowInsetsAnimationSynchronicityTests#testShowAndHide_renderSynchronouslyBetweenImeWindowAndAppContent * 100 times
Fixes: 155602643
Change-Id: I6f736357f5a67c01a29b2c531026a3a76c321003
2020-05-06 20:36:08 +02:00
Hui Yu
a6099ac785 Merge "Revert "Add isUidActiveOrForeground() for camera/audio to use."" into rvc-dev 2020-05-06 16:59:34 +00:00
Marco Ballesio
ce9b47859d Merge changes from topic "developer option for app freezer" into rvc-dev
* changes:
  Resources and strings for freezer settings
  Settings option to enable/disable the app freezer
  ActivityManager API to check availability of app freezer
2020-05-06 16:35:44 +00:00
ryanlwlin
5e08c38c89 Fix Voice shortcuts not working system-wide in R
SpeechRecognizer binds RecognitionService to realize it's feature.
When RecognitionService checks the record_audio permission, itself
doesn't have the capabilities to use the permission since it's not
a foreground process. We use the addition flag to allow the bounded
process to get same capabilities.

Bug: 154954447
Test: manual test:
   1. Install Talkback with voice shortcut feature
   3. assign voice shorct function to any gesture
   2. launch any app to leave home and trigger shortcut via the gesture
Change-Id: I2f867af739c69a5ba29bb49397819cb61915e42d
2020-05-06 20:44:09 +08:00
Riddle Hsu
d948f743c2 Do not stop dream service if dream activity is relaunching
Currently DreamActivity doesn't handle any configuration changes,
and does not set fixed orientation. So the decor view will be
detached if the activity is relaunching for configuration changes.

Though it also works by making DreamActivity support handling the
changes, all implementations of DreamService may need to add the
corresponding handling. So this fix only keeps the service alive
for compatibility.

Fixes: 154474768
Test: atest DreamManagerServiceTests#testDreamNotFinishAfterRotation
Test: Enter Settings > Display > Screen saver, press "Start now".
      The dream service should not be stopped after device rotated.
Change-Id: I454f75d06c4539258eeafd8794a3cb03e0276163
2020-05-06 12:26:13 +00:00
Galia Peycheva
3cf3520d3f Override DreamActivity enter and exit animations
Fix: 153151516

Test: atest DreamManagerServiceTests
Change-Id: I4ba741512edea23e0209b176a34478045931c891
2020-05-06 10:30:27 +02:00
Galia Peycheva
95f8aba25e Merge "Add isDreaming method to DreamManager" into rvc-dev 2020-05-06 08:18:19 +00:00
Tony Huang
e13e2229ce Merge "Aviod divider surface memory allocated after boot" into rvc-dev 2020-05-06 04:39:14 +00:00
TreeHugger Robot
a83fad74b4 Merge "Migrate remaining parsePackage V1 to V2" into rvc-dev 2020-05-06 03:57:38 +00:00
Yuncheol Heo
73cc6b8f47 Merge "Migrate Tap exclusion logic to TaskEmbedder." into rvc-dev 2020-05-06 00:00:53 +00:00
Winson
3cb5610a99 Migrate remaining parsePackage V1 to V2
Uses ParsingPackageImpl to generate the PackageInfo for
PackageManager's getPackageArchiveInfo API.

This keeps the migration to v2 hidden and thus the API can
be shipped for this release and then deprecated entirely
if necessary.

Exempt-From-Owner-Approval: Has approval on previous patchsets,
    will need non-logic updates to resolve merge conflict and CP
    into rvc-dev properly

Bug: 135203078
Bug: 146575910
Bug: 153880854

Test: atest com.android.server.pm.parsing
Test: atest android.content.pm.PackageManagerTests

Merged-In: Ib21dbbdc556502144df8e3d7a26b7a9d33885cd9
Change-Id: Ib21dbbdc556502144df8e3d7a26b7a9d33885cd9
2020-05-05 16:35:34 -07:00
Varun Shah
2806da306b Merge "Update some ContentResolver docs." into rvc-dev 2020-05-05 23:18:55 +00:00
Yuncheol Heo
d1cfb337cf Merge "Revert "Notify the visibility change to update color views without control."" into rvc-dev 2020-05-05 22:56:42 +00:00
Yuncheol Heo
11df7e13a8 Revert "Notify the visibility change to update color views without control."
This reverts commit 02d3a8ad07.

Reason for revert: the original change caused the infinite message loop.
Bug: 155794233

Change-Id: I3d72541cd51cd8b16ce4f44124d486b4615b09da
2020-05-05 22:56:27 +00:00
Marco Ballesio
74f0159425 Settings option to enable/disable the app freezer
The new setting option allows for a local configuration to override the
Device Config flag. Device Config and experiments will be honored by
default.

Bug: 155465196
Change-Id: I978a7b6bd75d9daab3fafed58b7f3c6417e0adab
Test: the option is correctly read and written by the companion CLs
2020-05-05 15:22:56 -07:00
Marco Ballesio
240bea3f47 ActivityManager API to check availability of app freezer
A method to verify the availability of the app freezer is required for
configuration code running in places like the Settings app

Bug: 155465196
Change-Id: I5779d263536091689a099eec0815f207dfbbf6ad
Test: verified its workings through the developer options CL
2020-05-05 15:22:43 -07:00
Yuncheol Heo
8f5f53ca0f Migrate Tap exclusion logic to TaskEmbedder.
We want to pass the touches on ActivityView to the Activity inside ActivityView, not to be consumed by Activity hosting ActivityView.
To do that, we need to set a tap exclude region, so touches can go through.

Bug: 155424730
Test: Make sure the Activity inside ActivityView gets touch.
Change-Id: Ia9b2c7eba0c48512a633c798b1012e5fbec8422f
2020-05-05 14:41:43 -07:00
Andrew Solovay
9e2fa5042b Merge "docs: Fixing broken Javadoc comments" into rvc-dev 2020-05-05 20:55:50 +00:00
Diksha Gohlyan
c94646177c Check Read permissions when getDocumentMetadata
Test: manually tested
Bug: 151095863

Change-Id: I4f04f08f76d039196c2c67bac80d4a46ebec87f2
(cherry picked from commit 0e75809955)
2020-05-05 20:00:05 +00:00
Galia Peycheva
e1903416bb Add isDreaming method to DreamManager
This CL adds isDreaming to DreamMaanger and changes the way it starts a
dream to use IDreamManager.dream()

DreamManager is only used for testing. So far it has been using the
DreamManagerInternal.testDream() API to start the dream. This restricts
the amount of verification that can be done in the dream tests because
it doesn't put the device in a dreaming state -
IDreamManager.isDreaming() is always false.
IDreamManager.dream() puts the device in a dreaming state and enables
better testing.

Bug: 152994058

Test: atest DreamManagerServiceTests
Change-Id: Id4d947e83eabcafa9724764b8d063357c5f2cb49
2020-05-05 21:59:24 +02:00
Varun Shah
5de2589627 Update some ContentResolver docs.
Clarify when some of the ContentResolver APIs could return null.

Bug: 112833761
Test: builds (documentation update)
Change-Id: I3af1a23bc484d05b167a86bbff0c93ff1bd364e7
2020-05-05 12:25:30 -07:00
Tony Huang
0f8981d9b1 Aviod divider surface memory allocated after boot
The divider surface buffer will be allocated even if the user does
not enter split mode. Avoid it by only copy surface when it show and
release it when it hidden.

Bug: 150190730
Test: reboot and check adb shell dumpsys SurfaceFlinger
Change-Id: Id70a2626b2a921cff6243d992c6b053e329ef92b
2020-05-05 18:52:14 +08:00
TreeHugger Robot
8011ca6185 Merge "Enable the settings_controller_loading_enhancement" into rvc-dev 2020-05-05 09:23:12 +00:00
Adam Bookatz
316bc6ff66 Merge "Listener to watch op starts" into rvc-dev 2020-05-05 00:52:12 +00:00
Yuncheol Heo
8f4363a226 Merge changes from topic "immersive" into rvc-dev
* changes:
  Add test api getStatus/NavigationBarBackgroundView.
  Notify the visibility change to update color views without control.
2020-05-05 00:14:09 +00:00
Andrew Solovay
369f2eeaf9 docs: Fixing broken Javadoc comments
Two recent checkins broke the Javadoc (in both cases, an <h3> wasn't
properly closed). Made the fix by hand to the HTML output in
cl/309818465 but we need to make the corresponding change to
the Java source or it'll get reverted next time we update the reference
docs.

Staged to:

go/dac-stage/reference/android/content/pm/LauncherApps.PinItemRequest
go/dac-stage/reference/android/service/autofill/AutofillService

go/dac-stage/reference/kotlin/android/content/pm/LauncherApps.PinItemRequest
go/dac-stage/reference/kotlin/android/service/autofill/AutofillService

BUG: 155669442
Exempt-from-owner-approval: Docs-only change
Test: make ds-docs
Change-Id: I97be9550689544304dff276cf3c9406f9cd98408
2020-05-04 16:03:17 -07:00
Adam Bookatz
182862e595 Listener to watch op starts
Currently, there is
onOpNoted - tells listeners that noteOp has occurred
onOpActiveChanged - tells listeners that an op's 'active' state has
changed, i.e. that a successfull startOp or stopOp has happened

There was, however, no way of telling a listener that a startOp has
happened (regardless of whether it was successful). This cl introduces
it, via a OnOpStartedListener.

This is required by the ForegroundServiceAppOpSessionEnded atom,
which counts the number of accepted vs. rejected attempts, and
therefore also needs to know when a rejected start happened.

This cl also contains some cosmetic moving of code so that
startOperation() and noteOperationImpl() are almost
exactly parallel.

* Also *
This cl fixes a bug I discovered in stopWatchingNoted, in which
the callback wasn't fully removed. Consequently, if a callback
was unregistered and then re-registered, the re-registration would
mistakingly be ignored (in direct contradiction to the javadoc).

Test: atest UidAtomTests#testForegroundServiceAccessAppOp
Test: atest AppOpsStartedWatcherTest AppOpsActiveWatcherTest AppOpsNotedWatcherTest
Test: manually monitor: adb shell cmd stats print-logs && adb logcat -v uid -s statsd | grep "statsd  : {" | egrep '\(256\)'
Bug: 152800926
Change-Id: Icdb9edf6b2b7c5807b339c1aabb32e882190b071
2020-05-04 21:59:29 +00:00
Yuncheol Heo
70c4bb9007 Add test api getStatus/NavigationBarBackgroundView.
Introduces new test api to access the background view of status bar and
navigation bar.

Bug: 154720832
Test: atest WindowInsetsPolicyTest

Change-Id: If38d3f57edfbb2631d4c1e47ed5347a332edacfb
2020-05-04 14:36:43 -07:00