Commit Graph

7845 Commits

Author SHA1 Message Date
Jeff Chang
9744262ffa Merge "Support the toast Window to show on the secondary display." 2018-08-17 01:14:51 +00:00
Jeff Chang
48ecef4bfb Support the toast Window to show on the secondary display.
1) Looking for the specific display when add a toast window.

2) Modify the enqueueToast interface to support the toast with
   specific dispaly Id.
   2.1 Toast get the specific display id from context.
   2.1 Toast use the new interface with display id to communicate with
       the Notification manager servcie.

3) Support to add/remove toast window token according to the displayId.

Bug: 80001975
Test: atest WindowManagerSmokeTest ActivityManagerMultiDisplayTests
Test: atest android.widget.cts.ToastTest
Test: manual, use ActivityView & launch a toast testing app in virtual
      display
      1. Make a toast.
      2. Verify the toast if show on the virtual display

Change-Id: I3a95c291af647ed9c6e966b2a90924097df19b6a
2018-08-15 14:20:54 +08:00
Joshua Baxter
e94834914a Merge "docs: fixed typo" into pi-dev am: 9ef8b6521c
am: b8a1004a72

Change-Id: I0692a141d13c005cc918194cc52be0339d24b17b
2018-08-14 13:54:32 -07:00
Joshua Baxter
b8a1004a72 Merge "docs: fixed typo" into pi-dev
am: 9ef8b6521c

Change-Id: I0f187f9d208d37dccc3b221fe41130173db951b1
2018-08-14 13:31:20 -07:00
Joshua Baxter
9ef8b6521c Merge "docs: fixed typo" into pi-dev 2018-08-14 20:02:53 +00:00
Siyamed Sinir
042856b46a Merge "Disable hyphenation by in default theme" 2018-08-07 18:46:15 +00:00
Vu Thanh Cong
c27346fa7d Merge "Fix edge effect not showing up on first scroll" am: 894d8cf470 am: 391a7c381d am: bc7b84e463
am: 7d3edea9eb

Change-Id: I26189eb151608994f60d349abdc3660e26032b38
2018-07-25 11:06:18 -07:00
Vu Thanh Cong
bc7b84e463 Merge "Fix edge effect not showing up on first scroll" am: 894d8cf470
am: 391a7c381d

Change-Id: Icda44b95c21c99dc1de794f83bc28995a001c55a
2018-07-25 10:35:10 -07:00
Vu Thanh Cong
391a7c381d Merge "Fix edge effect not showing up on first scroll"
am: 894d8cf470

Change-Id: I6ab2b6a141f3cd52e9732d8c9965dc1c22c303f5
2018-07-25 10:22:20 -07:00
Treehugger Robot
894d8cf470 Merge "Fix edge effect not showing up on first scroll" 2018-07-25 16:43:11 +00:00
Siyamed Sinir
c0dab36d6b Disable hyphenation by in default theme
Test: Added cts tests for default values
Test: atest CtsWidgetTestCases:EditTextTest
Test: atest CtsWidgetTestCases:TextViewTest
Test: atest FrameworksCoreTests:TextViewTest

Bug: 111096709
Change-Id: Ia4d13574557970432fdcd27581ee3fff4ec36c64
2018-07-23 14:25:28 -07:00
Derek Sollenberger
b6c4f6cda9 Merge "TextView setOverlappingRendering must be true when shadows are used." 2018-07-16 15:49:42 +00:00
Neil Fuller
b1d24c0ace Merge "Avoid use of DateUtilsBridge.icuTimeZone()" am: e859c42e23 am: 25fd54f6f3
am: 3208539011

Change-Id: Ib45c4fd371c9b4b4ab97973eddfd49101c353cc3
2018-07-16 02:09:18 -07:00
Neil Fuller
3208539011 Merge "Avoid use of DateUtilsBridge.icuTimeZone()" am: e859c42e23
am: 25fd54f6f3

