Commit Graph

63600 Commits

Author SHA1 Message Date
Winson Chiu
bde104f8be Merge changes Id7d1ff26,Id53a2e65 into rvc-dev
* changes:
  Add am compat enable/disable/reset test for not installed app
  Gate stricter manifest enforcement on targetSdk R
2020-04-01 05:44:35 +00:00
Winson
727da64be5 Gate stricter manifest enforcement on targetSdk R
Two package parsing issues have been promoted to failures in R:
a missing <application>/<instrumentation> tag, and an empty
"android:name" attribute. The latter due to a bug in the parsing
code.

These need to be gated by targetSdkVersion so that APKs built for
previous versions can still scan/install properly. This change
introduces support for this through a framework that leverages
@ChangeId to introduce individually toggle-able errors, in
case a developer needs to install an app that isn't completely
migrated for a new SDK version yet.

The ignoreError method was removed from ParseResult as the errors
it was used for were manually compared to PackageParser and it's
likely they can be hard errors without breaking anything.

This also adds tests for general ParseInput/Result behavior.

Exempt-From-Owner-Approval: AppIntegrity already approved in older PS.

Bug: 150776642

Test: atest android.content.pm.parsing.result.ParseInputAndResultTest
Test: atest com.android.server.pm.parsing.PackageParsingDeferErrorTest
Test: atest com.android.server.integrity.AppIntegrityManagerServiceImplTest
Test: atest com.android.server.pm.parsing

Change-Id: Id53a2e65f6e5e4dee9a41cc77007275b3a220ac3
2020-04-01 05:42:52 +00:00
TreeHugger Robot
456365644b Merge "Simplify WindowState#reportResized" into rvc-dev 2020-04-01 05:38:20 +00:00
TreeHugger Robot
b72d2c5ee5 Merge "AppBinding: Respond to PACKAGE_CHANGED" into rvc-dev 2020-04-01 04:46:22 +00:00
TreeHugger Robot
dcea9181e5 Merge changes from topic "Fix WindowFocusTests Flaky-rvc-dev" into rvc-dev
* changes:
  Prevent waiting when inject event without animation
  Fix input infos are inconsistent between WMS and InputFlinger (1/2)
2020-04-01 03:05:26 +00:00
JW Wang
1d68911a9d Merge changes I10355143,I85adb8c3 into rvc-dev
* changes:
  Run expiration when rollback lifetime is changed. DO NOT MERGE
  Add logs for debugging
2020-04-01 02:49:40 +00:00
TreeHugger Robot
9ba74bee62 Merge "Cancel animation in previous rotation" into rvc-dev 2020-04-01 02:48:42 +00:00
Andrii Kulian
886d2cf0f1 Merge "3/n Refactor TaskContainers to TaskDisplayArea" into rvc-dev 2020-04-01 02:05:35 +00:00
Cody Kesting
5add803be8 Merge changes I2431a6d2,I9096969a,I748bd9de,Ia5387ca2,I803bdec8, ... into rvc-dev
* changes:
  Update CS helper for clearing NetworkCapabilities UIDs.
  Simplify unregister logic for Connectivity Diagnostics callbacks.
  Clarify comments for Connectivity Diagnostics reports.
  Sort administrator UIDs for NetworkCapabilities.
  Add combine() and equals() for NetworkCapabilities admin UIDs.
  Use IBinder as key for ConnectivityDiagnostics storage in CS.
  Decrement networkRequestPerUid when callbacks are unregistered.
  Invoke onConnectivityReport on registering ConnectivityDiagnostics.
2020-04-01 01:13:11 +00:00
TreeHugger Robot
1db5f59dcf Merge "[SM06] Collect mobile NetworkStats metrics by collapsed rat type" into rvc-dev 2020-04-01 01:12:41 +00:00
Makoto Onuki
44ec9f289a AppBinding: Respond to PACKAGE_CHANGED
Fix: 148210449
Test: atest CtsAppBindingHostTestCases

