summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2010-12-22 17:37:34 -0800
committerDianne Hackborn <hackbod@google.com>2010-12-22 17:37:34 -0800
commit3b99ede362568a3d213a2b3668126965ad80677e (patch)
tree89fcad237dc05c7dbe6a80410bd8ef4374784420 /services
parent49858741150cc115cc8815085899cbfdfb12d2f3 (diff)
downloadframeworks_base-3b99ede362568a3d213a2b3668126965ad80677e.zip
frameworks_base-3b99ede362568a3d213a2b3668126965ad80677e.tar.gz
frameworks_base-3b99ede362568a3d213a2b3668126965ad80677e.tar.bz2
Fix issue #3299143: Problem report for Hanping Chinese Dictionary Pro
Let's not crash if there is no clip. Change-Id: I295031adf37fdd0997c39a2cffc2c6f602d7694e
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/ClipboardService.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/java/com/android/server/ClipboardService.java b/services/java/com/android/server/ClipboardService.java
index 30ea48c..bec35d1 100644
--- a/services/java/com/android/server/ClipboardService.java
+++ b/services/java/com/android/server/ClipboardService.java
@@ -115,7 +115,7 @@ public class ClipboardService extends IClipboard.Stub {
public ClipDescription getPrimaryClipDescription() {
synchronized (this) {
- return mPrimaryClip.getDescription();
+ return mPrimaryClip != null ? mPrimaryClip.getDescription() : null;
}
}
@@ -211,7 +211,7 @@ public class ClipboardService extends IClipboard.Stub {
} catch (NameNotFoundException e) {
throw new IllegalArgumentException("Unknown package " + pkg, e);
}
- if (!mActivePermissionOwners.contains(pkg)) {
+ if (mPrimaryClip != null && !mActivePermissionOwners.contains(pkg)) {
final int N = mPrimaryClip.getItemCount();
for (int i=0; i<N; i++) {
grantItemLocked(mPrimaryClip.getItem(i), pkg);