resolved conflicts for merge of 66d633d2 to master

Change-Id: I6c38d7c4d127954dfca17082215c587a3cd4a586
This commit is contained in:
Dianne Hackborn
2010-08-25 23:14:44 -07:00
9 changed files with 380 additions and 149 deletions

View File

@@ -1248,8 +1248,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
case IS_USER_A_MONKEY_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
reply.writeInt(isUserAMonkey() ? 1 : 0);
boolean areThey = isUserAMonkey();
reply.writeNoException();
reply.writeInt(areThey ? 1 : 0);
return true;
}
@@ -1263,8 +1264,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
case IS_IMMERSIVE_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder token = data.readStrongBinder();
reply.writeInt(isImmersive(token) ? 1 : 0);
boolean isit = isImmersive(token);
reply.writeNoException();
reply.writeInt(isit ? 1 : 0);
return true;
}
@@ -1279,8 +1281,9 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
reply.writeInt(isTopActivityImmersive() ? 1 : 0);
boolean isit = isTopActivityImmersive();
reply.writeNoException();
reply.writeInt(isit ? 1 : 0);
return true;
}
@@ -1294,6 +1297,40 @@ public abstract class ActivityManagerNative extends Binder implements IActivityM
reply.writeNoException();
return true;
}
case NEW_URI_PERMISSION_OWNER_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
String name = data.readString();
IBinder perm = newUriPermissionOwner(name);
reply.writeNoException();
reply.writeStrongBinder(perm);
return true;
}
case GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder owner = data.readStrongBinder();
int fromUid = data.readInt();
String targetPkg = data.readString();
Uri uri = Uri.CREATOR.createFromParcel(data);
int mode = data.readInt();
grantUriPermissionFromOwner(owner, fromUid, targetPkg, uri, mode);
reply.writeNoException();
return true;
}
case REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
IBinder owner = data.readStrongBinder();
Uri uri = null;
if (data.readInt() != 0) {
Uri.CREATOR.createFromParcel(data);
}
int mode = data.readInt();
revokeUriPermissionFromOwner(owner, uri, mode);
reply.writeNoException();
return true;
}
case DUMP_HEAP_TRANSACTION: {
data.enforceInterface(IActivityManager.descriptor);
@@ -2854,8 +2891,8 @@ class ActivityManagerProxy implements IActivityManager
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(token);
mRemote.transact(IS_IMMERSIVE_TRANSACTION, data, reply, 0);
boolean res = reply.readInt() == 1;
reply.readException();
boolean res = reply.readInt() == 1;
data.recycle();
reply.recycle();
return res;
@@ -2867,8 +2904,8 @@ class ActivityManagerProxy implements IActivityManager
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
mRemote.transact(IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION, data, reply, 0);
boolean res = reply.readInt() == 1;
reply.readException();
boolean res = reply.readInt() == 1;
data.recycle();
reply.recycle();
return res;
@@ -2889,6 +2926,55 @@ class ActivityManagerProxy implements IActivityManager
reply.recycle();
}
public IBinder newUriPermissionOwner(String name)
throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeString(name);
mRemote.transact(NEW_URI_PERMISSION_OWNER_TRANSACTION, data, reply, 0);
reply.readException();
IBinder res = reply.readStrongBinder();
data.recycle();
reply.recycle();
return res;
}
public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Uri uri, int mode) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(owner);
data.writeInt(fromUid);
data.writeString(targetPkg);
uri.writeToParcel(data, 0);
data.writeInt(mode);
mRemote.transact(GRANT_URI_PERMISSION_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
int mode) throws RemoteException {
Parcel data = Parcel.obtain();
Parcel reply = Parcel.obtain();
data.writeInterfaceToken(IActivityManager.descriptor);
data.writeStrongBinder(owner);
if (uri != null) {
data.writeInt(1);
uri.writeToParcel(data, 0);
} else {
data.writeInt(0);
}
data.writeInt(mode);
mRemote.transact(REVOKE_URI_PERMISSION_TRANSACTION, data, reply, 0);
reply.readException();
data.recycle();
reply.recycle();
}
public boolean dumpHeap(String process, boolean managed,
String path, ParcelFileDescriptor fd) throws RemoteException {
Parcel data = Parcel.obtain();
@@ -2910,6 +2996,6 @@ class ActivityManagerProxy implements IActivityManager
data.recycle();
return res;
}
private IBinder mRemote;
}

View File

@@ -317,6 +317,12 @@ public interface IActivityManager extends IInterface {
public void crashApplication(int uid, int initialPid, String packageName,
String message) throws RemoteException;
public IBinder newUriPermissionOwner(String name) throws RemoteException;
public void grantUriPermissionFromOwner(IBinder owner, int fromUid, String targetPkg,
Uri uri, int mode) throws RemoteException;
public void revokeUriPermissionFromOwner(IBinder owner, Uri uri,
int mode) throws RemoteException;
// Cause the specified process to dump the specified heap.
public boolean dumpHeap(String process, boolean managed, String path,
@@ -528,5 +534,8 @@ public interface IActivityManager extends IInterface {
int SET_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+111;
int IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+112;
int CRASH_APPLICATION_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+113;
int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+114;
int NEW_URI_PERMISSION_OWNER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+114;
int GRANT_URI_PERMISSION_FROM_OWNER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+115;
int REVOKE_URI_PERMISSION_FROM_OWNER_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+116;
int DUMP_HEAP_TRANSACTION = IBinder.FIRST_CALL_TRANSACTION+117;
}

View File

@@ -435,6 +435,10 @@ public abstract class LayoutInflater {
throw ex;
}
// Told retain static reference on context.
mConstructorArgs[0] = null;
mConstructorArgs[1] = null;
return result;
}
}