Change-Id: I568b63033b6daac9b8ebb79965ed5d29cfb924af
2020-03-31 15:32:45 -07:00
Winson Chung
a531f922c9 Merge "Add task organizer based task embedder" into rvc-dev 2020-03-31 20:59:17 +00:00
TreeHugger Robot
63ff5bb6f1 Merge "PMS: Add shell command to toggle FIXED_PERFORMANCE" into rvc-dev 2020-03-31 20:38:47 +00:00
TreeHugger Robot
cbd80ea094 Merge "Send more IME events to autofill manager service." into rvc-dev 2020-03-31 20:22:28 +00:00
Andrii Kulian
86d676c81f 3/n Refactor TaskContainers to TaskDisplayArea
Renamed TaskContainers to TaskDisplayArea and added getDisplayArea()
method to WindowContainer that finds the first display area in the
hierarchy above the node. ActivityRecord and Task override it to
return the TaskDisplayArea class.

Bug: 152116619
Test: WM CTS and unit tests
Change-Id: I4525afbcd794848e1020213cdca04d89a646dd55
2020-03-31 12:15:57 -07:00
Jon Spivack
c44b78d47a Merge "ApexManager: Request apexservice only when needed" into rvc-dev 2020-03-31 18:33:31 +00:00
Feng Cao
97ec1c4dcc Send more IME events to autofill manager service.
* In IME side, wait for the input start before calling back to Autofill,
  rather than returning inline unsupported immediately.
* Also adds an InlineSuggestionManager to simplify code in the
  InputMethodService

Test: atest CtsAutoFillServiceTestCases
Test: atest CtsInputMethodTestCases
Bug: 151123764

Change-Id: I199925d77aa508f259e98a8929120aeb96015b57
2020-03-31 18:11:24 +00:00
Cody Kesting
221d383ff9 Merge "Clean up handling of NetworkCapabilities#administratorUids." into rvc-dev 2020-03-31 17:46:57 +00:00
Benedict Wong
7df7129b40 Merge changes I97ba5903,Icd80b368 into rvc-dev
* changes:
  Make VpnProfile.maxMtu default value match Ikev2VpnProfile
  Add negotiated DNS servers to VPN config
2020-03-31 16:52:04 +00:00
Benedict Wong
ef5732b053 Merge "Automatically set IPsec tunnel interface as up" into rvc-dev 2020-03-31 16:51:58 +00:00
Arthur Hung
c7a46da46c Prevent waiting when inject event without animation
Synchronously inject input event would wait for animations complete,
but if no surface animation is on going and 'scheduleAnimation' is
called in order to apply the pending transaction. It would wait
until timeout(=5s) because no 'notify' would be called from
framecallback. That would cause timeout problem when emulate swipe
gesture via inject many events.

This would provide a flag in WindowAnimator to ensure the pending
transaction could be applied and exit waiting if there is no
other animation.

Bug: 150250453
Bug: 152478735
Bug: 152462354
Test: atest libinput_tests inputflinger_tests
Test: atest --rerun-until-failure 100 WindowFocusTests#testMovingDisplayToTopByKeyEvent
Test: atest MemoryTests#testActivityRecreation
Test: Tests have inject events.

Change-Id: If1db5c4d923ddbcfcd6eb3db38a41fee70913568
2020-03-31 15:47:56 +00:00
Riddle Hsu
07217a0dac Simplify WindowState#reportResized
- System server no longer contains customized windows
  which extend IWindow.Stub directly (very old lockscreen).
  Since there is no arbitrary implementation of resized,
  it is unnecessary to post resized at the entrance because
  ViewRootImpl will dispatch the message to UI thread.
- As above, because the local async case is gone, it is safe
  to update mLastConfigReportedToClient directly so we don't
  need to create MergedConfiguration every time.

Bug: 139522754
Test: atest AppWindowTokenTests#testLandscapeSeascapeRotationByPolicy

Change-Id: Ib1ea0b07add562c40466a0a8792221768e404c62
2020-03-31 23:20:21 +08:00
Neil Fuller
71271db6bf Merge "Misc tidy up before adding geolocation classes" into rvc-dev 2020-03-31 14:52:09 +00:00
TreeHugger Robot
370d6454d1 Merge "MediaRouter: Rename requestID with uniqueRequestId" into rvc-dev 2020-03-31 12:59:26 +00:00
Riddle Hsu
fc246d1646 Cancel animation in previous rotation
The local animations are cancelled if fixed rotation transform is
going to be finished to perform seamless display rotation. That
avoids a case: a closing animation in landscape moved outside the
bottom of the screen, and it still has unfinished alpha animation
(e.g. wallpaper_open_exit is 250+167=417ms which is longer than
than wallpaper_open_enter 225ms). Then if the display is rotated
to portrait, the animation out of view becomes visible.

