Commit Graph

103692 Commits

Author SHA1 Message Date
jasonwshsu
066a544d06 Return empty for empty string in AccessibilityShortcutInfro#loadHtmlDescription
* Follow the behavior to return empty if given string is empty
	- AccessibilityServiceInfo#loadDescription
	- AccessibilityServiceInfo#loadHtmlDescription
	- AccessibilityShortcutInfo#loadDescription
	- AccessibilityShortcutInfo#loadHtmlDescription

Bug: 154092127
Test: manual test
Change-Id: I77f455945c569c81cb00127a7913bae4db1b3d1c
2020-04-20 14:57:40 +00:00
Linus Tufvesson
3bfec32633 Merge "Make ActivityViews backing virtual display private" into rvc-dev 2020-04-20 14:00:28 +00:00
Joanne Chung
4661207775 Merge "Fix app crash if the selection is from reverse direction." into rvc-dev 2020-04-20 05:55:46 +00:00
TreeHugger Robot
7f801fe0d1 Merge "Try to reland Ib3ee007bc" into rvc-dev 2020-04-20 00:29:45 +00:00
Lee Shombert
9bca3a380d Merge "Disable binder caches in unit tests" into rvc-dev 2020-04-19 19:07:24 +00:00
TreeHugger Robot
4e16915321 Merge "Cleaning up resources on mount destruction." into rvc-dev 2020-04-18 06:35:35 +00:00
Alex Buynytskyy
9a54579ac5 Cleaning up resources on mount destruction.
DataLoaderStub's lifetime is controlled externally, but we want to
release resources ASAP.

Bug: b/153874006
Test: atest PackageManagerShellCommandTest PackageManagerShellCommandIncrementalTest IncrementalServiceTest
Change-Id: I34035f36d1fe4ed0e4916014d859feb7fe2c0a09
2020-04-17 22:07:10 -07:00
Hui Yu
4db77a9749 Merge "Move noteAppWidgetTapped call into AppWidgetHostView." into rvc-dev 2020-04-18 04:03:52 +00:00
TreeHugger Robot
872afaeaeb Merge "Fixed Task#getVisibility to take into account task hierarchy" into rvc-dev 2020-04-18 02:23:41 +00:00
Nicholas Ambur
01b4d5cb13 Merge "add KeyphraseEnrollmentInfo to TestApi" into rvc-dev 2020-04-18 02:04:45 +00:00
Lee Shombert
6747eaa8e5 Disable binder caches in unit tests
Bug: 152451909

Unit tests often execute server code in the context if a test process.
Such a process does not have the same permissions as formal system
processes.  In particular, such a process does not have permission to
invalidate binder caches.

This change disables all binder cache code in the current process.
This means caching is disabled and invalidation never occurs.  There
are no permission violations and the test process is also unable to
affect (through cache invalidation) the actual system processes.

Test: Ran a list of atests.  Two had security violations before the
change but were okay after the change:
 * FrameworksServicesTests
 * UserSystemPackageInstallerTest
 Ran additional tests to verify no regressions:
 * PlatformScenarioTests
 * PtsChreTestCases
 * BluetoothInstrumentationTests
 * UserLifecycleTests

Change-Id: I011ee1eb39b2d52c69b6d5164b64f7418d2bbdd4
2020-04-17 16:37:50 -07:00
TreeHugger Robot
dd08939ba8 Merge "RESTRICT AUTOMERGE: Autocork package invalidations" into rvc-dev 2020-04-17 23:26:42 +00:00
TreeHugger Robot
e185aca339 Merge changes If07d6938,I32f9b89a,Ife4f8c4e into rvc-dev
* changes:
  RESTRICT AUTOMERGE: Add a facility for time-based cache corking
  RESTRICT AUTOMERGE: Cork permission and package cache around bulk permission update
  RESTRICT AUTOMERGE: Cork package information cache invalidations during boot
2020-04-17 23:25:02 +00:00
TreeHugger Robot
dd4cd092b3 Merge "SurfaceView: Remove dead code" into rvc-dev 2020-04-17 22:52:27 +00:00
Nicholas Ambur
d3c1f27b0c add KeyphraseEnrollmentInfo to TestApi
KeyphraseEnrollmentInfo is used for testing the system enrollment
application support within GTS.

Bug: 153264697
Test: gts-tradefed run gts-dev -m GtsAssistIntentTestCases \
-t com.google.android.assist.gts.KeyphraseModelManagerTest# \
testAllSystemKeyphrasesAndLocales

