Commit Graph

12974 Commits

Author SHA1 Message Date
Nicholas Ambur
d291d14a39 Merge changes from topic "voiceinteraction-access-control"
* changes:
  remove client token passing active VI service
  add enrollment application UID tracking
2020-02-24 23:13:11 +00:00
Dieter Hsu
7fb7b739e3 Retry TTS speaking for a11y shortcut warning dialog
TTS engine might fetch data over the network or prepare data when
binding tts service at first time after boot that may take a few
seconds. Because the dialog is shown only once and on-demand for
enableing accessibility shortcut, it's unable to speak successfully
unless others have bound tts ahead of time.

Bug: 139887992
Test: 1. adb shell settings delete secure accessibility_shortcut_dialog_shown
      2. manual reboot, long press both vol keys and tts speaks
Test: Add 2nd user and long press both vol keys and tts speaks
Test: atest AccessibilityShortcutControllerTest

Change-Id: I6290f0a64d1a51aa46f13e7d88a15a096ddb0fdc
2020-02-24 15:32:06 +08:00
Nicholas Ambur
c6f4118f9e remove client token passing active VI service
Previous implementation relied on client to pass a token which the
service used to verify if it was the active service. This is seen to be
a security concern as there is no way to verify how the client obtained
the token. Instead, a check is done to confirm the caller's UID matches
the UID of the active service.

In the case of voice model enrollment, KeyphraseEnrollmentInfo class is
leveraged. A client is allowed to enroll if it is the active voice
interaction service or if it is a voice model enrollment application
bundled with the system image.

All previous manifest permision checks still apply.

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

Change-Id: Ie2c4653d365770a9123a22bc69822518b4ccc568
2020-02-23 20:43:17 -08:00
TreeHugger Robot
e57202e8d9 Merge "Introduce SoftInputShowHideHistory" 2020-02-22 07:17:47 +00:00
TreeHugger Robot
f2d6183351 Merge "Revert "Enable compositor shadows for PIP"" 2020-02-22 04:57:39 +00:00
Vishnu Nair
b77bc9bef4 Revert "Enable compositor shadows for PIP"
This reverts commit 1f03c5017a.

Reason for revert: client composition in pixel4 doesn't behave as expected. Multiple layers including pip and wallpaper are selected for client composition. 

Change-Id: I3d6be8b9b1768aeda35411b45b426c83a7379e36
2020-02-21 22:26:37 +00:00
Richard Gaywood
2a04318b00 Merge "Add method to return merged stats to AIDL" 2020-02-21 15:21:30 +00:00
TreeHugger Robot
f748ca137e Merge changes from topic "revert-10338939-YCRBMILGZV"
* changes:
  Revert "[NS D03] Migrate the bad wifi avoidance policy"
  Revert "[NS D04] Implement a simple speed comparison between scores."
2020-02-21 08:51:09 +00:00
Andrii Kulian
f753ea6cd6 Do not verify display context in DecorContext constructor
Non-activity context can be passed to DecorContext, so an exception
can be thrown when Context#getDisplay() call does verification.
An example is that a free dialog uses Application context as its context.

Bug: 149928768
Test: manual: test crashed apps reported in bugs before/after this patch.
Change-Id: Ib302c23cb8e2e388e7468f37f1b63b83ef52ef0e
2020-02-21 07:29:11 +00:00
Chalard Jean
5845d54106 Revert "[NS D03] Migrate the bad wifi avoidance policy"
Revert submission 10338939

Reason for revert: The feature was punted out of R.
Reverted Changes:
I32c12702c:[NS D04] Implement a simple speed comparison betwe...
I688593cc0:[NS D03] Migrate the bad wifi avoidance policy

Change-Id: I640635a1ed94bed3b53466abe2a988caf0eca2b0
2020-02-21 06:47:35 +00:00
TreeHugger Robot
2cf1cf436f Merge "Remove exception from OverlayConfig zygote method" 2020-02-20 21:13:47 +00:00
Haining Chen
6c839dd1c6 Merge "Implementations of biometric contraints for weak and convenience tiers (1) 24 hours fallback (2) 4 hours idle timeout" 2020-02-20 21:05:24 +00:00
Antoan Angelov
3688af691b Merge "Enable ViewPager swiping for intent resolver." 2020-02-20 20:48:57 +00:00
Ryan Mitchell
857ce7ace1 Remove exception from OverlayConfig zygote method
The AssetManager constructor is marked UnsupportedAppUsage and the
recent changes to OverlayConfig caused an exception to be thrown when
the function is not called from the root process.