The reason not waiting for all animations to finish is that will
increase the latency to rotate display, and touching won't work
in the waiting state because the rotation of top activity (rotated
surface) is different than the display.

Bug: 151709552
Test: atest DisplayContentTests#testApplyTopFixedRotationTransform
Test: Enable fixed_rotation_transform, return from a task in
      different orientation to home with default animation.

Change-Id: I7c268de1f9061a7ac11fc42a70f02000faba7106
2020-03-31 10:59:55 +00:00
Kyunglyul Hyun
3b27d9ddd2 MediaRouter: Rename requestID with uniqueRequestId
This will slightly increase the readabily.

Bug: 152843067
Test: cts test and atest mediaroutertest
Change-Id: I563d9b38b00bdef44f07d6b21c43533ebab8dbae
2020-03-31 19:58:01 +09:00
JW Wang
9f8407b0aa Run expiration when rollback lifetime is changed. DO NOT MERGE
See b/151890602#comment6 for the detail.

When rollback lifetime is changed, we need to re-schedule the
expiration algorithm so rollbacks can expire at the correct time.

Note we combine #runExpiration and #scheduleExpiration so there is only
one entrance to schedule the expiration algorithm.

See
https://googleplex-android-review.git.corp.google.com/c/platform/frameworks/base/+/10899294/1/services/core/java/com/android/server/rollback/RollbackManagerServiceImpl.java#672
for the rationale.

Bug: 151890602
Test: atest RollbackTest
Change-Id: I10355143dedc0af92e0b2adfedb5f008e160cbb3
2020-03-31 18:52:29 +08:00
junyulai
317ba5bf3b [SM06] Collect mobile NetworkStats metrics by collapsed rat type
Test: adb shell cmd stats pull-source 10000~10003
      adb shell dumpsys netstats --uid
Bug: 129082217

Change-Id: I726e74f5c63a6ed456cb13ea259b58c7a33bec76
Merged-In: I726e74f5c63a6ed456cb13ea259b58c7a33bec76
(cherry picked from commit c82dfeb422)
2020-03-31 09:25:27 +00:00
Rubin Xu
884aa6afe1 Merge "Get HAL services with retry" into rvc-dev 2020-03-31 09:25:22 +00:00
TreeHugger Robot
d11b9a311b Merge "Handle ANR in a separate thread" into rvc-dev 2020-03-31 07:50:56 +00:00
Benedict Wong
8b9538df8f Add negotiated DNS servers to VPN config
This change plumbs the DNS servers through from the
IkeSessionConfiguration. Previously the getInternalDnsServer() was not
implemented.

Bug: 152242520
Test: FrameworksNetTests passing
Change-Id: Icd80b3688de2a39e222a4501787f8c54951c2ba0
Merged-In: Icd80b3688de2a39e222a4501787f8c54951c2ba0
(cherry picked from commit bd2763d977)
2020-03-30 22:59:05 -07:00
TreeHugger Robot
b556cb7254 Merge "Fix potential NPE when removing TaskOrganizerController" into rvc-dev 2020-03-31 05:09:02 +00:00
Ugo Yu
88a25ff248 Merge "Fix Bluetooth auto turns ON in airplane mode" into rvc-dev 2020-03-31 04:42:07 +00:00
Ugo Yu
dff3794ce1 Merge "Independent methods to enable/disable BLE mode" into rvc-dev 2020-03-31 04:41:43 +00:00
Riddle Hsu
f9a2c04f2b Handle ANR in a separate thread
So the ActivityManager and InputDispatcher thread won't be delayed,
e.g. process next broadcast, input event.

The thread handles ANR sequentially and is only alive if there is ANR.
If system is very slow to handle ANR which has delayed over 1 minute,
only the traces of no response process will be dumped to reduce load.

Bug: 143573504
Test: atest FrameworksServicesTests:AnrHelperTest
            FrameworksServicesTests:ProcessRecordTests
            CtsAppTestCases:ActivityManagerTest#testAppNotResponding