Change-Id: I0083ddcadbc391a26ae8d264f8626bdf3b8f988f
2018-07-16 01:58:14 -07:00
Neil Fuller
25fd54f6f3 Merge "Avoid use of DateUtilsBridge.icuTimeZone()"
am: e859c42e23

Change-Id: I6b6452f9609d88ce61959e7c4ae4f0fd8fa97e64
2018-07-16 01:50:04 -07:00
Shrijana Ghimire
8e63b746ba Merge "Merge "docs: Fixed typos in AdapterView Javadoc." into pi-dev am: 9ef41ccf42" into pi-dev-plus-aosp
am: 74ecab8a44

Change-Id: I676fa766b26ecfc145ed4d5dd60b1af70dc99529
2018-07-13 12:48:15 -07:00
Shrijana Ghimire
9ef41ccf42 Merge "docs: Fixed typos in AdapterView Javadoc." into pi-dev 2018-07-13 19:03:24 +00:00
Neil Fuller
6d5c4a8d8d Avoid use of DateUtilsBridge.icuTimeZone()
DateUtilsBridge is only used in one place in framework.
The usage is avoidable by sticking to java.util. This
decreases the number of non-public libcore classes in
use by framework.

Test: build
Bug: 111055375
Change-Id: Ifd6576b5b6df1e154f16ec201a4575d0b95de66d
2018-07-13 19:54:29 +01:00
Derek Sollenberger
d4ca6d1c7a TextView setOverlappingRendering must be true when shadows are used.
The updates to the HWUI renderer now require that setOverlappingRendering be
set when shadows are used.  Without this change modifying the alpha of the
TextView will produce incorrect blending results.

Bug: 111381525
Test: Test app in bug
Change-Id: I523c5ef698e8db912dd2ef848eeeffb3465b990a
2018-07-13 12:02:53 -04:00
Mihai Popa
f03b7543c7 Allow 0sp text size in xml for TextView
Before this CL, when TextView's textSize attribute was set to 0sp in
XML, the text would still be visible on the screen, as the actual
textSize set was non zero. On the other hand, if the text size was set
to 0sp programmatically, the text would not be visible. This was a P
regression, as on O the text would be invisible in both cases.

This CL fixes the attribute reading stage in TextView, allowing the
application of a 0 text size on the view.

Bug: 110251171
Test: atest CtsWidgetTestCases:android.widget.cts.TextViewTest
Change-Id: I3798361e182f45a67cd0a69d40e09e559375aa20
2018-07-02 12:58:22 +00:00
Seigo Nonaka
b06144c5ed Add textFontWeight attribute to documentation
Bug: N/A
Test: m docs and manually verified
Change-Id: Ic2aca1503789c9ce426b3de3b887983ade292afe
2018-06-26 14:30:42 -07:00
Laura Davis
95aa3e124e Merge "docs: fixed broken link" into pi-dev am: e07aeea926
am: d3f3a2354a

Change-Id: I410789175ec49489bb60ca36c7ebb87e5090ccdc
2018-06-25 14:47:56 -07:00
TreeHugger Robot
4c51b7c057 Merge "Tweak some RenderNode API surfaces" 2018-06-21 19:05:27 +00:00
Laura Davis
3175696a46 docs: fixed broken link
Test: make ds-docs

Bug: 76021493
Change-Id: Ide61b82925270896e373083fdc1d5c27c9bdc819
2018-06-19 10:11:36 -07:00
Android Build Merger (Role)
93135a37b7 [automerger] Merge "Abbreviate permission labels less aggressively" into pi-dev am: af76df93e3 am: 3dce361445
Change-Id: Iea45f6992477e090e0f7ecaf2c4689354ad24786
2018-06-15 17:48:50 +00:00
Philip P. Moltmann
004e489a25 Abbreviate permission labels less aggressively
We switched the package installer app to always abbreviate all labels
loaded from foreign packages. This is done so that a foreign app cannot
crorrupt the UI via super-long strings.

The default abbreviation is very aggressive and abbreviates to ~5 cm.

