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
Loading
Please register or sign in to comment