OSDN Git Service

Add explicit method to clear clipboard.
authorJeff Sharkey <jsharkey@android.com>
Sun, 25 Feb 2018 21:43:27 +0000 (14:43 -0700)
committerJeff Sharkey <jsharkey@android.com>
Mon, 26 Feb 2018 21:43:11 +0000 (14:43 -0700)
commitd60e07f04fc85f21fe357930c84c90ec666a7c6e
treed485bf645a6a3aecf4d018450e9ad0ecef9412f0
parentd0f517b9df46926d803c7d9963c70791b2af1c01
Add explicit method to clear clipboard.

Fix several bugs along the way:

-- Clipboard permissions weren't being revoked for related users
when a new primary clip was set.
-- checkGrantUriPermissionLocked() wasn't checking to see if an
otherwise-open provider requires permissions on specific paths.
-- When granting Uri permissions for clipboard data, we need to
include the real source UID for the grant; we no longer allow the
system UID to source grants, to avoid confused deputy problems.
-- Use the Handler passed into ClipboardManager constructor so
it lives on the right thread.

Test: cts-tradefed run commandAndExit cts-dev -m CtsContentTestCases -t android.content.cts.ClipboardManagerTest
Test: cts-tradefed run commandAndExit cts-dev -m CtsAppSecurityHostTestCases -t android.appsecurity.cts.AppSecurityTests
Bug: 7171112273797203
Change-Id: I99315035efc0c6a90471c279311294dc86766c8d
api/current.txt
core/java/android/content/ClipboardManager.java
core/java/android/content/IClipboard.aidl
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/clipboard/ClipboardService.java