Skip to content
Commit 4d5c48d9 authored by Oli Lan's avatar Oli Lan
Browse files

Add ClipDescription method to determine if the clip is styled text.

This adds a new method to ClipDescription to allow callers to
determine if the associated ClipData is styled text, without
accessing the ClipData directly.

This information is used by editors such as TextView or WebView
when they show a selection toolbar, in order to determine if a
"Paste as plain text" option should be shown. Currently, ClipData
must be accessed in order to do this, so a clipboard access
occurs whenever text is selected.

Avoiding these clipboard accesses is desirable because a user-visible
message may in future be shown whenever ClipData is accessed
(see b/167676460), which may cause user confusion.

Bug: 167660455
Test: new tests added to ClipDescriptionTest in CTS
Change-Id: I48bea4d11a68b198d60016b364a3cfa0b0bf277e
parent 8ce6b9fb
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment