Loading cmds/keystore/keystore.c +6 −5 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ * user-defined password. To keep things simple, buffers are always larger than * the maximum space we needed, so boundary checks on buffers are omitted. */ #define KEY_SIZE 120 #define KEY_SIZE ((NAME_MAX - 15) / 2) #define VALUE_SIZE 32768 #define PASSWORD_SIZE VALUE_SIZE Loading Loading @@ -442,10 +442,11 @@ static struct user { uid_t euid; uint32_t perms; } users[] = { {AID_SYSTEM, 0, ~GET}, {AID_SYSTEM, ~0, ~GET}, {AID_VPN, AID_SYSTEM, GET}, {AID_WIFI, AID_SYSTEM, GET}, {0, 0, TEST | GET | INSERT | DELETE | EXIST | SAW}, {AID_ROOT, AID_SYSTEM, GET}, {~0, ~0, TEST | GET | INSERT | DELETE | EXIST | SAW}, }; static int8_t process(int8_t code) { Loading @@ -453,7 +454,7 @@ static int8_t process(int8_t code) { struct action *action = actions; int i; while (user->uid && user->uid != uid) { while (~user->uid && user->uid != uid) { ++user; } while (action->code && action->code != code) { Loading @@ -468,7 +469,7 @@ static int8_t process(int8_t code) { if (action->state && action->state != state) { return state; } if (user->euid) { if (~user->euid) { uid = user->euid; } for (i = 0; i < MAX_PARAM && action->lengths[i]; ++i) { Loading libs/audioflinger/AudioPolicyManagerBase.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -1290,7 +1290,7 @@ void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy, u a2dpOutputDesc->changeRefCount((AudioSystem::stream_type)i,-refCount); } } // do not change newDevice is it was already set before this call by a previous call to // do not change newDevice if it was already set before this call by a previous call to // getNewDevice() or checkOutputForStrategy() for a strategy with higher priority if (newDevice == 0 && hwOutputDesc->isUsedByStrategy(strategy)) { newDevice = getDeviceForStrategy(strategy, false); Loading Loading @@ -1466,6 +1466,12 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, case STRATEGY_MEDIA: { uint32_t device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; } if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; } #ifdef WITH_A2DP if (mA2dpOutput != 0) { if (strategy == STRATEGY_SONIFICATION && !a2dpUsedForSonification()) { Loading @@ -1482,12 +1488,6 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, } } #endif if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; } if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; } if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER; } Loading libs/surfaceflinger/Layer.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -156,7 +156,11 @@ void Layer::reloadTexture(const Region& dirty) if (mFlags & DisplayHardware::DIRECT_TEXTURE) { if (buffer->usage & GraphicBuffer::USAGE_HW_TEXTURE) { if (mTextures[index].dirty) { initializeEglImage(buffer, &mTextures[index]); if (initializeEglImage(buffer, &mTextures[index]) != NO_ERROR) { // not sure what we can do here... mFlags &= ~DisplayHardware::DIRECT_TEXTURE; goto slowpath; } } } else { if (mHybridBuffer==0 || (mHybridBuffer->width != buffer->width || Loading @@ -166,8 +170,13 @@ void Layer::reloadTexture(const Region& dirty) buffer->width, buffer->height, buffer->format, GraphicBuffer::USAGE_SW_WRITE_OFTEN | GraphicBuffer::USAGE_HW_TEXTURE); initializeEglImage( mHybridBuffer, &mTextures[0]); if (initializeEglImage( mHybridBuffer, &mTextures[0]) != NO_ERROR) { // not sure what we can do here... mFlags &= ~DisplayHardware::DIRECT_TEXTURE; mHybridBuffer.clear(); goto slowpath; } } GGLSurface t; Loading Loading @@ -236,6 +245,7 @@ void Layer::reloadTexture(const Region& dirty) } else #endif { slowpath: for (size_t i=0 ; i<NUM_BUFFERS ; i++) { mTextures[i].image = EGL_NO_IMAGE_KHR; } Loading libs/surfaceflinger/LayerBase.cpp +4 −8 Original line number Diff line number Diff line Loading @@ -666,22 +666,15 @@ status_t LayerBase::initializeEglImage( dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)clientBuf, attrs); LOGE_IF(texture->image == EGL_NO_IMAGE_KHR, "eglCreateImageKHR() failed. err=0x%4x", eglGetError()); if (texture->image != EGL_NO_IMAGE_KHR) { glBindTexture(GL_TEXTURE_2D, texture->name); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)texture->image); GLint error = glGetError(); if (UNLIKELY(error != GL_NO_ERROR)) { // this failed, for instance, because we don't support NPOT. // FIXME: do something! LOGE("layer=%p, glEGLImageTargetTexture2DOES(%p) " "failed err=0x%04x", this, texture->image, error); mFlags &= ~DisplayHardware::DIRECT_TEXTURE; err = INVALID_OPERATION; } else { // Everything went okay! Loading @@ -691,6 +684,8 @@ status_t LayerBase::initializeEglImage( texture->height = clientBuf->height; } } else { LOGE("layer=%p, eglCreateImageKHR() failed. err=0x%4x", this, eglGetError()); err = INVALID_OPERATION; } return err; Loading @@ -704,7 +699,8 @@ int32_t LayerBaseClient::sIdentity = 0; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i) : LayerBase(flinger, display), lcblk(NULL), client(client), mIndex(i), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) mDebug(false), mIndex(i), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { lcblk = new SharedBufferServer( client->ctrlblk, i, NUM_BUFFERS, Loading libs/surfaceflinger/LayerBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,9 @@ public: friend class Surface; protected: mutable bool mDebug; private: int32_t mIndex; mutable Mutex mLock; Loading Loading
cmds/keystore/keystore.c +6 −5 Original line number Diff line number Diff line Loading @@ -46,7 +46,7 @@ * user-defined password. To keep things simple, buffers are always larger than * the maximum space we needed, so boundary checks on buffers are omitted. */ #define KEY_SIZE 120 #define KEY_SIZE ((NAME_MAX - 15) / 2) #define VALUE_SIZE 32768 #define PASSWORD_SIZE VALUE_SIZE Loading Loading @@ -442,10 +442,11 @@ static struct user { uid_t euid; uint32_t perms; } users[] = { {AID_SYSTEM, 0, ~GET}, {AID_SYSTEM, ~0, ~GET}, {AID_VPN, AID_SYSTEM, GET}, {AID_WIFI, AID_SYSTEM, GET}, {0, 0, TEST | GET | INSERT | DELETE | EXIST | SAW}, {AID_ROOT, AID_SYSTEM, GET}, {~0, ~0, TEST | GET | INSERT | DELETE | EXIST | SAW}, }; static int8_t process(int8_t code) { Loading @@ -453,7 +454,7 @@ static int8_t process(int8_t code) { struct action *action = actions; int i; while (user->uid && user->uid != uid) { while (~user->uid && user->uid != uid) { ++user; } while (action->code && action->code != code) { Loading @@ -468,7 +469,7 @@ static int8_t process(int8_t code) { if (action->state && action->state != state) { return state; } if (user->euid) { if (~user->euid) { uid = user->euid; } for (i = 0; i < MAX_PARAM && action->lengths[i]; ++i) { Loading
libs/audioflinger/AudioPolicyManagerBase.cpp +7 −7 Original line number Diff line number Diff line Loading @@ -1290,7 +1290,7 @@ void AudioPolicyManagerBase::checkOutputForStrategy(routing_strategy strategy, u a2dpOutputDesc->changeRefCount((AudioSystem::stream_type)i,-refCount); } } // do not change newDevice is it was already set before this call by a previous call to // do not change newDevice if it was already set before this call by a previous call to // getNewDevice() or checkOutputForStrategy() for a strategy with higher priority if (newDevice == 0 && hwOutputDesc->isUsedByStrategy(strategy)) { newDevice = getDeviceForStrategy(strategy, false); Loading Loading @@ -1466,6 +1466,12 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, case STRATEGY_MEDIA: { uint32_t device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_AUX_DIGITAL; if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; } if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; } #ifdef WITH_A2DP if (mA2dpOutput != 0) { if (strategy == STRATEGY_SONIFICATION && !a2dpUsedForSonification()) { Loading @@ -1482,12 +1488,6 @@ uint32_t AudioPolicyManagerBase::getDeviceForStrategy(routing_strategy strategy, } } #endif if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADPHONE; } if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_WIRED_HEADSET; } if (device2 == 0) { device2 = mAvailableOutputDevices & AudioSystem::DEVICE_OUT_SPEAKER; } Loading
libs/surfaceflinger/Layer.cpp +13 −3 Original line number Diff line number Diff line Loading @@ -156,7 +156,11 @@ void Layer::reloadTexture(const Region& dirty) if (mFlags & DisplayHardware::DIRECT_TEXTURE) { if (buffer->usage & GraphicBuffer::USAGE_HW_TEXTURE) { if (mTextures[index].dirty) { initializeEglImage(buffer, &mTextures[index]); if (initializeEglImage(buffer, &mTextures[index]) != NO_ERROR) { // not sure what we can do here... mFlags &= ~DisplayHardware::DIRECT_TEXTURE; goto slowpath; } } } else { if (mHybridBuffer==0 || (mHybridBuffer->width != buffer->width || Loading @@ -166,8 +170,13 @@ void Layer::reloadTexture(const Region& dirty) buffer->width, buffer->height, buffer->format, GraphicBuffer::USAGE_SW_WRITE_OFTEN | GraphicBuffer::USAGE_HW_TEXTURE); initializeEglImage( mHybridBuffer, &mTextures[0]); if (initializeEglImage( mHybridBuffer, &mTextures[0]) != NO_ERROR) { // not sure what we can do here... mFlags &= ~DisplayHardware::DIRECT_TEXTURE; mHybridBuffer.clear(); goto slowpath; } } GGLSurface t; Loading Loading @@ -236,6 +245,7 @@ void Layer::reloadTexture(const Region& dirty) } else #endif { slowpath: for (size_t i=0 ; i<NUM_BUFFERS ; i++) { mTextures[i].image = EGL_NO_IMAGE_KHR; } Loading
libs/surfaceflinger/LayerBase.cpp +4 −8 Original line number Diff line number Diff line Loading @@ -666,22 +666,15 @@ status_t LayerBase::initializeEglImage( dpy, EGL_NO_CONTEXT, EGL_NATIVE_BUFFER_ANDROID, (EGLClientBuffer)clientBuf, attrs); LOGE_IF(texture->image == EGL_NO_IMAGE_KHR, "eglCreateImageKHR() failed. err=0x%4x", eglGetError()); if (texture->image != EGL_NO_IMAGE_KHR) { glBindTexture(GL_TEXTURE_2D, texture->name); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, (GLeglImageOES)texture->image); GLint error = glGetError(); if (UNLIKELY(error != GL_NO_ERROR)) { // this failed, for instance, because we don't support NPOT. // FIXME: do something! LOGE("layer=%p, glEGLImageTargetTexture2DOES(%p) " "failed err=0x%04x", this, texture->image, error); mFlags &= ~DisplayHardware::DIRECT_TEXTURE; err = INVALID_OPERATION; } else { // Everything went okay! Loading @@ -691,6 +684,8 @@ status_t LayerBase::initializeEglImage( texture->height = clientBuf->height; } } else { LOGE("layer=%p, eglCreateImageKHR() failed. err=0x%4x", this, eglGetError()); err = INVALID_OPERATION; } return err; Loading @@ -704,7 +699,8 @@ int32_t LayerBaseClient::sIdentity = 0; LayerBaseClient::LayerBaseClient(SurfaceFlinger* flinger, DisplayID display, const sp<Client>& client, int32_t i) : LayerBase(flinger, display), lcblk(NULL), client(client), mIndex(i), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) mDebug(false), mIndex(i), mIdentity(uint32_t(android_atomic_inc(&sIdentity))) { lcblk = new SharedBufferServer( client->ctrlblk, i, NUM_BUFFERS, Loading
libs/surfaceflinger/LayerBase.h +3 −0 Original line number Diff line number Diff line Loading @@ -369,6 +369,9 @@ public: friend class Surface; protected: mutable bool mDebug; private: int32_t mIndex; mutable Mutex mLock; Loading