Change-Id: I892ea60665f072bf7673f7af96f5f1a734aa540c
2020-03-31 12:08:45 +08:00
JW Wang
5b163cfcee Add logs for debugging
See b/151890602#comment4.

If the assumption is true, we will see logs that the rollback for
testappA is exipred happens slightly after the call to #getAvailableRollbacks.

Also move assertions below so the test runs to the end and we have a
better picture for what happened during the test.

(Cherry-picked from eab998a9af)

Bug: 151890602
Test: m
Merged-In: I85adb8c3c5598ef4ce11550b51f22d1ce3c282a6
Change-Id: I85adb8c3c5598ef4ce11550b51f22d1ce3c282a6
2020-03-31 11:01:23 +08:00
TreeHugger Robot
74e31b7c64 Merge "Clear home surface crop size while being organized" into rvc-dev 2020-03-31 01:24:43 +00:00
Arthur Hung
8874a961f7 Fix input infos are inconsistent between WMS and InputFlinger (1/2)
In single focus system, we would expect the focused display could be
changed when receiving a key event.

The way we update window infos from WMS to InputFlinger is using
SurfaceControl.Transaction, and we would expect the api
'syncInputTransactions' could wait until all window infos update to
InputFlinger.

This would collect all input transactions from all displays into one
to make sure all input windows could be sync at same time.

- Change 'updateInputWindowsImmediately' that we could update the input
  transation and merge it into the passing Transaction that could be
  collected and applied later.
- Wait for 'isAnimationScheduled' to make sure the pending trasaction
  had been applied before it update the input transaction.
- Rename 'setInputWindow' to 'displayRemoved' to match the function
  more properly.

Bug: 150250453
Test: atest --rerun-until-failure 100 WindowFocusTests#testMovingDisplayToTopByKeyEvent
Test: atest --rerun-until-failure 10 WindowFocusTests

Change-Id: Id06c70bfe76e8c8a0cd50a8ae66b38b444a9d0c2
2020-03-31 01:07:45 +00:00
Cody Kesting
e277c77fe1 Update CS helper for clearing NetworkCapabilities UIDs.
NetworkCapabilities needs to have its UIDs cleared (UID ranges, owner
UID, and administrator UIDs) before it can be shared with apps via
ConnectivityDiagnosticsCallback invocations. The previous helper used
for clearing these values mutated the provided NetworkCapabilities. This
is updated to instead return a sanitized copy of the provided
NetworkCapabilities

Bug: 148942124
Test: atest FrameworksNetTests
Change-Id: I2431a6d273d0d73432919baf41b4f66397f4b7dc
Merged-In: I2431a6d273d0d73432919baf41b4f66397f4b7dc
(cherry picked from commit 45bbc4f6ac)
2020-03-30 17:46:59 -07:00
TreeHugger Robot
28fa262049 Merge "Allow DEFAULT_INPUT_METHOD to capture audio during RTT call" into rvc-dev 2020-03-31 00:17:46 +00:00
Cody Kesting
982013743b Simplify unregister logic for Connectivity Diagnostics callbacks.
ConnectivityService is updated to simplify the logic for unregistering
ConnectivityDiagnosticsCallback instances. This change removes the given
callback from ConnectivityService's data structure. If the callback was
not registered with ConnectivityService, it is logged and the function
exits; else, the unregister() operation continues.

Bug: 150867635
Test: atest FrameworksNetTests
Change-Id: I9096969a1bf33da72b117f5bbc88257df805e688
Merged-In: I9096969a1bf33da72b117f5bbc88257df805e688
(cherry picked from commit f047313940)
2020-03-30 17:15:09 -07:00
Cody Kesting
95a98c2efd Clarify comments for Connectivity Diagnostics reports.
Clarify when
ConnectivityDiagnosticsCallback#onConnectivityReportAvailable will be
invoked. Clarify when NetworkAgentInfo#mConnectivityReport will be null
vs non-null.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I748bd9ded72a34d89f13bd4362d6d4da62b910b8
Merged-In: I748bd9ded72a34d89f13bd4362d6d4da62b910b8
(cherry picked from commit 604dd40cf0)
2020-03-30 17:14:56 -07:00
Cody Kesting
4600fa52a6 Use IBinder as key for ConnectivityDiagnostics storage in CS.
This change updates ConnectivityService to use IBinder instances as keys
when storing ConnectivityDiagnosticsCallbacks.