When an app with a targetSDK <= M gets installed, all permissions will
get auto-granted. Hence when a user side-loads such an app, we show the
permissions during install so that the user is aware of this.

Unfortunately most permission labels and restrictions do not fit into a
single line.

This change allows much longer strings for permissions names and
descriptions. It still abbreviates eventually and handles permission
descriptions with weird characters (such as back-space) correctly.

Fixes: 110209410
Test: Side-loaded old app and verified that permission labels and
      descriptions are not abbreviated.

Change-Id: Ie1db240883c9f5cb9c1b74ca7bdcb80625e3f7f2
2018-06-14 11:52:14 -07:00
Shrijana Ghimire
fb53deca41 docs: Fixed typos in AdapterView Javadoc.
Replaced the word 'as' with 'has' and replaced 'id' with 'if'.

Test: make ds-docs

Bug: 36946939
Change-Id: I05828e2ee20309556ffbf56cff0093183dabc088
2018-06-12 09:34:30 -07:00
Yohei Yukawa
6008106a64 Lazily request spell checker session
Currently when an EditText is attached to a Window, one spell checker
session will be immediately requested even when that EditText is
empty.  This is not efficient, especially for notification with direct
reply.

With this CL, EditText does not request spell checker session while it
is empty.  Basically this doesn't cause any user-visible behavior
change.

Bug: 109701487
Fix: 37434131
Test: Run 'adb shell dumpsys textservices' to make that a new spell
      checker session is established not when a notification with
      direct reply is posted but when the user actually starts
      replying on that notification.
Change-Id: Iee04f4c0e2d248041d01c528344b191b9875d122
2018-06-11 17:41:45 -07:00
Mihai Popa
c390e51b45 [Magnifier-44] Fix memory leak caused by callback
Before this CL, the magnifier could have caused a memory leak when:
- in Editor we give the magnifier a callback that updates the visibility
of the handles after the magnifier is drawn. This holds a reference to
the HandleView, which in turn has a reference to the containing Activity
- the callback is set on the InternalPopupWindow, in order to be run
after the next #doDraw call
- #doDraw is post'd as a runnable to the UI thread
- the magnifier is dismissed and the activity is destroyed
- when the garbage collection happens, the InternalPopupWindow cannot be
collected, because either:
  -- there is still a reference to the job expected to run #doDraw
  -- there is still a pixel copy that has to finish. We keep a reference
     to the InternalPopupWindow in use when the pixel copy was requested
     in order to compare it with the current one, and dismiss the pixel
     copy result if the instance has changed
- both options above mean that we will still have a reference to the
callback that sets the visibility of the handles, so a reference to the
containing Activity. The Activity is, therefore, leaked.

This CL cleares the handle visibility callback when the magnifier is
dismissed, such that the unnecessary reference to the Activity will not
be held.

Bug: 80279783
Test: verified with leakcanary that the memory leak no longer exists
Change-Id: I65c77eb12d2778c76fe631b55e6a7164fbf487f1
2018-06-08 10:15:04 +00:00
TreeHugger Robot
7231e7b6ce Merge "More conservative dark text calculation" 2018-06-08 04:33:50 +00:00
Lucas Dupin
a291d19e47 More conservative dark text calculation
Refactored WallpaperColors to use constrast ratio instead of luminance
for detecting dark pixels. Also using a contrast more conservative than
what GAR requires while decreasing the dark area threshold.

Change-Id: I67b799be4b7ccd50bb3e63c6179d513b9b76446b
Fixes: 76435920
Test: manually set various wallpapers
Test: use new debug flag to verify which pixel is actually dark
2018-06-07 16:33:09 -07:00
Selim Cinek
ca30a349ed Merge "Fix exception from DateTimeView unregisters receiver again" into pi-dev am: a2537b7269
am: 96bc1cada2