Previously a warning message would be logged indicating that no static
overlays would be loaded. Removing the uid check will restore the
previous behavior.

Also remove the system uid checks for initializeSystemInstance so PMS
service can also be constructed during testing.

Bug: 149806146
Test: invoke new AssetManager() from non-root thread
Change-Id: I55af2cddeba4df7a99c281c93e0181b9e2139139
2020-02-20 11:11:29 -08:00
Ryan Mitchell
290bc3ba36 Merge "Add test mapping for Overlayconfig" 2020-02-20 17:45:19 +00:00
Richard Gaywood
3ee7557fb5 Add method to return merged stats to AIDL
For procstats aggregated stats collection, we need to expose the
aggregated ProcessStats object back to the caller.

Change-Id: Ifb52f813d679e3e0a1e061f983d8b4f539d6d72a
Test: nothing yet
2020-02-20 16:09:20 +00:00
Ryan Mitchell
105c546159 Add test mapping for Overlayconfig
Bug: 138458867
Test: atest
Change-Id: Ia5e3d8d4b548aae3f1cd44d5c2cf0db5bf420d34
2020-02-20 15:33:34 +00:00
Charles Chen
c56ce6fd08 Merge "Exempt-From-Owner-Approval: Report non-visual Context misuse" 2020-02-20 12:30:06 +00:00
Automerger Merge Worker
214e7a5f62 Merge "Check argument in PowerProfile.getNumCoresInCpuCluster" am: 74952231df am: 310c1b76ea am: 15bcefd386
Change-Id: I2029bc94536f3617da34bfc4ac18489819baa14a
2020-02-20 11:14:20 +00:00
Automerger Merge Worker
310c1b76ea Merge "Check argument in PowerProfile.getNumCoresInCpuCluster" am: 74952231df
Change-Id: Id1bf2fa710c24ba76efbc5ad9b83dab63b8c334a
2020-02-20 10:47:24 +00:00
Treehugger Robot
74952231df Merge "Check argument in PowerProfile.getNumCoresInCpuCluster" 2020-02-20 10:36:46 +00:00
TreeHugger Robot
20afdde053 Merge "Add kernel per-uid cpu time reader tests to presubmit" 2020-02-20 09:07:44 +00:00
Sudheer Shanka
9244b3809f Merge "Add LongSparseArray.removeIf(Predicate)." 2020-02-20 05:22:06 +00:00
TreeHugger Robot
33b5e30fdc Merge "Handle the case of null intent type when obtaining target intent filter." 2020-02-20 04:58:51 +00:00
Yohei Yukawa
62612562d0 Merge "Offload user-switching task from startInputOrWindowGainedFocus()" 2020-02-20 03:27:26 +00:00
Sudheer Shanka
a43148216a Add LongSparseArray.removeIf(Predicate).
Fixes: 149648797
Test: atest core/tests/coretests/src/android/util/LongSparseArrayTest.java
Change-Id: Ib7e73dcfe8be1dc1f3af577f30da7ebd5950d42a
2020-02-19 18:44:10 -08:00
lumark
10ecd64cdd Introduce SoftInputShowHideHistory
Add SoftInputShowHideHistory class to monitor showSoftInput / hideSoftInput
histories, each entry data contains:
  - ClientState: IME focused client process pid / uid who
  shows / hides soft input
  - Current focused window
  - Target display ID
  - Reason: describes why show / hide input
  - Request show or hide input
  - Timestamp

Bug: 141738570
Test: manual by calling "adb shell dumpsys input_method"
Change-Id: I21ad1708d68eae59dcd3d414248193fb130dadc2
2020-02-20 09:55:20 +08:00
Andrii Kulian
5877c7d6c0 Exempt-From-Owner-Approval: Report non-visual Context misuse
Make obtaining a visual service from non-visual Context instance
report a strict mode violation and print the stacktrace.