When storing ConnectivityDiagnosticsCallbacks in ConnectivityService,
the IConnectivityDiagnsoticsCallback is used as the key for
ConnectivityService.mConnectivityDiagnosticsCallbacks. However,
IConnectivityDiagnosticsCallback instances are received as different
objects. This causes them to produce different hashCode() values, so
attempts to remove an IConnectivityDiagnosticsCallback fail.

Bug: 150867635
Test: atest FrameworksNetTests
Change-Id: Ib99e68d5ae47fa27e12428f9a60a2c1204ac59a2
Merged-In: Ib99e68d5ae47fa27e12428f9a60a2c1204ac59a2
(cherry picked from commit c7c6a4ac12)
2020-03-30 17:14:20 -07:00
Cody Kesting
13564eedd5 Decrement networkRequestPerUid when callbacks are unregistered.
ConnectivityDiagnosticsCallbacks are tied to NetworkRequestInfo objects
when registered with the platform. Each NetworkRequestInfo is tied to a
specific uid, and ConnectivityService enforces a limit on the number of
network requests that can be associated with each uid.

When ConnectivityDiagnosticsCallbacks are unregistered from the
platform, their NetworkRequestInfo is freed and the number of network
requests per the user's uid should be decremented.

Bug: 150802582
Test: atest android.net.cts.ConnectivityDiagnosticsManagerTest
Change-Id: Ia5ed39c1d8e6221cd402be4f8baf69fa643a6113
Merged-In: Ia5ed39c1d8e6221cd402be4f8baf69fa643a6113
(cherry picked from commit 662076b1a7)
2020-03-30 17:14:07 -07:00
Cody Kesting
560eb2655b Invoke onConnectivityReport on registering ConnectivityDiagnostics.
This change updates the behavior for registering
ConnectivityDiagnosticsCallbacks. Now, after a successful register()
call, callbacks will receive cached ConnectivityReports for all
matching, permissioned networks. This allows registrants to be updated
with the network state for their networks without having to wait for the
next network validation.

Bug: 147849853
Test: atest FrameworksNetTests
Change-Id: I924ba8fdcc847f453557021591bde38602fe089c
Merged-In: I924ba8fdcc847f453557021591bde38602fe089c
(cherry picked from commit 95ec0b206b)
2020-03-30 17:13:55 -07:00
Cody Kesting
919385b549 Clean up handling of NetworkCapabilities#administratorUids.
Update ConnectivityService's check for administrator UIDs to use
ArrayUtils to check for UID inclusion. Update the NetworkCapabilities
annotation on the administrator UIDs field to clarify that it is
NonNull.

Bug: 147903575
Test: atest FrameworksNetTests
Change-Id: Id630fe9d76aacdaf038fdaa5360f0327520ee0c3
Merged-In: Id630fe9d76aacdaf038fdaa5360f0327520ee0c3
(cherry picked from commit 898496365a)
2020-03-30 17:13:37 -07:00
TreeHugger Robot
4927778a63 Merge "Remove duplicate code." into rvc-dev 2020-03-30 23:41:59 +00:00
Winson Chung
a1f869d10e Add task organizer based task embedder
- Split TaskEmbedder into its current VirtualDisplay implementation
  and an implementation that uses task org to create and manage
  the task
- Use the task org embedder implementation in separate bubble task view
- Skip task org tasks from triggering task resizing
- Add task org callback for back press on task root if requested

Bug: 148977538
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest
Test: atest WmTests:TaskOrganizerTests
Change-Id: Id422bb2547197c617f914ed7cf5085e02a1c3fb5
2020-03-30 23:29:08 +00:00
Kohsuke Yatoh
ed4e8c3fab Allow DEFAULT_INPUT_METHOD to capture audio during RTT call
Add content observer for Settings.Secure.DEFAULT_INPUT_METHOD,
which contains package name of current InputMethodService.

Bug: 147037345
Test: use voice input with Gboard 9.1.4 during a simulated RTT call.
Change-Id: I11e17b13513627c88ccb8e4db66c5359e9ee7f7b
2020-03-30 21:47:07 +00:00
Patrick Baumann
3dfc45e593 Merge "Whitelist for package broadcasts" into rvc-dev 2020-03-30 20:28:59 +00:00