Change-Id: If514fce8446cfb0a10380ce2db2b324575b13fd8
2018-06-06 13:41:40 -07:00
Selim Cinek
a2537b7269 Merge "Fix exception from DateTimeView unregisters receiver again" into pi-dev 2018-06-06 18:18:27 +00:00
Clara Bayarri
d85e32f31e Merge "Fix repeated calls into reportExtractedText" into pi-dev am: bcbdeb29c9
am: 1cf7c2e604

Change-Id: I467c01bbc66de8d5bf4ab9e6f97ecdc266b940ca
2018-06-06 08:04:04 -07:00
Riddle Hsu
e8f0fe3140 Fix exception from DateTimeView unregisters receiver again
Although parent view may invoke onDetachedFromWindow incorrectly,
itself should guarantee to unregister receiver only when removing
the last attached view.

Change-Id: I4b701c223c6aa354896a4067f77aad9c98d88dfd
Fixes: 78506836
Test: atest FrameworksCoreTests:DateTimeViewTest
2018-06-06 07:54:21 +08:00
Clara Bayarri
038f7a8b09 Fix repeated calls into reportExtractedText
As part of adding the hint text feature in
I357dd5c74b61d149cf8612d1f52c7118ec70c696  I refactored
the code inside reportExtractedText to avoid nesting but lost one
of the condition checks in the process. Since onDraw calls into
this method on each frame, the missing check was causing calls to be
made into the IME even when no content or selection changes have
happened.

Test: CtsWidgetTestCases:.TextViewTest
Bug: 73613936
Change-Id: If56e3f1d45e64dccd052e4cff4d742f0cbecc07c
2018-06-05 13:41:58 +01:00
John Reck
568b2a64f0 Tweak some RenderNode API surfaces
* no-arg #start()
* remove no-op #destroy method
* fix a Java-imposed quirk that you can't draw a
  currently invalid RenderNode, forcing bottom-up
  recording for no particular reason

Test: builds
Change-Id: I28b41c83b4f7f9ddced843b0d57e9ac510d40ae5
2018-06-04 17:02:02 -07:00
Joshua Baxter
df66bfaa0d docs: fixed typo
Test: make ds-docs

Bug: 78873111
Change-Id: I7c50d83ee0c55dae6aecadc676fe784c1727ef7a
2018-06-04 13:30:17 -07:00
Aurimas Liutikas
e701dc1799 Fix broken links in @see tags in framework docs.
doclava was accidentally suppressing all these broken links
in @see tags. This CL fixes issues so we can start enfocing
checks for broken @see links.

Test: make docs
Change-Id: If7830ece85f8d1f27c991eae282230814726e115
Exempt-From-Owner-Approval: Fixing @see javadoc link issues that are currently completely broken
2018-06-04 10:15:22 -07:00
Mihai Popa
6e8e27bf9a Fix monkey crash in smart selection animation
In Id65443e93d277c106ea955c867d39e94192cc55d we fixed a monkey crash
happening when the smart selected text had changed while the smart
selection animation was running. However, the change introduced a new
crash, happening when the smart selection result was null. This CL fixes
it, and lets startSelectionActionMode run even when the result is null,
as there seems to be some logic there which should happen in this case.

Bug: 80244201
Test: none
Change-Id: I7f0304446dec85578bdcd5011d2e9ea2737d3c36
(cherry picked from commit a9d27ea869)
Merged-in: I7f0304446dec85578bdcd5011d2e9ea2737d3c36
2018-05-25 14:01:23 +00:00
Mihai Popa
a9d27ea869 Fix monkey crash in smart selection animation
In Id65443e93d277c106ea955c867d39e94192cc55d we fixed a monkey crash
happening when the smart selected text had changed while the smart
selection animation was running. However, the change introduced a new
crash, happening when the smart selection result was null. This CL fixes
it, and lets startSelectionActionMode run even when the result is null,
as there seems to be some logic there which should happen in this case.

Bug: 80244201
Test: none
Change-Id: I7f0304446dec85578bdcd5011d2e9ea2737d3c36
2018-05-25 11:57:17 +01:00
TreeHugger Robot
26595a7f8f Merge "Cheaper crash check post smart selection animation" 2018-05-22 14:33:28 +00:00
Abodunrinwa Toki
140ac5b2b5 Merge "End the TC session on terminal selection event actions" into pi-dev am: d0a4dddb9b
am: 6826a4ab53