Make calling getDisplay() throw an exception if called on an instance
that is not associated with a display. For existing usages introduce
a new internal method that does not perform the verification until
the usages are properly fixed.

Bug: 128338354
Test: StrictModeTest#testIncorrectContextUse_GetSystemService
Test: StrictModeTest#testIncorrectContextUse_GetDisplay
Change-Id: Id25d590eca6e10066e55d7ed6436d3bc9e433beb
2020-02-20 01:29:25 +00:00
Yohei Yukawa
d277d6902f Offload user-switching task from startInputOrWindowGainedFocus()
As tracked in Bug 28750507, InputMethodManagerService#onSwitchUser()
is known to be slow, and the direct reason of the UI jank in the
launcher discussed Bug 139806621 is that #onSwitchUser() is running as
part of IMMS#startInputOrWindowGainedFocus() that is called as a sync
IPC from the UI thread of the launcher.  Note that this is a
relatively new behavior that was introduced in Android 10 to support
per-profile IME mode (Bug 111083076). So users shouldn't see this code
path unless the device is running on Android 10 with work profile
enabled.

What this CL does is removing that direct code path from
IMMS#startInputOrWindowGainedFocus() to #onSwitchUser() by introducing
a new pending result

  InputBindResult.ResultCode.SUCCESS_WAITING_USER_SWITCHING,

which means

  IMMS is now performing user switching and cannot start input session
  right now, but it will call the client back when the IME becomes
  available for the target user.

Note that InputMethodManager is already able to handle this kind of
pending state, where IME is not yet available, since we already have a
similar pending results as follows.

 * InputBindResult.ResultCode.SUCCESS_WAITING_USER_SWITCHING
 * InputBindResult.ResultCode.SUCCESS_WAITING_IME_BINDING