Change-Id: I66558cf849f2815f2c917d128f9f9cc0673750ef
Merged-In: I66558cf849f2815f2c917d128f9f9cc0673750ef
2020-04-17 22:12:13 +00:00
Wale Ogunwale
0db64ac043 Fixed Task#getVisibility to take into account task hierarchy
Also, correct some uses of getRootHomeTask()

Fixes: 153086746
Bug: 154331729
Bug: 80414790
Test: atest WmTests:ActivityStackTests#testGetVisibility_MultiLevel
Change-Id: I8b9a38879a0b4e6c72686312b414319b8b086cd1
2020-04-17 15:05:34 -07:00
Robert Carr
b3ca38fb99 SurfaceView: Remove dead code
While debugging SurfaceView transaction usage I noticed this
code was unconditionally dead. Notice the else statement
only contains the single if statement within, so it could
be written as else-if. But then notice the condition of this
rewritten else-if is contained within the original if and
so it can never be entered.

Bug: 153120755
Test: Existing tests pass
Change-Id: I032b17911a9c71a1e3d09e3933e6f6a3d86dffb6
2020-04-17 14:14:33 -07:00
Winson Chiu
c7cd73aa00 Merge "Optimization: remove duplicated flags computations for getInstalledPackages" into rvc-dev 2020-04-17 21:04:18 +00:00
TreeHugger Robot
061f46b9bd Merge "Make setWallpaperZoomOut call oneway" into rvc-dev 2020-04-17 20:35:31 +00:00
Santiago Etchebehere
9548fd3220 Make setWallpaperZoomOut call oneway
There's no need to keep it synchronous

Bug: 154304487
Test: atest NotificationShadeWindowViewTest
Test: atest WallpaperControllerTests
Test: manual
Change-Id: I547e05fb4e2a5f2d30cfc5de354c36cd9070e65b
2020-04-17 11:53:36 -07:00
Edgar Arriaga
c7f8e75806 Optimization: remove duplicated flags computations for getInstalledPackages
Below are some test runs that show 100 iterations of getInstalledPackages ran
at activity startup of touchlatency app to demonstrate the perf cost.

R Baseline:
https://screenshot.googleplex.com/PnVi5APraJo
https://pprof.corp.google.com/?id=dc105ca9592f8367c381e2dcf7f1847d

R Optimized:
https://pprof.corp.google.com/?id=2d1d9fadc20bcc61d41bd52116bd94e3
https://screenshot.googleplex.com/OAwJnvwPqPH

Savings: 8% of system_server binder response time when the call is executed.

In terms total binder transaction time. Savings are 2% of the total
binder call time.

Exempt-From-Owner-Approval: CP to correct branch for R

Bug: 153656459

Test: atest FrameworksServicesTests:PackageParserTest
Test: atest FrameworksServicesTests:PackageParserLegacyCoreTest
Test: atest FrameworksServicesTests:ScanTests
Test: atest FrameworksServicesTests:ParallelPackageParserTest

Merged-In: I2de9cf1f754a505239d4416e1fc70bf77932c5db
Change-Id: I2de9cf1f754a505239d4416e1fc70bf77932c5db
(cherry picked from commit 7cb9e5f671)
2020-04-17 18:38:29 +00:00
Taran Singh
9641cfc0fa Support WIC.show(IME) from Activity#onCreate
In Q, app developer would've to wait for InputConnection on Editor before
showSoftInput() could be called. This made API very un-intuitive. While
WIC.show(ime) took care of some of the scenarios, it didn't handle
showing IME from onCreate() i.e. when control is not yet available.
This CL introduces a pending IME show request that waits until IME
control is available.

Test: atest WindowInsetsControllerTests#testShowImeOnCreate
Bug: 153014086

Change-Id: I93dd5790e1fb3d7841ad1323a45cd3bae2d6e9b8
2020-04-17 10:41:30 -07:00
Joshua Duong
9a419cda53 Merge "Fix PendingIntent hijacking for adb notifications." into rvc-dev 2020-04-17 16:08:57 +00:00
Joshua Duong
ec1980f86b Fix PendingIntent hijacking for adb notifications.
Use an explicit intent and set PendingIntent.FLAG_IMMUTABLE to prevent
someone from modifying the intent from PendingIntent.send(...).

Bug: 153356209

Test: atest AdbNotificationsTest
Test: In bug, install and launch the PoC apk and give it notification
permissions. Then, with USB/Wifi debugging enabled, disconnect and connect
the device to create the adb notification. the PoC apk should not have
permission to display information from
content://com.android.settings.files/my_cache/NOTICE.html.