Change-Id: Ifca422285ca1faa681e0b761efedc0a2bfb31561
2018-05-22 07:15:32 -07:00
TreeHugger Robot
d0a4dddb9b Merge "End the TC session on terminal selection event actions" into pi-dev 2018-05-22 13:56:22 +00:00
Mihai Popa
6df95fa087 Merge "Fix crash after smart selection animation" into pi-dev 2018-05-22 11:19:24 +00:00
Abodunrinwa Toki
f299fc0397 End the TC session on terminal selection event actions
This regressed when introducing TC sessions in
I3c9ceea0863099fc4f0a5ce5e823c648ee9c4521
When the user triggers a terminal selection event such as "Copy",
we should immediately end the session instead of waiting for the
"Abandon" event (i.e. selection dismissed) to be included in the
logs. Terminal selection events implicitly dismiss a selection and
we'd rather distiguish between an actual "selection dismiss" from
one that happened because of a "terminal" selection event.

This cl also removes the "*" marker used to distinguish the new
logging from the old ones. The code for the old logging has already
been deleted so no more need for a marker.

Bug: 78541105
Test: bit CtsWidgetTestCases:android.widget.cts.TextViewTest
Test: bit FrameworksCoreTests:android.widget.TextViewActivityTest
Change-Id: Iac7d45dbc63e7076683742bd045766a1d927cfc9
2018-05-22 12:15:34 +01:00
Mihai Popa
6748ff37db Fix crash after smart selection animation
At the end of the smart selection animation, we run a callback that sets
the selection on the TextView (subsequently starting the action mode
toolbar and showing the handles). However, when the text changes before
the animation finishes, the selection might not be valid, and might get
out of the text bounds, which was producing a crash. This was observed
in a monkey crash. This CL fixes this bug by refusing to set the
selection when it goes outside the text bounds, corresponding to the
case when text has changed between the time the animation has started
and the time it ended.

Bug: 69919777
Test: manual testing before and after the fix
Change-Id: Iea043f320004d45ad16dd7e9e5b47e5256e6d9fa
(cherry picked from commit cce6e82d35)
Merged-in: Iea043f320004d45ad16dd7e9e5b47e5256e6d9fa
2018-05-22 10:42:16 +01:00
Mihai Popa
6849bd3296 Cheaper crash check post smart selection animation
At the end of the smart selection animation, we run a callback that sets
the selection on the TextView (subsequently starting the action mode
toolbar and showing the handles). However, when the text changes before
the animation finishes, the selection might not be valid, and might get
out of the text bounds, which was producing a crash.

This was initially fixed in Iea043f320004d45ad16dd7e9e5b47e5256e6d9fa,
by checking whether the text has not changed since the animation
started. The fix was implying one text copy and a potentially full text
comparison, being unnecessary costly. This CL instead only checks
whether the selection is still within the text bounds when animation
ends.

Bug: 69919777
Test: manual testing before and after the fix
Change-Id: Id65443e93d277c106ea955c867d39e94192cc55d
2018-05-21 18:58:03 +01:00
Abodunrinwa Toki
228460c709 Merge "Refresh TCM settings when they change" into pi-dev am: 3fa564030f
am: f08646f13e

Change-Id: I2a7fc61dac52817b053a680b82c18514f76ec6b8
2018-05-17 11:13:47 -07:00
Mihai Popa
5b3a42319c Fix TextView#setText misplaced documentation
In Ifaddb46d156c495a371789c6f32cfd67ffaaaef2, we improved the
documentation of TextView#setText to state an assumption that should
hold when subclasses override the method. However, the new phrase was
put in the wrong place. This CL fixes this.

Bug: none
Test: none
Change-Id: I918a6c533b9e4b34b3977a20e979a10db9741ebc
2018-05-17 16:42:22 +01:00