diff options
author | Dianne Hackborn <hackbod@google.com> | 2010-10-05 17:54:35 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-10-05 17:54:35 -0700 |
commit | 0f8ee7439a0c0487b023f6b150ba0f9986a6cb15 (patch) | |
tree | be28ec6e07623239f219637d4b52fc2332a010a5 /core | |
parent | ecba4f3373bd41d229d857d515227dea94310df1 (diff) | |
parent | 90f4aafa336d9f2f07281ead3c846d323a710015 (diff) | |
download | frameworks_base-0f8ee7439a0c0487b023f6b150ba0f9986a6cb15.zip frameworks_base-0f8ee7439a0c0487b023f6b150ba0f9986a6cb15.tar.gz frameworks_base-0f8ee7439a0c0487b023f6b150ba0f9986a6cb15.tar.bz2 |
Merge "Implement permission granting in clipboard."
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/app/ActivityManagerNative.java | 29 | ||||
-rw-r--r-- | core/java/android/app/IActivityManager.java | 6 | ||||
-rw-r--r-- | core/java/android/content/ClipboardManager.java | 2 | ||||
-rw-r--r-- | core/java/android/content/IClipboard.aidl | 2 |
4 files changed, 36 insertions, 3 deletions
diff --git a/core/java/android/app/ActivityManagerNative.java b/core/java/android/app/ActivityManagerNative.java index b558318..b34c243 100644 --- a/core/java/android/app/ActivityManagerNative.java +++ b/core/java/android/app/ActivityManagerNative.java @@ -1341,6 +1341,18 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM return true; } + case CHECK_GRANT_URI_PERMISSION_TRANSACTION: { + data.enforceInterface(IActivityManager.descriptor); + int callingUid = data.readInt(); + String targetPkg = data.readString(); + Uri uri = Uri.CREATOR.createFromParcel(data); + int modeFlags = data.readInt(); + int res = checkGrantUriPermission(callingUid, targetPkg, uri, modeFlags); + reply.writeNoException(); + reply.writeInt(res); + return true; + } + case DUMP_HEAP_TRANSACTION: { data.enforceInterface(IActivityManager.descriptor); String process = data.readString(); @@ -2998,6 +3010,23 @@ class ActivityManagerProxy implements IActivityManager reply.recycle(); } + public int checkGrantUriPermission(int callingUid, String targetPkg, + Uri uri, int modeFlags) throws RemoteException { + Parcel data = Parcel.obtain(); + Parcel reply = Parcel.obtain(); + data.writeInterfaceToken(IActivityManager.descriptor); + data.writeInt(callingUid); + data.writeString(targetPkg); + uri.writeToParcel(data, 0); + data.writeInt(modeFlags); + mRemote.transact(CHECK_GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0); + reply.readException(); + int res = reply.readInt(); + data.recycle(); + reply.recycle(); + return res; + } + public boolean dumpHeap(String process, boolean managed, String path, ParcelFileDescriptor fd) throws RemoteException { Parcel data = Parcel.obtain(); diff --git a/core/java/android/app/IActivityManager.java b/core/java/android/app/IActivityManager.java index 4d73817..cd229e3 100644 --- a/core/java/android/app/IActivityManager.java +++ b/core/java/android/app/IActivityManager.java @@ -326,6 +326,9 @@ public interface IActivityManager extends IInterface { public void revokeUriPermissionFromOwner(IBinder owner, Uri uri, int mode) throws RemoteException; + public int checkGrantUriPermission(int callingUid, String targetPkg, + Uri uri, int modeFlags) throws RemoteException; + // Cause the specified process to dump the specified heap. public boolean dumpHeap(String process, boolean managed, String path, ParcelFileDescriptor fd) throws RemoteException; @@ -540,5 +543,6 @@ public interface IActivityManager extends IInterface { int NEW_URI_PERMISSION_OWNER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+115; int GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+116; int REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+117; - int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+118; + int CHECK_GRANT_URI_PERMISSION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+118; + int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+119; } diff --git a/core/java/android/content/ClipboardManager.java b/core/java/android/content/ClipboardManager.java index 0ea0648..85a6765 100644 --- a/core/java/android/content/ClipboardManager.java +++ b/core/java/android/content/ClipboardManager.java @@ -108,7 +108,7 @@ public class ClipboardManager extends android.text.ClipboardManager { */ public ClipData getPrimaryClip() { try { - return getService().getPrimaryClip(); + return getService().getPrimaryClip(mContext.getPackageName()); } catch (RemoteException e) { return null; } diff --git a/core/java/android/content/IClipboard.aidl b/core/java/android/content/IClipboard.aidl index 3e1fe55..254901b 100644 --- a/core/java/android/content/IClipboard.aidl +++ b/core/java/android/content/IClipboard.aidl @@ -27,7 +27,7 @@ import android.content.IOnPrimaryClipChangedListener; */ interface IClipboard { void setPrimaryClip(in ClipData clip); - ClipData getPrimaryClip(); + ClipData getPrimaryClip(String pkg); ClipDescription getPrimaryClipDescription(); boolean hasPrimaryClip(); void addPrimaryClipChangedListener(in IOnPrimaryClipChangedListener listener); |