Loading libs/common_time/ICommonClock.cpp +64 −19 Original line number Diff line number Diff line Loading @@ -48,10 +48,13 @@ class BpCommonClock : public BpInterface<ICommonClock> status_t status = remote()->transact(IS_COMMON_TIME_VALID, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *valid = reply.readInt32(); *timelineID = reply.readInt32(); } } return status; } Loading @@ -62,9 +65,12 @@ class BpCommonClock : public BpInterface<ICommonClock> data.writeInt64(commonTime); status_t status = remote()->transact(COMMON_TIME_TO_LOCAL_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *localTime = reply.readInt64(); } } return status; } Loading @@ -75,9 +81,12 @@ class BpCommonClock : public BpInterface<ICommonClock> data.writeInt64(localTime); status_t status = remote()->transact(LOCAL_TIME_TO_COMMON_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *commonTime = reply.readInt64(); } } return status; } Loading @@ -85,9 +94,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_COMMON_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *commonTime = reply.readInt64(); } } return status; } Loading @@ -95,9 +107,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_COMMON_FREQ, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *freq = reply.readInt64(); } } return status; } Loading @@ -105,9 +120,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_LOCAL_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *localTime = reply.readInt64(); } } return status; } Loading @@ -115,9 +133,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_LOCAL_FREQ, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *freq = reply.readInt64(); } } return status; } Loading @@ -126,7 +147,14 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); return remote()->transact(REGISTER_LISTENER, data, &reply); status_t status = remote()->transact(REGISTER_LISTENER, data, &reply); if (status == OK) { status = reply.readInt32(); } return status; } virtual status_t unregisterListener( Loading @@ -134,7 +162,13 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); return remote()->transact(UNREGISTER_LISTENER, data, &reply); status_t status = remote()->transact(UNREGISTER_LISTENER, data, &reply); if (status == OK) { status = reply.readInt32(); } return status; } }; Loading @@ -150,11 +184,12 @@ status_t BnCommonClock::onTransact(uint32_t code, bool valid; uint32_t timelineID; status_t status = isCommonTimeValid(&valid, &timelineID); reply->writeInt32(status); if (status == OK) { reply->writeInt32(valid); reply->writeInt32(timelineID); } return status; return OK; } break; case COMMON_TIME_TO_LOCAL_TIME: { Loading @@ -162,10 +197,11 @@ status_t BnCommonClock::onTransact(uint32_t code, int64_t commonTime = data.readInt64(); int64_t localTime; status_t status = commonTimeToLocalTime(commonTime, &localTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(localTime); } return status; return OK; } break; case LOCAL_TIME_TO_COMMON_TIME: { Loading @@ -173,64 +209,73 @@ status_t BnCommonClock::onTransact(uint32_t code, int64_t localTime = data.readInt64(); int64_t commonTime; status_t status = localTimeToCommonTime(localTime, &commonTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(commonTime); } return status; return OK; } break; case GET_COMMON_TIME: { CHECK_INTERFACE(ICommonClock, data, reply); int64_t commonTime; status_t status = getCommonTime(&commonTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(commonTime); } return status; return OK; } break; case GET_COMMON_FREQ: { CHECK_INTERFACE(ICommonClock, data, reply); uint64_t freq; status_t status = getCommonFreq(&freq); reply->writeInt32(status); if (status == OK) { reply->writeInt64(freq); } return status; return OK; } break; case GET_LOCAL_TIME: { CHECK_INTERFACE(ICommonClock, data, reply); int64_t localTime; status_t status = getLocalTime(&localTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(localTime); } return status; return OK; } break; case GET_LOCAL_FREQ: { CHECK_INTERFACE(ICommonClock, data, reply); uint64_t freq; status_t status = getLocalFreq(&freq); reply->writeInt32(status); if (status == OK) { reply->writeInt64(freq); } return status; return OK; } break; case REGISTER_LISTENER: { CHECK_INTERFACE(ICommonClock, data, reply); sp<ICommonClockListener> listener = interface_cast<ICommonClockListener>(data.readStrongBinder()); return registerListener(listener); status_t status = registerListener(listener); reply->writeInt32(status); return OK; } break; case UNREGISTER_LISTENER: { CHECK_INTERFACE(ICommonClock, data, reply); sp<ICommonClockListener> listener = interface_cast<ICommonClockListener>(data.readStrongBinder()); return unregisterListener(listener); status_t status = unregisterListener(listener); reply->writeInt32(status); return OK; } break; } return BBinder::onTransact(code, data, reply, flags); Loading Loading
libs/common_time/ICommonClock.cpp +64 −19 Original line number Diff line number Diff line Loading @@ -48,10 +48,13 @@ class BpCommonClock : public BpInterface<ICommonClock> status_t status = remote()->transact(IS_COMMON_TIME_VALID, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *valid = reply.readInt32(); *timelineID = reply.readInt32(); } } return status; } Loading @@ -62,9 +65,12 @@ class BpCommonClock : public BpInterface<ICommonClock> data.writeInt64(commonTime); status_t status = remote()->transact(COMMON_TIME_TO_LOCAL_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *localTime = reply.readInt64(); } } return status; } Loading @@ -75,9 +81,12 @@ class BpCommonClock : public BpInterface<ICommonClock> data.writeInt64(localTime); status_t status = remote()->transact(LOCAL_TIME_TO_COMMON_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *commonTime = reply.readInt64(); } } return status; } Loading @@ -85,9 +94,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_COMMON_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *commonTime = reply.readInt64(); } } return status; } Loading @@ -95,9 +107,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_COMMON_FREQ, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *freq = reply.readInt64(); } } return status; } Loading @@ -105,9 +120,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_LOCAL_TIME, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *localTime = reply.readInt64(); } } return status; } Loading @@ -115,9 +133,12 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); status_t status = remote()->transact(GET_LOCAL_FREQ, data, &reply); if (status == OK) { status = reply.readInt32(); if (status == OK) { *freq = reply.readInt64(); } } return status; } Loading @@ -126,7 +147,14 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); return remote()->transact(REGISTER_LISTENER, data, &reply); status_t status = remote()->transact(REGISTER_LISTENER, data, &reply); if (status == OK) { status = reply.readInt32(); } return status; } virtual status_t unregisterListener( Loading @@ -134,7 +162,13 @@ class BpCommonClock : public BpInterface<ICommonClock> Parcel data, reply; data.writeInterfaceToken(ICommonClock::getInterfaceDescriptor()); data.writeStrongBinder(listener->asBinder()); return remote()->transact(UNREGISTER_LISTENER, data, &reply); status_t status = remote()->transact(UNREGISTER_LISTENER, data, &reply); if (status == OK) { status = reply.readInt32(); } return status; } }; Loading @@ -150,11 +184,12 @@ status_t BnCommonClock::onTransact(uint32_t code, bool valid; uint32_t timelineID; status_t status = isCommonTimeValid(&valid, &timelineID); reply->writeInt32(status); if (status == OK) { reply->writeInt32(valid); reply->writeInt32(timelineID); } return status; return OK; } break; case COMMON_TIME_TO_LOCAL_TIME: { Loading @@ -162,10 +197,11 @@ status_t BnCommonClock::onTransact(uint32_t code, int64_t commonTime = data.readInt64(); int64_t localTime; status_t status = commonTimeToLocalTime(commonTime, &localTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(localTime); } return status; return OK; } break; case LOCAL_TIME_TO_COMMON_TIME: { Loading @@ -173,64 +209,73 @@ status_t BnCommonClock::onTransact(uint32_t code, int64_t localTime = data.readInt64(); int64_t commonTime; status_t status = localTimeToCommonTime(localTime, &commonTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(commonTime); } return status; return OK; } break; case GET_COMMON_TIME: { CHECK_INTERFACE(ICommonClock, data, reply); int64_t commonTime; status_t status = getCommonTime(&commonTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(commonTime); } return status; return OK; } break; case GET_COMMON_FREQ: { CHECK_INTERFACE(ICommonClock, data, reply); uint64_t freq; status_t status = getCommonFreq(&freq); reply->writeInt32(status); if (status == OK) { reply->writeInt64(freq); } return status; return OK; } break; case GET_LOCAL_TIME: { CHECK_INTERFACE(ICommonClock, data, reply); int64_t localTime; status_t status = getLocalTime(&localTime); reply->writeInt32(status); if (status == OK) { reply->writeInt64(localTime); } return status; return OK; } break; case GET_LOCAL_FREQ: { CHECK_INTERFACE(ICommonClock, data, reply); uint64_t freq; status_t status = getLocalFreq(&freq); reply->writeInt32(status); if (status == OK) { reply->writeInt64(freq); } return status; return OK; } break; case REGISTER_LISTENER: { CHECK_INTERFACE(ICommonClock, data, reply); sp<ICommonClockListener> listener = interface_cast<ICommonClockListener>(data.readStrongBinder()); return registerListener(listener); status_t status = registerListener(listener); reply->writeInt32(status); return OK; } break; case UNREGISTER_LISTENER: { CHECK_INTERFACE(ICommonClock, data, reply); sp<ICommonClockListener> listener = interface_cast<ICommonClockListener>(data.readStrongBinder()); return unregisterListener(listener); status_t status = unregisterListener(listener); reply->writeInt32(status); return OK; } break; } return BBinder::onTransact(code, data, reply, flags); Loading