From 4217f8ecfe8f884288104262000275c1633b983e Mon Sep 17 00:00:00 2001 From: Dianne Hackborn Date: Mon, 30 Oct 2017 14:31:41 -0700 Subject: Update shell open command to have a mode. We need to open files for reading sometimes, so now we can. Test: manual Change-Id: If089c1e7a4aac1d85784e070d2fccb04b9d84391 --- libs/binder/IShellCallback.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'libs/binder/IShellCallback.cpp') diff --git a/libs/binder/IShellCallback.cpp b/libs/binder/IShellCallback.cpp index c793df3266..23b83a6a0b 100644 --- a/libs/binder/IShellCallback.cpp +++ b/libs/binder/IShellCallback.cpp @@ -39,11 +39,13 @@ public: { } - virtual int openOutputFile(const String16& path, const String16& seLinuxContext) { + virtual int openFile(const String16& path, const String16& seLinuxContext, + const String16& mode) { Parcel data, reply; data.writeInterfaceToken(IShellCallback::getInterfaceDescriptor()); data.writeString16(path); data.writeString16(seLinuxContext); + data.writeString16(mode); remote()->transact(OP_OPEN_OUTPUT_FILE, data, &reply, 0); reply.readExceptionCode(); int fd = reply.readParcelFileDescriptor(); @@ -64,7 +66,8 @@ status_t BnShellCallback::onTransact( CHECK_INTERFACE(IShellCallback, data, reply); String16 path(data.readString16()); String16 seLinuxContext(data.readString16()); - int fd = openOutputFile(path, seLinuxContext); + String16 mode(data.readString16()); + int fd = openFile(path, seLinuxContext, mode); if (reply != NULL) { reply->writeNoException(); if (fd >= 0) { -- cgit v1.2.3-59-g8ed1b