am 900b6157
: merge from open-source master
Merge commit '900b6157f5dee2ed7b2c73cf320b2baf293230ff' into kraken * commit '900b6157f5dee2ed7b2c73cf320b2baf293230ff': Only hold a weak pointer on SurfaceComposerClients
This commit is contained in:
committed by
Android Git Automerger
commit
7450c02a35
@ -58,7 +58,7 @@ namespace android {
|
|||||||
// Must not be holding SurfaceComposerClient::mLock when acquiring gLock here.
|
// Must not be holding SurfaceComposerClient::mLock when acquiring gLock here.
|
||||||
static Mutex gLock;
|
static Mutex gLock;
|
||||||
static sp<ISurfaceComposer> gSurfaceManager;
|
static sp<ISurfaceComposer> gSurfaceManager;
|
||||||
static DefaultKeyedVector< sp<IBinder>, sp<SurfaceComposerClient> > gActiveConnections;
|
static DefaultKeyedVector< sp<IBinder>, wp<SurfaceComposerClient> > gActiveConnections;
|
||||||
static SortedVector<sp<SurfaceComposerClient> > gOpenTransactions;
|
static SortedVector<sp<SurfaceComposerClient> > gOpenTransactions;
|
||||||
static sp<IMemoryHeap> gServerCblkMemory;
|
static sp<IMemoryHeap> gServerCblkMemory;
|
||||||
static volatile surface_flinger_cblk_t* gServerCblk;
|
static volatile surface_flinger_cblk_t* gServerCblk;
|
||||||
@ -195,7 +195,7 @@ SurfaceComposerClient::clientForConnection(const sp<IBinder>& conn)
|
|||||||
|
|
||||||
{ // scope for lock
|
{ // scope for lock
|
||||||
Mutex::Autolock _l(gLock);
|
Mutex::Autolock _l(gLock);
|
||||||
client = gActiveConnections.valueFor(conn);
|
client = gActiveConnections.valueFor(conn).promote();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (client == 0) {
|
if (client == 0) {
|
||||||
@ -383,8 +383,8 @@ void SurfaceComposerClient::openGlobalTransaction()
|
|||||||
const size_t N = gActiveConnections.size();
|
const size_t N = gActiveConnections.size();
|
||||||
VERBOSE("openGlobalTransaction (%ld clients)", N);
|
VERBOSE("openGlobalTransaction (%ld clients)", N);
|
||||||
for (size_t i=0; i<N; i++) {
|
for (size_t i=0; i<N; i++) {
|
||||||
sp<SurfaceComposerClient> client(gActiveConnections.valueAt(i));
|
sp<SurfaceComposerClient> client(gActiveConnections.valueAt(i).promote());
|
||||||
if (gOpenTransactions.indexOf(client) < 0) {
|
if (client != 0 && gOpenTransactions.indexOf(client) < 0) {
|
||||||
if (client->openTransaction() == NO_ERROR) {
|
if (client->openTransaction() == NO_ERROR) {
|
||||||
if (gOpenTransactions.add(client) < 0) {
|
if (gOpenTransactions.add(client) < 0) {
|
||||||
// Ooops!
|
// Ooops!
|
||||||
|
Reference in New Issue
Block a user