Commit Graph

10201 Commits

Author SHA1 Message Date
TreeHugger Robot
d1e123cbad Merge "Autofill: Add API for virtual view visibility" 2017-07-12 17:36:29 +00:00
Svetoslav Ganov
4db89ba82e Autofill: Add API for virtual view visibility
Test: VirtualContainerActivityTest

bug:38509603

Change-Id: I3546c99d0b13316337c5015e003337b8019194a9
2017-07-11 19:43:01 -07:00
Phil Weaver
9e90a7236a Merge "NumberPicker a11y (and a11y-inspired) fixes" 2017-07-11 23:12:20 +00:00
Philip P. Moltmann
ebbe2d4899 Verify regex on CharSequenceTransformation
... Also
- change the constructor of the Builder of this class
- Do not crash if the subsitutions for the regexes are invalid

Change-Id: I965d5830f4932eb40ec22d7fa308815955920a99
Bug: 62534917
Test: cts-tradefed run cts-dev -m CtsAutoFillServiceTestCases
2017-07-10 15:15:48 -07:00
Robert Carr
17c3a03be0 Merge "SurfaceView: Avoid initializing Surface from an invalid SurfaceControl." into oc-dev am: 401b8907d0 am: 2f927d56cf
am: 7de9f7a334

Change-Id: I00846580b78758631cd6db262c1b5057204515f6
2017-07-07 03:35:15 +00:00
Robert Carr
7de9f7a334 Merge "SurfaceView: Avoid initializing Surface from an invalid SurfaceControl." into oc-dev am: 401b8907d0
am: 2f927d56cf

Change-Id: I2916aa9a24b84d4f379c8ebebc7e19eb4adc96f4
2017-07-07 03:29:06 +00:00
TreeHugger Robot
401b8907d0 Merge "SurfaceView: Avoid initializing Surface from an invalid SurfaceControl." into oc-dev 2017-07-07 03:10:12 +00:00
Robert Carr
7c67b7d097 SurfaceView: Avoid initializing Surface from an invalid
SurfaceControl.

In a recent CL we introduced a call to Surface#createFrom, in order to
recreate the Surface object from the underlying SurfaceControl, as a
workaround to emulate when it was parcelled over binder in the past.
However this is causing BufferQueue abandoned errors when stopping and
resuming some applications. To understand them, we need to revisit the
SurfaceView destruction process when handling onStop.