One remaining concern is that when IMMS#switchUserOnHandlerLocked() is
running with holding the giant lock (IMMS#mMethodMap), thus it's still
possible that IMMS#startInputOrWindowGainedFocus() can be blocked
because of lock contention, which eventually blocks client's UI
thread.  Although its chance wouldn't be that high, in order to tackle
that scenario we need to pursue different approaches such as:

 * Further optimize IMMS#startInputOrWindowGainedFocus() to reduce the
   likelihood of lock contention. This isn't a perfect solution for
   this particular case but it's still worth doing.  Possible
   candidate of optimizations are:
    * Bug 28750507:  optimize IMMS#switchUserOnHandlerLocked()
    * Bug 149864769: off-load Context#unbindService()
    * Reconsider the use of giant lock.

 * Redesign the current "startInput" protocol as part of our on-going
   effort to redesign IME focus handling protocol (Bug 141738570)
   e.g. can we completely make IMMS#startInputOrWindowGainedFocus()
   async IPC?

Bug: 139806621
Fix: 144291210
Test: atest CtsInputMethodTestCases CtsInputMethodServiceHostTestCases
Test: Manually made sure that IMMS#startInputOrWindowGainedFocus()
      isn't blocking Launcher's UI thread when swiping home.
  1. lunch aosp_coral-userdebug && make -j
  2. Flash the image
  3. Open the system settings
  4. System -> Gestures -> System nagivation
  5. Select "Gesture nagivation"
  6. Install Test DPC.
  7. Enable managed profile with Test DPC.
  8. adb install -r \
        $ANDROID_TARGET_OUT_TESTCASES/EditTextVariations/EditTextVariations.apk
  # deal with dex2oat
  9. adb shell cmd package compile -m speed \
        -f com.google.android.inputmethod.latin
 10. adb shell cmd package compile -m speed \
        -f com.android.inputmethod.tools.edittextvariations
 11. adb shell cmd package compile -m speed \
        -f com.google.android.apps.nexuslauncher
 12. adb root
 13. adb shell setprop pm.dexopt.disable_bg_dexopt true
 14. adb reboot
 15. adb shell am start -u 10 \
        -n com.android.inputmethod.tools.edittextvariations/.EditTextVariations
 16. Tap the first edit text on the EditTextVariations
 17. Make sure that AOSP Keyboard is shown
 18. adb shell am trace-ipc start
 19. external/chromium-trace/systrace.py \
        gfx freq am wm sched binder_driver view \
        -a com.android.launcher3 -o binder.html
 20. Swipe up the home button
 21. Hit the enter key to terminate the systrace.
 22. Check the IPC log to see how much the UI thread is blocked by
     IMMS#startInputOrWindowGainedFocus()
Change-Id: I5a73a66d2b8acadad9b3577ebc4c17b5a25fd011
2020-02-19 17:12:17 -08:00
Connor O'Brien
62e8396436 Add kernel per-uid cpu time reader tests to presubmit
Add TEST_MAPPING file to enable presubmit testing for changes to
KernelCpuUidTimeReader, KernelCpuUidBpfTimeReader and
KernelSingleUidTimeReader.

Test: atest
Bug: 138317993
Change-Id: Ic6272f101647a0e6fb3508b79c66387fefda0b04
Signed-off-by: Connor O'Brien <connoro@google.com>
2020-02-19 16:27:28 -08:00
Haining Chen
c06c481fcb Implementations of biometric contraints for weak and convenience tiers
(1) 24 hours fallback
(2) 4 hours idle timeout

Bug: 141025588

Test: atest AuthServiceTest
Test: atest KeyguardUpdateMonitorTest
Test: atest BiometricsUnlockControllerTest
Test: atest KeyguardIndicationControllerTest
Test: make -j
Change-Id: I1078ce39a2ae1e4c250b6468e477b703e3016e2c
2020-02-19 23:58:31 +00:00
Automerger Merge Worker
0bdf785b96 Merge changes from topic "settings-vpn" am: 70f90282ef am: ff39b8ba90 am: 752013f696
Change-Id: Idac6e83bab50b818e2776f28da380f08000e2a42
2020-02-19 23:08:32 +00:00
Feng Cao
6c821f6ea1 Merge "Introduces the Bundle to inline suggestions APIs to encode custom UI styling information." 2020-02-19 22:35:42 +00:00
Automerger Merge Worker
ed67786e6b Merge "Consume health HAL 2.1 values from framework" am: 217aadd0c2 am: 28c43860ea am: 8f9d77ae03
Change-Id: I60f9cee5e0ba74349a0448204b0e31d213151e5f
2020-02-19 22:16:25 +00:00
Winson Chiu
633cd037f7 Merge changes from topics "package-parsing-v2.1", "parsing-parsed-package-split"
* changes:
  Remove AndroidPackageWrite
  Migrate to new ParsedComponents and ParseResult
  Split ParsedComponents
  Add ParseResult infrastructure
  ParsingPackage/ParsedPackage test code migration
  ParsingPackage/ParsedPackage split source migration
  Important migration for new ParsingPackage/ParsedPackage split
  Separate ParsingPackage into core and ParsedPackage into server
2020-02-19 22:16:15 +00:00
Evan Rosky
2d88183bde Merge "SystemUI Split via TaskOrganizer" 2020-02-19 18:43:36 +00:00
Feng Cao
36960ee20e Introduces the Bundle to inline suggestions APIs to encode custom UI styling information.
* The bundle will be generated/consumed by the support library.
* More API documentation and example usage will be added later once we have the support library impl ready.
* The old style resource name approach doesn't work due to the potential mismatch in the support library version across the host IME and the platform renderer service, and the non-static nature of the public attribute int id in the support lib.
* The Bundle added to the onCreateInlineSuggestionsRequest() is intended for the platform/ExtServices to communicate the UI versions it supports.
* The Bundle added to the InlinePresentationSpec is intended for the IME to communicate the custom styles for the chosen UI versions.

Test: manual verification, and also atest CtsInputMethodTestCases:InlineSuggestionInfoTest CtsInputMethodTestCases:InlineSuggestionTest CtsInputMethodTestCases:InlineSuggestionsRequestTest CtsInputMethodTestCases:InlineSuggestionsResponseTest
Bug: 146454892

Change-Id: Id7fea32a7550fb924fec811b376790474a7b92eb
2020-02-19 09:42:22 -08:00
Winson
f00c755a23 Migrate to new ParsedComponents and ParseResult
Removes the massive old ComponentParseUtils in favor of
the new split classes.

Cleans up the parsing code to be uniform, removing the
String[] outError pattern in favor of ParseInput.

Bug: 135203078

Test: atest com.android.server.pm

Change-Id: I584ed37d4715300453dbe760d45d1eb4759b3dd3
2020-02-19 08:31:48 -08:00
Katsiaryna Naliuka
e2c0b5fe4b Handle the case of null intent type when obtaining target intent filter.
Currently the method swallows the exception but that pollutes the logs.
This change preserves the behavior while getting rid of distracting
errors in the logs.

Test: atest IntentTest; atest ChooserActivityTest

Change-Id: I2b02dc4ae0343fa1fd58a112455e426d8a6d3f34
2020-02-19 16:08:40 +01:00
TreeHugger Robot
d0f257ebb6 Merge "Show a line below the tabs in tabbed view to align with UX mocks." 2020-02-19 13:01:27 +00:00
arangelov
8aa7f03a6b Enable ViewPager swiping for intent resolver.
Fixes: 149730561
Test: manual
Change-Id: I8652177e6dcd78a7e4b2f713e6f0a020bf30c63e
2020-02-19 11:15:55 +00:00
Antoan Angelov
5562c7e87f Merge "Add metrics for work tab in intent resolver and share sheet." 2020-02-19 10:48:11 +00:00
arangelov
934c64ca39 Show a line below the tabs in tabbed view to align with UX mocks.
When tabs are disabled, the lines are still shown to be consistent
with Q.

Fixes: 149574743
Test: manual

Change-Id: I2307230e86da72a3f7c7d90d1454859490def679
2020-02-19 10:41:30 +00:00
Antoan Angelov
1c2e160fe9 Merge "Disable tabbed view support for UsbResolverActivity." 2020-02-19 10:41:03 +00:00
Winson
5e0a1d5ce2 ParsingPackage/ParsedPackage split source migration
Part of the Parsing/ParsedPackage split into core/server.

This migrates any core/services source with trivially reviewable
changes. Import changes, moving files around, or generally
small single line changes scattered throughout all code that
depended on the old state of the package code.

Bug: 135203078

Test: enumerated in first commit of change ID
		Ib4fe51d729a56bfb0ea1316e577358ba0dfceccf

Change-Id: If091641a81be2d943d1d3e4a3d654e200d0ce59d
2020-02-19 00:29:05 -08:00
Winson
e23ae20e30 Important migration for new ParsingPackage/ParsedPackage split
Part of the Parsing/ParsedPackage split into core/server.

This splits all the "important" changes, or those which change
significant code/logic and that requires a closer look during
review.

Bug: 135203078

Test: enumerated in first commit of change ID
		Ib4fe51d729a56bfb0ea1316e577358ba0dfceccf

Change-Id: Ie0e4394de2b3063121d850060fcd58622511c59d
2020-02-19 00:29:05 -08:00
Automerger Merge Worker
ff39b8ba90 Merge changes from topic "settings-vpn" am: 70f90282ef
Change-Id: If7e8310306889b38527bfab65316a50807814372
2020-02-19 07:51:20 +00:00
Benedict Wong
70f90282ef Merge changes from topic "settings-vpn"
* changes:
  Minor cleanup
  Add support for starting IKEv2/IPsec VPNs from settings
  Add always-on VPN support for platform VPNs
2020-02-19 07:39:41 +00:00
Ryan Mitchell
f2392c6f56 Merge changes from topic "rro_config"
* changes:
  Make overlay config work with immutable non-android overlays
  Add xml configuration of RROs
  Extract system partitions into standalone class
2020-02-19 04:37:26 +00:00
Benedict Wong
24a2be8275 Add support for starting IKEv2/IPsec VPNs from settings
This commit allows the startLegacyVpn() call to start Platform VPN
profiles, allowing Settings to use the IKEv2/IPsec VPN options

When using an aliased private key, the
Ikev2VpnProfile.KEYSTORE_ALIAS_PREFIX must be prepended to the front of
the alias. This will in turn result in the fromVpnProfile() function to
pull the key from the KeyStore, as opposed to the inline-key that the
VpnManager API uses.

Bug: 148991741
Test: FrameworksNetTests passing, new tests added in subsequent CL
Test: Manually tested
Change-Id: Icbca695c353b2e12e99305676404dbf1a4495949
2020-02-19 02:44:34 +00:00