Change-Id: Ie49aa3cf9b33168cf1435fc2427e95aac7f4609b
(cherry picked from commit 2c03881459)
Exempt-From-Owner-Approval: approved in master
2020-04-17 16:08:39 +00:00
wilsonshih
b6415618f1 Try to reland Ib3ee007bc
Don't let process configuration change application configuration,
but allow to update non-default display configuration while
initialize since the context is focus on different display.

Bug: 148639826
Test: atest PresentationTest ActivityThreadTest AppConfigurationTests
Change-Id: I16ba4eee64406d097b7ff0b7ff5c45175623663a
2020-04-17 21:31:24 +08:00
Jerry Chang
e63ae2f84f Mark more directory getter APIs @TestApi
To have a way to verify behavior of more directories, mark more
directory getter APIs @TestApi.

Bug: 148664742
Test: atest SysConfigTest#testStageWhitelist
Change-Id: I2d22412935b24ec4c33d8d1b3a7fbb7df4a08841
2020-04-17 14:50:48 +08:00
Ming-Shin Lu
49ccdb557f Merge "Add test APIs for makeCustomAnimation" into rvc-dev 2020-04-17 03:33:51 +00:00
TreeHugger Robot
7929732000 Merge "RESTRICT AUTOMERGE: Add a "cork" mechanism to prevent cache invalidation flooding" into rvc-dev 2020-04-17 01:52:53 +00:00
Nader Jawad
2e40bb8b1e Merge "Updated TextView#setCompoundDrawableTintList documentation to refer to BlendMode.SRC_IN instead of PorterDuff.Mode.SRC_IN" into rvc-dev 2020-04-17 01:11:59 +00:00
Daniel Colascione
d59e2a9045 RESTRICT AUTOMERGE: Autocork package invalidations
Bug: 140788621
Test: m; strace -s512 -f -p 1 2>&1 | grep 'cache_key'
Change-Id: Iceaabee5ea8eac42934c1cc4914cdf43d2f11f58
2020-04-17 00:19:21 +00:00
Daniel Colascione
f0e88b2f2c RESTRICT AUTOMERGE: Add a facility for time-based cache corking
AutoCorker addresses the situation where big invalidation storms kill
performance but we don't have a way to insert a manual cork around
these update storms.

Bug: 140788621
Test: m
Change-Id: If07d693886fca340c7a18d5a607a4f235aa7107d
2020-04-17 00:19:05 +00:00
Daniel Colascione
f73a41c1cf RESTRICT AUTOMERGE: Cork package information cache invalidations during boot
Bug: 140788621
Bug: 150331002
Test: enable DEBUG; watch log
Change-Id: Ife4f8c4e7d10524d6000399947a4e4b9d36db750
2020-04-17 00:18:24 +00:00
Daniel Colascione
264abafff0 RESTRICT AUTOMERGE: Add a "cork" mechanism to prevent cache invalidation flooding
Bug: 140788621
Test: subsequent CL
Change-Id: Idfc42110e655571578bae208b98ee61a6eb1b2c3
2020-04-17 00:16:35 +00:00
Andrii Kulian
1a261f2f65 Merge "8/n Allow targeting task containers for activity launch" into rvc-dev 2020-04-16 23:15:42 +00:00
TreeHugger Robot
48d830ebd9 Merge "Revert "Fix the logics in ImeFocusController#onPostWindowFocus"" into rvc-dev 2020-04-16 20:58:47 +00:00
Yohei Yukawa
067d71bc31 Revert "Fix the logics in ImeFocusController#onPostWindowFocus"
This reverts commit a56779d1ab [1].

Reason for revert:
Caused multiple test failures in CtsInputMethodTestCases

 [1]: I68bb95fc3cbfe1f5992ccf87694b34c3e52bb31f

Bug: 153612876
Fix: 154250671
Test: atest CtsInputMethodTestCases
Change-Id: Ibf6143f46ae18e41e8ecfa50f523216e7340adda
2020-04-16 20:35:27 +00:00
Lee Shombert
6e17bc7fae Merge "Fix exception handling in getState() binder cache" into rvc-dev 2020-04-16 15:49:12 +00:00
Shu Chen
9b6af1dcc5 Merge "Prevents multi touch among TextView and handle reviews." into rvc-dev 2020-04-16 15:32:32 +00:00
TreeHugger Robot
526dba462f Merge "Remove click listeners from app op icons" into rvc-dev 2020-04-16 15:06:49 +00:00
Linus Tufvesson
db1f2ec052 Make ActivityViews backing virtual display private
Bug: 150310377
Test: atest CtsWindowManagerDeviceTestCases:ActivityViewTest
Test: Used bubbles test app to verify that it's still happy when using
private VDs