First mWindowStopped will be set to true (SurfaceView#windowStopped),
and we should then enter updateSurface. Our requested visibility will
now be false and so we emit the Surface destroyed callbacks. Notice in
the finally block in mUpdateSurface, we will release mSurface, but we
will NOT null mSurfaceControl. Inline documentation explains why.

In the case that the activity is not actually being destroyed, it's
possible that we may not get a dispatchDetachedFromWindow. This means
that we will not null mSurfaceControl. Now if the activity is
un-stopped and we re-enter updateSurface we encounter a problem
state. "creating" will be set to false since mSurfaceControl != null,
however mSurfaceControl will not point to a valid surface.

Prior to the introduction of the #createFrom call, this unwanted state
didn't cause any problems. Because mSurface was released back in the
finally block as we were stopping we now fall out of the
mSurface.isValid() block in updateSurface. As we reach the finally
block again, we would now set mSurfaceControl=null since the app was
no longer stopped. Later when we reach updateSurface again (which
tends to happen quite often) it will now be null and we will correctly
set creating=true, create a valid SurfaceControl, and move along
happily. However following, the introduction of this
Surface#createFrom call we will now reinitialize the Surface from an
invalid underlying SurfaceControl. This means we will enter the
mSurface.isValid block, but will proceed to emit an invalid Surface to
the client in the callbacks.

We avoid this state by making creating=true even if
SurfaceControl=non-null when the calculated visibility changes from
invisible to visible.

Bug: 63251745
Test: Manual of app from bug and apps from previous related bugs. go/wm-smoke. Additional manual testing of many SV apps.
Change-Id: Icc32a34cac239d65267da705cc23feb23e1ceb67
2017-07-06 15:53:04 -07:00
Abodunrinwa Toki
5b0a5fc160 Merge "Make ActionMode.isUiFocusable a TestApi" 2017-07-06 20:44:58 +00:00
Adrian Roos
076cc55973 Merge "AOD: Skip window animations while dozing" into oc-dr1-dev am: 92b6b7090c
am: fd9d88beb3

Change-Id: I76a5fdc6db9a849eeacf47278391e5d7eae53fc2
2017-07-06 18:08:36 +00:00
TreeHugger Robot
92b6b7090c Merge "AOD: Skip window animations while dozing" into oc-dr1-dev 2017-07-06 17:53:24 +00:00
Adrian Roos
e94c15ca96 AOD: Skip window animations while dozing
Fixes: 37245619
Test: go/wm-smoke; Go to home, turn off phone, observe that during the transition to AOD the navigation bar hide animation does not play.
Change-Id: I9a2fce4295900648a680e8e7e8fee0fbb447dd3d
2017-07-06 17:13:07 +02:00
Siarhei Vishniakou
0a5d805ae1 Merge "Hide VIRTUAL_KEY_RELEASE constant." into oc-dr1-dev am: 20a240fc5d
am: c7b722117c

Change-Id: Icec2d07d2edf93fc9c9e130eeea175e5418cc518
2017-07-05 22:51:57 +00:00
TreeHugger Robot
4c3c19fbc1 Merge "Added PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS window flag." 2017-07-01 02:06:02 +00:00
Abodunrinwa Toki
ba51f15998 Make ActionMode.isUiFocusable a TestApi
Test: bit CtsViewTestCases:android.view.cts.ActionModeTest
Bug: 62070427
Change-Id: I21b24d2a497bdc5234539bcc662ad707bb7f34dc
2017-07-01 02:10:04 +01:00
Wale Ogunwale
01ad4345f9 Added PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS window flag.
When a window with this flag is visible, then any other window added
by an application process that requires OP_SYSTEM_ALERT_WINDOW
permission or that are of TYPE_TOAST will be hidden.

Bug: 62196835
Test: go/wm-smoke
Test: Added the new flag to the RecentsActivity onCreate, launched FB
chat heads and observed the head head become invisible when Recents is
visible and the chat head become visible when Recents is no longer
visible.

Change-Id: I1a3e3c5b1696a5f5b95eac187acb5a03863b4a0b
2017-06-30 14:27:38 -07:00
Siarhei Vishniakou
ff1121a735 Hide VIRTUAL_KEY_RELEASE constant.
The constant will become visible once
the corresponding feature is supported.

Bug: 62433331
Test: make
Change-Id: I310338033dd861e9fd0cc1492a8e34fb53ce0415
2017-06-30 11:02:02 -07:00
TreeHugger Robot
08a18210fb Merge "Remove the internal APIs of TSM to change spell checker settings" 2017-06-30 17:37:27 +00:00
Bryce Lee
a89a8cdef9 Merge "Always send configuration to client from resize and relayout." into oc-dr1-dev am: 392ac74f37
am: 4c201983cf

Change-Id: Ie0a49f094952dbd717dc1a71de4aafd267e9c214
2017-06-30 16:42:10 +00:00
Bryce Lee
bb7965ed90 Merge "Add rotation to configuration." into oc-dr1-dev am: 2050dc66e2
am: 2004fc1387

Change-Id: If3a3975a2e07a96de1120b1a0744eab466284764
2017-06-30 16:40:58 +00:00
Bryce Lee
392ac74f37 Merge "Always send configuration to client from resize and relayout." into oc-dr1-dev 2017-06-30 16:17:34 +00:00
Bryce Lee
2050dc66e2 Merge "Add rotation to configuration." into oc-dr1-dev 2017-06-30 16:17:34 +00:00
Bryce Lee
f858b5788e Always send configuration to client from resize and relayout.
Previously, the server side would omit reporting new configurations
during resize and relayout if the current configuration matched the
last reported. However, if the last reported came through a resize,
the client side handling would be enqueued as a Handler message. This
leads to the possibility of the client getting a new window frame but
not a new configuration where this is synchronously handled, such as
ViewRootImpl::performTraversals.

To address this issue, we now always send the current configuration
from the server to the client. The client then identifies changes
against its own record of last reported configuration and updates as
appropriate.

This changelist also adds a call to force window relayout during
updateConfiguration, as it's possible this is called after
performTraversals is called or resize is handled, leading to a stale
window frame.

Bug: 24671393
Test: go/wm-smoke
Test: Open Camera while rotating phone to landscape. Added
      temporary logs to detect inconsistencies between measurements
      and reported rotation on draw.

Change-Id: I0d5143dfe80400f6a43ce710750f9fc9d4b93f74
2017-06-30 06:42:50 -07:00
Albert Chaulk
c8600632b1 Merge "Add getCurrentImeTouchRegion to the WindowManager API" into oc-dr1-dev am: 4bf79089c4
am: 1bfecb614e

Change-Id: I17be0a9b64ae628fedcfa61dbddb4cbcaaa58b79
2017-06-30 03:34:13 +00:00
TreeHugger Robot
4bf79089c4 Merge "Add getCurrentImeTouchRegion to the WindowManager API" into oc-dr1-dev 2017-06-30 03:22:45 +00:00
Phil Weaver
2b94b2ad75 Merge "Revert "Added PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS window flag."" 2017-06-30 02:06:00 +00:00
Phil Weaver
909eda1faf Revert "Added PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS window flag."
I submitted this change by accident after confusing it with one of mine. Sorry.

Bug: 62196835

This reverts commit 6f2a1a18fc.

Change-Id: Ib6d89690d1d761d38da3131131ff807a3fac0d2b
2017-06-30 02:03:32 +00:00
Phil Weaver
d442642c1d Merge "Added PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS window flag." 2017-06-30 01:55:42 +00:00
Ricardo Loo
7af458a415 Merge "docs: Updated isAutofillSupported description." into oc-dev am: a89dfb5439 am: 824b41d77a
am: a29c9a9466

Change-Id: Id7b3e0f72b60b0450aa9b6aa181faae8a22109e7
2017-06-30 01:06:58 +00:00
Ricardo Loo
824b41d77a Merge "docs: Updated isAutofillSupported description." into oc-dev
am: a89dfb5439

Change-Id: Ie43f37efa9e268b04dbad09ad04795089de68adf
2017-06-30 00:51:55 +00:00
Chet Haase
54f91d66e8 Merge "Add docs for new padding/margin attributes." into oc-dev am: 8cdbd6e184 am: d73f6a985d
am: 95e6c38eb0

Change-Id: Id397296039d2ca9bd8fe6bf4130a3308296843da
2017-06-30 00:47:56 +00:00
Ricardo Loo
a89dfb5439 Merge "docs: Updated isAutofillSupported description." into oc-dev 2017-06-30 00:44:50 +00:00
Bryce Lee
c1f2f2a9d3 Add rotation to configuration.
Certain activities are dependent on the rotation of the device to
determine layout. In these cases, orientation does not provide enough
details.

This CL adds the field (hidden) to the configuration.

Change-Id: Idb3ba10cb4de8838737c25e92264e6cee224e264
Fixes: 32839232
Test: go/wm-smoke
2017-06-29 17:40:23 -07:00
Chet Haase
d73f6a985d Merge "Add docs for new padding/margin attributes." into oc-dev
am: 8cdbd6e184

Change-Id: Iacf5e069e0e6a2b38a1566f36f81ab8de693e634
2017-06-30 00:32:26 +00:00
Guliz Tuncay
46a54e8be6 Remove the internal APIs of TSM to change spell checker settings
Previously, TextServicesManager was exposing APIs to system services to
modify spell checker settings. However, Settings application is the only
client of these APIs and there is no need to expose it to all the other
services. Settings app already has the WRITE_SECURE_SETTINGS permission
and can directly update the spell checker settings. Hence, we can remove
these APIs from TSM.

Fixes: 62950392
Test: Manually as follows.
      1. Build and flash an OS image.
      2. Complete the setup wizard (if any).
      3. Make sure AOSP Keyboard (com.android.inputmethod.latin) is installed
      4. Install SampleSpellCheckerService
       4.1 tapas SampleSpellCheckerService
       4.2. make -j
       4.3. adb install -r out/target/product/generic/system/app/SampleSpellCheckerService/SampleSpellCheckerService.apk
      5. Set the current spell checker service to be AOSP SCS by
       adb shell settings put secure selected_spell_checker com.android.inputmethod.latin/.spellcheck.AndroidSpellCheckerService
      6. Run a test program that has TextView and tap on one of the
       TextViews and type some text.
      7. Observe that there is a connection to AOSP SCS by
       adb shell dumpsys textservices
      8. Set the current spell checker service to be
      SampleSpellCheckerService SCS by
adb shell settings put secure selected_spell_checker com.example.android.samplespellcheckerservice/.SampleSpellCheckerService
      9. Observe that there is a connection to SampleSpellCheckerService
      SCS by
       adb shell dumpsys textservices
Change-Id: I4513ca661788f00785f684c21d7244c233b6e33e
2017-06-29 20:56:52 +00:00
chaviw
59b9885bc8 Added Activity flags to show on lock screen.
Added two new flags to the Activity to turn the screen on and
show on the lock screen. These can be used instead of the Window flags
LayouParams.FLAG_TURN_SCREEN_ON and LayoutParams.FLAG_SHOW_WHEN_LOCKED
to prevent the double onStart/onResume lifecycle events.

The flags can be set as an attr for the Activity in the AndroidManifest
using android:showWhenLocked="true" and android:turnScreenOn="true".
They can also be set through methods in the Activity class using
setShowWhenLocked(true) and setTurnScreen(true).

Fixes: 36850100
Test: Created sample application, tests/ShowWhenLockedApp, that set the
      flags in the manifest and code. Tested multiple scenarios to
      launch the Activity with the flags set and unset.
Test: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases -t android.server.cts.KeyguardTransitionTests
Test: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases -t android.server.cts.ActivityManagerActivityVisibilityTests
Test: cts-tradefed run commandAndExit cts-dev --module CtsServicesHostTestCases -t android.server.cts.KeyguardTests

Change-Id: I44f0e313df4531d49c7ac56108b6bf80e41fefc1
2017-06-29 13:33:43 -07:00
Wale Ogunwale
6f2a1a18fc Added PRIVATE_FLAG_HIDE_NON_SYSTEM_OVERLAY_WINDOWS window flag.
When a window with this flag is visible, then any other window added
by an application process that requires OP_SYSTEM_ALERT_WINDOW
permission or that are of TYPE_TOAST will be hidden.

Bug: 62196835
Test: TODO
Change-Id: I07605b52af893945250b0212f406e0e92bfd92bd
2017-06-29 12:59:31 -07:00
Albert Chaulk
2ccb0b72e3 Add getCurrentImeTouchRegion to the WindowManager API
This is a followup to ag/2370980/ to expose the API more
externally as a WindowManager API. This allows application
access without needing to reflect on IWindowManager.Stub.

We require this to get the current IME touch region to
display it properly in VR contexts.

Test: Manual
Bug: 62194867

Change-Id: Ibbf336e1e473b65d4c76a1492da187d50cfda424
2017-06-29 13:44:19 -04:00
Chet Haase
353d397d17 Add docs for new padding/margin attributes.
The attributes for View, paddingHorizontal and paddingVertical,
were added in the O release and are documented in R.attr. But they
should also be referenced in View itself, alongside the other
padding parameters.

Similarly, the new layout_MarginHorizontal and
layout_marginVertical should be referenced in
ViewGroup.MarginLayoutParams.

Bug: 63128350  Add docs about new padding/margin params
Test: built docs, checked the result
Change-Id: I3021df5ea83c469811b4a6ec6ecd3ab2966ec384
2017-06-29 07:54:19 -07:00
Ricardo Loo
33d226c953 docs: Updated isAutofillSupported description.
The description for `AutofillManager.isAutofillSupported` doesn't make
clear that either the device or the user can make autofill unsupported.

Bug: 62604325
Test: Ran 'make ds-docs -j16' and staged content to
go/dac-stage/reference/android/view/autofill/AutofillManager.html#isAutofillSupported()

Change-Id: I298b9f535e23dc3cb54fabed36642523753c13a5
2017-06-27 14:17:33 -07:00
TreeHugger Robot
ab620613b9 Merge "Fixes grammatical error in InputMethodManager doc" 2017-06-27 19:54:23 +00:00
Nick Felker
8efc3ee3ee Fixes grammatical error in InputMethodManager doc
Fixes: 29645208
Test: This is not a code change, so tests should be unaffected.
Change-Id: I8b76166f3a7f1c825dc9725f6d7fd8e8c96fe410
2017-06-27 17:59:36 +00:00
Jeff Sharkey
5ab0243330 Only require that system UIDs tag their sockets.
Apps with a normal UID are typically isolated enough to not require
socket tagging; we're mostly interested in tracking down internal
UIDs that have lots of code sharing the same UID.

Also fix up everyone doing manual string checks of Build.TYPE, since
we now have first-class fields for those.

Bug: 38126076
Test: builds, boots
Change-Id: I3a40348196bd8459289f2b9355d9783a07f1e7dd
2017-06-27 11:11:06 -06:00
TreeHugger Robot
10a41f9b12 Merge "Protect a11y against multi-threaded UIs" into oc-dr1-dev 2017-06-24 04:44:12 +00:00
Rob Carr
7ac7a1ea6d Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev am: 70f1565b55 am: bf78acda44
am: 90c4bbbd1a

Change-Id: I200243684a5a29f9f407d45a2826236bb32056c0
2017-06-21 03:12:55 +00:00
Rob Carr
90c4bbbd1a Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev am: 70f1565b55
am: bf78acda44

Change-Id: I98b615cd1f52385bb3cdbc4dcc287911f3eabad0
2017-06-21 02:50:51 +00:00
Rob Carr
2f666763e9 Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev
am: 70f1565b55

Change-Id: I88d205835ce91ea21d77a15649aad2d3b9c187d7
2017-06-21 02:38:55 +00:00
Rob Carr
70f1565b55 Merge "SurfaceView: Fix positioning issue when toggling visibility." into oc-dev 2017-06-21 01:47:58 +00:00
TreeHugger Robot
02d082dd0b Merge "Add Window.isWideColorGamut()" 2017-06-21 01:02:56 +00:00
Romain Guy
f979298b48 Merge "Only enable wide color gamut support on capable devices" into oc-dr1-dev am: 8d4ff1b34f
am: b11cf2d2e5

Change-Id: I6a8fe23b0c1c81142611fe5b0867b8d7f04a4e9b
2017-06-21 00:00:56 +00:00