Merge "Fix StrictMode for Binder.dump()" into gingerbread
This commit is contained in:
committed by
Android (Google) Code Review
commit
eacf0ecd00
@@ -226,9 +226,16 @@ public class Binder implements IBinder {
|
|||||||
try {
|
try {
|
||||||
fd.close();
|
fd.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
|
// swallowed, not propagated back to the caller
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Write the StrictMode header.
|
||||||
|
if (reply != null) {
|
||||||
|
reply.writeNoException();
|
||||||
|
} else {
|
||||||
|
StrictMode.clearGatheredViolations();
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -341,12 +348,15 @@ final class BinderProxy implements IBinder {
|
|||||||
|
|
||||||
public void dump(FileDescriptor fd, String[] args) throws RemoteException {
|
public void dump(FileDescriptor fd, String[] args) throws RemoteException {
|
||||||
Parcel data = Parcel.obtain();
|
Parcel data = Parcel.obtain();
|
||||||
|
Parcel reply = Parcel.obtain();
|
||||||
data.writeFileDescriptor(fd);
|
data.writeFileDescriptor(fd);
|
||||||
data.writeStringArray(args);
|
data.writeStringArray(args);
|
||||||
try {
|
try {
|
||||||
transact(DUMP_TRANSACTION, data, null, 0);
|
transact(DUMP_TRANSACTION, data, reply, 0);
|
||||||
|
reply.readException();
|
||||||
} finally {
|
} finally {
|
||||||
data.recycle();
|
data.recycle();
|
||||||
|
reply.recycle();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user