Change-Id: I02c6840b1f908a5177c217494de0110f5ce78f7e
2020-04-16 15:50:48 +01:00
TreeHugger Robot
4220cf74ca Merge "Fix the logics in ImeFocusController#onPostWindowFocus" into rvc-dev 2020-04-16 14:46:04 +00:00
Beverly
717deadfdb Remove click listeners from app op icons
Instead, the click listener is set on the app opp container since
clicking on the app opp container results in the same action as clickng on the
individual app icons. As per a11y guidance, only set the click listener
on the container.

Test: manual
Fixes: 153281363
Change-Id: Ic1c2bdb2f77fc459a3a3e997ed494b4bab36a273
2020-04-16 09:34:29 -04:00
Ming-Shin Lu
a56779d1ab Fix the logics in ImeFocusController#onPostWindowFocus
In ImeFocusController#onPostWindowFocus -> onViewFocusChanged,
it implies that the view has focus after onPostWindowFocus, this logics
we keep leveraged from IMM#onPostWindowFocus -> focusInLocked() long
ago, which may not always be true as SearchView layout may call
View#clearFocus when size changed after IME switcher shown.

When IME switched and back to app activity, in the above call path,
even activity window focused, and set the fallback focus view as
activity's root view, but the root view is not actually focused,
if we set this view as the next served view, then calling
View#onCreateInputConnection will return null, because it's not an editor.

Use correct view focus state when calling onViewFocusChanged.

Fix: 153612876
Test: manual as below:
     1) Launch Files app, taps SearchView EditText
     2) switch IMEs with IME switcher dialog
     3) see if Password keyboard shown.
     4) keeps 2) and 3) several time.
     Expected: There is no password keyboard and
     the keyboard input is still workable.
Change-Id: I68bb95fc3cbfe1f5992ccf87694b34c3e52bb31f
2020-04-16 20:39:54 +08:00
Joanne Chung
cb3c97db0c Fix app crash if the selection is from reverse direction.
When user types some text and then long presses on end of empty area
to open context menu, if user opens Gboard and selects text from the
reverse direction, SelectionEnd will be less than SelectionStart. The
IllegalArgumentException occurred because TextClassification does not
allow SelectionEnd is less than SelectionStart. We swap the start and
end index if end index is less than start index.

Bug: 150916165
Test: Manual. No crash occurs.
Test: atest FrameworksCoreTests:android.widget.TextViewActivityTest

Change-Id: I8dbc92f0f31e64b7e3a45ae91762e1b741629a8e
2020-04-16 17:37:05 +08:00
Oli Lan
46a0a5abb5 Merge "Add min extension versions to AndroidPackage." into rvc-dev 2020-04-16 08:21:33 +00:00
TreeHugger Robot
27e6f4ebf7 Merge "Camera: Hook up zoom ratio in legacy camera2 shim" into rvc-dev 2020-04-16 06:00:14 +00:00
Shu Chen
eb8b1ba3df Prevents multi touch among TextView and handle reviews.
- First touch on TextView blocks secondary touches on handles.
 - First touch on handles blocks later touches on TextView but doesn't block secondary touches on other handles.

Bug: 150995597
Test: manually tested & automation tests:
  atest FrameworksCoreTests:EditorCursorDragTest
  atest FrameworksCoreTests:TextViewActivityTest
Change-Id: I7717fc061fc81514fc1dad0d3acbc73e683516cf
2020-04-16 13:58:10 +08:00
Hui Yu
4803268229 Move noteAppWidgetTapped call into AppWidgetHostView.
RemoteViews is public API used out of scope of widget. The correct place
to call noteAppWidgetTapped is in AppWidgetHostView.

Fix: 153676411
Test: manual test, tap a widget, "adb shell dumpsys usagestats | grep
USER_INTERACTION" to oberserve USER_INTERACTION event sent to UsageStas, "adb shell dumpsys appops | grep appWidgetVisible" to observer appWidgetVisible flag.

Change-Id: Ic473211b91fd952dbb81b09b1e1568d6f69a0dd8
2020-04-15 22:06:12 -07:00
TreeHugger Robot
9f11dd4b64 Merge "Remove android.view.inline deprecated API." into rvc-dev 2020-04-16 01:23:19 +00:00
Shuzhen Wang
f807a41008 Camera: Hook up zoom ratio in legacy camera2 shim
Map the camera2 CONTROL_ZOOM_RATIO to legacy zoomRatio in Camera.Parameters.

Test: Force Pixel 2 HAL to HAL1, and run testZoomRatioTest
Bug: 149052011
Change-Id: I888c919ae10d3e2882f3df797524a06e2b3be259
2020-04-15 18:01:29 -07:00