summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-09-29 22:28:13 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-09-29 22:28:13 +0000
commit6b5e5773b793e4419d28609c4b08da0240109e2d (patch)
treef8b9730742131791cfd06f4eb33f01e381380746
parentfb30ca641af9a0bdf77592cc836dbdb145d507e7 (diff)
parenta49f121fda433e838fcae356fc2098f95ee25420 (diff)
downloadbase-6b5e5773b793e4419d28609c4b08da0240109e2d.tar.gz
Merge cherrypicks of [2986367] into oc-dr3-releaseandroid-8.0.0_r27
Change-Id: I95a3b7b6db107bdfde258f86e4f694c481661000
-rw-r--r--services/core/java/com/android/server/clipboard/ClipboardService.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/services/core/java/com/android/server/clipboard/ClipboardService.java b/services/core/java/com/android/server/clipboard/ClipboardService.java
index efc930ebf8ea..db72c5e4cbab 100644
--- a/services/core/java/com/android/server/clipboard/ClipboardService.java
+++ b/services/core/java/com/android/server/clipboard/ClipboardService.java
@@ -20,7 +20,6 @@ import android.app.ActivityManager;
import android.app.AppGlobals;
import android.app.AppOpsManager;
import android.app.IActivityManager;
-import android.app.KeyguardManager;
import android.content.ClipData;
import android.content.ClipDescription;
import android.content.ContentProvider;
@@ -305,7 +304,7 @@ public class ClipboardService extends SystemService {
public ClipData getPrimaryClip(String pkg) {
synchronized (this) {
if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, pkg,
- Binder.getCallingUid()) || isDeviceLocked()) {
+ Binder.getCallingUid())) {
return null;
}
addActiveOwnerLocked(Binder.getCallingUid(), pkg);
@@ -317,7 +316,7 @@ public class ClipboardService extends SystemService {
public ClipDescription getPrimaryClipDescription(String callingPackage) {
synchronized (this) {
if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
- Binder.getCallingUid()) || isDeviceLocked()) {
+ Binder.getCallingUid())) {
return null;
}
PerUserClipboard clipboard = getClipboard();
@@ -329,7 +328,7 @@ public class ClipboardService extends SystemService {
public boolean hasPrimaryClip(String callingPackage) {
synchronized (this) {
if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
- Binder.getCallingUid()) || isDeviceLocked()) {
+ Binder.getCallingUid())) {
return false;
}
return getClipboard().primaryClip != null;
@@ -356,7 +355,7 @@ public class ClipboardService extends SystemService {
public boolean hasClipboardText(String callingPackage) {
synchronized (this) {
if (!clipboardAccessAllowed(AppOpsManager.OP_READ_CLIPBOARD, callingPackage,
- Binder.getCallingUid()) || isDeviceLocked()) {
+ Binder.getCallingUid())) {
return false;
}
PerUserClipboard clipboard = getClipboard();
@@ -434,12 +433,6 @@ public class ClipboardService extends SystemService {
}
}
- private boolean isDeviceLocked() {
- final KeyguardManager keyguardManager = getContext().getSystemService(
- KeyguardManager.class);
- return keyguardManager != null && keyguardManager.isDeviceLocked();
- }
-
private final void checkUriOwnerLocked(Uri uri, int uid) {
if (!"content".equals(uri.getScheme())) {
return;