Loading libs/binder/Parcel.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,11 @@ status_t Parcel::setData(const uint8_t* buffer, size_t len) status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len) { if (parcel->isForRpc() != isForRpc()) { ALOGE("Cannot append Parcel of one format to another."); return BAD_TYPE; } status_t err; const uint8_t *data = parcel->mData; const binder_size_t *objects = parcel->mObjects; Loading libs/binder/include/binder/ActivityManager.h +5 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,11 @@ public: // Flag for registerUidObserver: report uid has become idle UID_OBSERVER_IDLE = 1<<2, // Flag for registerUidObserver: report uid has become active UID_OBSERVER_ACTIVE = 1<<3 UID_OBSERVER_ACTIVE = 1<<3, // Flag for registerUidObserver: report uid cached state has changed UID_OBSERVER_CACHED = 1<<4, // Flag for registerUidObserver: report uid capability has changed UID_OBSERVER_CAPABILITY = 1<<5, }; // PROCESS_STATE_* must come from frameworks/base/core/java/android/app/ProcessStateEnum.aidl. Loading libs/binder/tests/binderRpcTest.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,19 @@ TEST_P(BinderRpc, TransactionsMustBeMarkedRpc) { EXPECT_EQ(BAD_TYPE, proc.rootBinder->transact(IBinder::PING_TRANSACTION, data, &reply, 0)); } TEST_P(BinderRpc, AppendSeparateFormats) { auto proc = createRpcTestSocketServerProcess(1); Parcel p1; p1.markForBinder(proc.rootBinder); p1.writeInt32(3); Parcel p2; EXPECT_EQ(BAD_TYPE, p1.appendFrom(&p2, 0, p2.dataSize())); EXPECT_EQ(BAD_TYPE, p2.appendFrom(&p1, 0, p1.dataSize())); } TEST_P(BinderRpc, UnknownTransaction) { auto proc = createRpcTestSocketServerProcess(1); Parcel data; Loading libs/gui/BLASTBufferQueue.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -204,13 +204,16 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, if (mRequestedSize != newSize) { mRequestedSize.set(newSize); mBufferItemConsumer->setDefaultBufferSize(mRequestedSize.width, mRequestedSize.height); if (mLastBufferScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) { if (mLastBufferInfo.scalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) { // If the buffer supports scaling, update the frame immediately since the client may // want to scale the existing buffer to the new size. mSize = mRequestedSize; t.setFrame(mSurfaceControl, {0, 0, static_cast<int32_t>(mSize.width), static_cast<int32_t>(mSize.height)}); // We only need to update the scale if we've received at least one buffer. The reason // for this is the scale is calculated based on the requested size and buffer size. // If there's no buffer, the scale will always be 1. if (mLastBufferInfo.hasBuffer) { setMatrix(&t, mLastBufferInfo); } applyTransaction = true; } } Loading Loading @@ -374,8 +377,10 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { // Ensure BLASTBufferQueue stays alive until we receive the transaction complete callback. incStrong((void*)transactionCallbackThunk); mLastBufferScalingMode = bufferItem.mScalingMode; mLastAcquiredFrameNumber = bufferItem.mFrameNumber; mLastBufferInfo.update(true /* hasBuffer */, bufferItem.mGraphicBuffer->getWidth(), bufferItem.mGraphicBuffer->getHeight(), bufferItem.mTransform, bufferItem.mScalingMode); auto releaseBufferCallback = std::bind(releaseBufferCallbackThunk, wp<BLASTBufferQueue>(this) /* callbackContext */, Loading @@ -388,8 +393,7 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE); t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this)); t->setFrame(mSurfaceControl, {0, 0, static_cast<int32_t>(mSize.width), static_cast<int32_t>(mSize.height)}); setMatrix(t, mLastBufferInfo); t->setCrop(mSurfaceControl, computeCrop(bufferItem)); t->setTransform(mSurfaceControl, bufferItem.mTransform); t->setTransformToDisplayInverse(mSurfaceControl, bufferItem.mTransformToDisplayInverse); Loading Loading @@ -515,6 +519,17 @@ bool BLASTBufferQueue::rejectBuffer(const BufferItem& item) { return mSize != bufferSize; } void BLASTBufferQueue::setMatrix(SurfaceComposerClient::Transaction* t, const BufferInfo& bufferInfo) { uint32_t bufWidth = bufferInfo.width; uint32_t bufHeight = bufferInfo.height; float dsdx = mSize.width / static_cast<float>(bufWidth); float dsdy = mSize.height / static_cast<float>(bufHeight); t->setMatrix(mSurfaceControl, dsdx, 0, 0, dsdy); } void BLASTBufferQueue::setTransactionCompleteCallback( uint64_t frameNumber, std::function<void(int64_t)>&& transactionCompleteCallback) { std::lock_guard _lock{mMutex}; Loading libs/gui/LayerState.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -459,10 +459,6 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eCropChanged; crop = other.crop; } if (other.what & eFrameChanged) { what |= eFrameChanged; orientedDisplaySpaceRect = other.orientedDisplaySpaceRect; } if (other.what & eBufferChanged) { what |= eBufferChanged; buffer = other.buffer; Loading Loading
libs/binder/Parcel.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -418,6 +418,11 @@ status_t Parcel::setData(const uint8_t* buffer, size_t len) status_t Parcel::appendFrom(const Parcel *parcel, size_t offset, size_t len) { if (parcel->isForRpc() != isForRpc()) { ALOGE("Cannot append Parcel of one format to another."); return BAD_TYPE; } status_t err; const uint8_t *data = parcel->mData; const binder_size_t *objects = parcel->mObjects; Loading
libs/binder/include/binder/ActivityManager.h +5 −1 Original line number Diff line number Diff line Loading @@ -41,7 +41,11 @@ public: // Flag for registerUidObserver: report uid has become idle UID_OBSERVER_IDLE = 1<<2, // Flag for registerUidObserver: report uid has become active UID_OBSERVER_ACTIVE = 1<<3 UID_OBSERVER_ACTIVE = 1<<3, // Flag for registerUidObserver: report uid cached state has changed UID_OBSERVER_CACHED = 1<<4, // Flag for registerUidObserver: report uid capability has changed UID_OBSERVER_CAPABILITY = 1<<5, }; // PROCESS_STATE_* must come from frameworks/base/core/java/android/app/ProcessStateEnum.aidl. Loading
libs/binder/tests/binderRpcTest.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -406,6 +406,19 @@ TEST_P(BinderRpc, TransactionsMustBeMarkedRpc) { EXPECT_EQ(BAD_TYPE, proc.rootBinder->transact(IBinder::PING_TRANSACTION, data, &reply, 0)); } TEST_P(BinderRpc, AppendSeparateFormats) { auto proc = createRpcTestSocketServerProcess(1); Parcel p1; p1.markForBinder(proc.rootBinder); p1.writeInt32(3); Parcel p2; EXPECT_EQ(BAD_TYPE, p1.appendFrom(&p2, 0, p2.dataSize())); EXPECT_EQ(BAD_TYPE, p2.appendFrom(&p1, 0, p1.dataSize())); } TEST_P(BinderRpc, UnknownTransaction) { auto proc = createRpcTestSocketServerProcess(1); Parcel data; Loading
libs/gui/BLASTBufferQueue.cpp +22 −7 Original line number Diff line number Diff line Loading @@ -204,13 +204,16 @@ void BLASTBufferQueue::update(const sp<SurfaceControl>& surface, uint32_t width, if (mRequestedSize != newSize) { mRequestedSize.set(newSize); mBufferItemConsumer->setDefaultBufferSize(mRequestedSize.width, mRequestedSize.height); if (mLastBufferScalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) { if (mLastBufferInfo.scalingMode != NATIVE_WINDOW_SCALING_MODE_FREEZE) { // If the buffer supports scaling, update the frame immediately since the client may // want to scale the existing buffer to the new size. mSize = mRequestedSize; t.setFrame(mSurfaceControl, {0, 0, static_cast<int32_t>(mSize.width), static_cast<int32_t>(mSize.height)}); // We only need to update the scale if we've received at least one buffer. The reason // for this is the scale is calculated based on the requested size and buffer size. // If there's no buffer, the scale will always be 1. if (mLastBufferInfo.hasBuffer) { setMatrix(&t, mLastBufferInfo); } applyTransaction = true; } } Loading Loading @@ -374,8 +377,10 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { // Ensure BLASTBufferQueue stays alive until we receive the transaction complete callback. incStrong((void*)transactionCallbackThunk); mLastBufferScalingMode = bufferItem.mScalingMode; mLastAcquiredFrameNumber = bufferItem.mFrameNumber; mLastBufferInfo.update(true /* hasBuffer */, bufferItem.mGraphicBuffer->getWidth(), bufferItem.mGraphicBuffer->getHeight(), bufferItem.mTransform, bufferItem.mScalingMode); auto releaseBufferCallback = std::bind(releaseBufferCallbackThunk, wp<BLASTBufferQueue>(this) /* callbackContext */, Loading @@ -388,8 +393,7 @@ void BLASTBufferQueue::processNextBufferLocked(bool useNextTransaction) { bufferItem.mFence ? new Fence(bufferItem.mFence->dup()) : Fence::NO_FENCE); t->addTransactionCompletedCallback(transactionCallbackThunk, static_cast<void*>(this)); t->setFrame(mSurfaceControl, {0, 0, static_cast<int32_t>(mSize.width), static_cast<int32_t>(mSize.height)}); setMatrix(t, mLastBufferInfo); t->setCrop(mSurfaceControl, computeCrop(bufferItem)); t->setTransform(mSurfaceControl, bufferItem.mTransform); t->setTransformToDisplayInverse(mSurfaceControl, bufferItem.mTransformToDisplayInverse); Loading Loading @@ -515,6 +519,17 @@ bool BLASTBufferQueue::rejectBuffer(const BufferItem& item) { return mSize != bufferSize; } void BLASTBufferQueue::setMatrix(SurfaceComposerClient::Transaction* t, const BufferInfo& bufferInfo) { uint32_t bufWidth = bufferInfo.width; uint32_t bufHeight = bufferInfo.height; float dsdx = mSize.width / static_cast<float>(bufWidth); float dsdy = mSize.height / static_cast<float>(bufHeight); t->setMatrix(mSurfaceControl, dsdx, 0, 0, dsdy); } void BLASTBufferQueue::setTransactionCompleteCallback( uint64_t frameNumber, std::function<void(int64_t)>&& transactionCompleteCallback) { std::lock_guard _lock{mMutex}; Loading
libs/gui/LayerState.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -459,10 +459,6 @@ void layer_state_t::merge(const layer_state_t& other) { what |= eCropChanged; crop = other.crop; } if (other.what & eFrameChanged) { what |= eFrameChanged; orientedDisplaySpaceRect = other.orientedDisplaySpaceRect; } if (other.what & eBufferChanged) { what |= eBufferChanged; buffer = other.buffer; Loading