Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99497cd8 authored by Dianne Hackborn's avatar Dianne Hackborn Committed by Android (Google) Code Review
Browse files

Merge "Temporary hack to get rid of new virtuals."

parents 21660981 f2bf93bb
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -90,6 +90,7 @@ int main(int argc, char* const argv[])
    }

    // TODO: block until a result is returned to MyResultReceiver.
    service->shellCommand(STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO, args, new MyResultReceiver());
    IBinder::shellCommand(service, STDIN_FILENO, STDOUT_FILENO, STDERR_FILENO, args,
            new MyResultReceiver());
    return 0;
}
+0 −2
Original line number Diff line number Diff line
@@ -35,8 +35,6 @@ public:
    virtual bool        isBinderAlive() const;
    virtual status_t    pingBinder();
    virtual status_t    dump(int fd, const Vector<String16>& args);
    virtual status_t    shellCommand(int in, int out, int err, Vector<String16>& args,
                                     const sp<IResultReceiver>& resultReceiver);

    virtual status_t    transact(   uint32_t code,
                                    const Parcel& data,
+2 −1
Original line number Diff line number Diff line
@@ -77,7 +77,8 @@ public:
    virtual bool            isBinderAlive() const = 0;
    virtual status_t        pingBinder() = 0;
    virtual status_t        dump(int fd, const Vector<String16>& args) = 0;
    virtual status_t        shellCommand(int in, int out, int err, Vector<String16>& args,
    static  status_t        shellCommand(const sp<IBinder>& target, int in, int out, int err,
                                         Vector<String16>& args,
                                         const sp<IResultReceiver>& resultReceiver);

    virtual status_t        transact(   uint32_t code,
+18 −9
Original line number Diff line number Diff line
@@ -61,16 +61,21 @@ bool IBinder::checkSubclass(const void* /*subclassID*/) const
}


status_t IBinder::shellCommand(int /*in*/, int out, int /*err*/, Vector<String16>& /*args*/,
    const sp<IResultReceiver>& resultReceiver)
status_t IBinder::shellCommand(const sp<IBinder>& target, int in, int out, int err,
    Vector<String16>& args, const sp<IResultReceiver>& resultReceiver)
{
    if (out >= 0) {
        dprintf(out, "Shell commands not supported.\n");
    Parcel send;
    Parcel reply;
    send.writeFileDescriptor(in);
    send.writeFileDescriptor(out);
    send.writeFileDescriptor(err);
    const size_t numArgs = args.size();
    send.writeInt32(numArgs);
    for (size_t i = 0; i < numArgs; i++) {
        send.writeString16(args[i]);
    }
    if (resultReceiver != NULL) {
        resultReceiver->send(INVALID_OPERATION);
    }
    return NO_ERROR;
    send.writeStrongBinder(resultReceiver != NULL ? IInterface::asBinder(resultReceiver) : NULL);
    return target->transact(SHELL_COMMAND_TRANSACTION, send, &reply);
}

// ---------------------------------------------------------------------------
@@ -230,7 +235,11 @@ status_t BBinder::onTransact(
            sp<IResultReceiver> resultReceiver = IResultReceiver::asInterface(
                    data.readStrongBinder());

            return shellCommand(in, out, err, args, resultReceiver);
            // XXX can't add virtuals until binaries are updated.
            //return shellCommand(in, out, err, args, resultReceiver);
            if (resultReceiver != NULL) {
                resultReceiver->send(INVALID_OPERATION);
            }
        }

        case SYSPROPS_TRANSACTION: {
+0 −17
Original line number Diff line number Diff line
@@ -157,23 +157,6 @@ status_t BpBinder::dump(int fd, const Vector<String16>& args)
    return err;
}

status_t BpBinder::shellCommand(int in, int out, int err, Vector<String16>& args,
    const sp<IResultReceiver>& resultReceiver)
{
    Parcel send;
    Parcel reply;
    send.writeFileDescriptor(in);
    send.writeFileDescriptor(out);
    send.writeFileDescriptor(err);
    const size_t numArgs = args.size();
    send.writeInt32(numArgs);
    for (size_t i = 0; i < numArgs; i++) {
        send.writeString16(args[i]);
    }
    send.writeStrongBinder(resultReceiver != NULL ? IInterface::asBinder(resultReceiver) : NULL);
    return transact(SHELL_COMMAND_TRANSACTION, send, &reply);
}

status_t BpBinder::transact(
    uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
{