summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorMarco Nelissen <marcone@google.com>2014-11-17 18:52:56 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-11-17 18:52:56 +0000
commite12cfc23b2399ded0cc4608e47c5ba864fc5ab7d (patch)
treefc9a48a13cd024ae51fd0175e796c1ecf6713bf3 /services
parent36ec7a8b99e287d923bfacd2ef69661818aeb85e (diff)
parent55f71bc0800b9ec7a779c5d30d5a90e074c2526b (diff)
downloadframeworks_native-e12cfc23b2399ded0cc4608e47c5ba864fc5ab7d.zip
frameworks_native-e12cfc23b2399ded0cc4608e47c5ba864fc5ab7d.tar.gz
frameworks_native-e12cfc23b2399ded0cc4608e47c5ba864fc5ab7d.tar.bz2
am 55f71bc0: Merge "Replace IInterface::asBinder() with a static"
* commit '55f71bc0800b9ec7a779c5d30d5a90e074c2526b': Replace IInterface::asBinder() with a static
Diffstat (limited to 'services')
-rw-r--r--services/batteryservice/IBatteryPropertiesRegistrar.cpp4
-rw-r--r--services/surfaceflinger/MonitoredProducer.cpp4
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp20
3 files changed, 13 insertions, 15 deletions
diff --git a/services/batteryservice/IBatteryPropertiesRegistrar.cpp b/services/batteryservice/IBatteryPropertiesRegistrar.cpp
index 296bfab..46934e0 100644
--- a/services/batteryservice/IBatteryPropertiesRegistrar.cpp
+++ b/services/batteryservice/IBatteryPropertiesRegistrar.cpp
@@ -34,14 +34,14 @@ public:
void registerListener(const sp<IBatteryPropertiesListener>& listener) {
Parcel data;
data.writeInterfaceToken(IBatteryPropertiesRegistrar::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(REGISTER_LISTENER, data, NULL);
}
void unregisterListener(const sp<IBatteryPropertiesListener>& listener) {
Parcel data;
data.writeInterfaceToken(IBatteryPropertiesRegistrar::getInterfaceDescriptor());
- data.writeStrongBinder(listener->asBinder());
+ data.writeStrongBinder(IInterface::asBinder(listener));
remote()->transact(UNREGISTER_LISTENER, data, NULL);
}
diff --git a/services/surfaceflinger/MonitoredProducer.cpp b/services/surfaceflinger/MonitoredProducer.cpp
index 8739682..37a044e 100644
--- a/services/surfaceflinger/MonitoredProducer.cpp
+++ b/services/surfaceflinger/MonitoredProducer.cpp
@@ -49,7 +49,7 @@ MonitoredProducer::~MonitoredProducer() {
wp<IBinder> mProducer;
};
- mFlinger->postMessageAsync(new MessageCleanUpList(mFlinger, asBinder()));
+ mFlinger->postMessageAsync(new MessageCleanUpList(mFlinger, asBinder(this)));
}
status_t MonitoredProducer::requestBuffer(int slot, sp<GraphicBuffer>* buf) {
@@ -111,7 +111,7 @@ void MonitoredProducer::allocateBuffers(bool async, uint32_t width,
}
IBinder* MonitoredProducer::onAsBinder() {
- return mProducer->asBinder().get();
+ return IInterface::asBinder(mProducer).get();
}
// ---------------------------------------------------------------------------
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 7d6d7c2..1060b09 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -496,7 +496,7 @@ size_t SurfaceFlinger::getMaxViewportDims() const {
bool SurfaceFlinger::authenticateSurfaceTexture(
const sp<IGraphicBufferProducer>& bufferProducer) const {
Mutex::Autolock _l(mStateLock);
- sp<IBinder> surfaceTextureBinder(bufferProducer->asBinder());
+ sp<IBinder> surfaceTextureBinder(IInterface::asBinder(bufferProducer));
return mGraphicBufferProducerList.indexOf(surfaceTextureBinder) >= 0;
}
@@ -1276,10 +1276,8 @@ void SurfaceFlinger::handleTransactionLocked(uint32_t transactionFlags)
// this display is in both lists. see if something changed.
const DisplayDeviceState& state(curr[j]);
const wp<IBinder>& display(curr.keyAt(j));
- const sp<IBinder> state_binder =
- state.surface != NULL ? state.surface->asBinder() : NULL;
- const sp<IBinder> draw_binder =
- draw[i].surface != NULL ? draw[i].surface->asBinder() : NULL;
+ const sp<IBinder> state_binder = IInterface::asBinder(state.surface);
+ const sp<IBinder> draw_binder = IInterface::asBinder(draw[i].surface);
if (state_binder != draw_binder) {
// changing the surface is like destroying and
// recreating the DisplayDevice, so we just remove it
@@ -1928,7 +1926,7 @@ void SurfaceFlinger::addClientLayer(const sp<Client>& client,
// add this layer to the current state list
Mutex::Autolock _l(mStateLock);
mCurrentState.layersSortedByZ.add(lbc);
- mGraphicBufferProducerList.add(gbc->asBinder());
+ mGraphicBufferProducerList.add(IInterface::asBinder(gbc));
}
status_t SurfaceFlinger::removeLayer(const sp<Layer>& layer) {
@@ -2001,7 +1999,7 @@ void SurfaceFlinger::setTransactionState(
// NOTE: it would be better to use RTTI as we could directly check
// that we have a Client*. however, RTTI is disabled in Android.
if (s.client != NULL) {
- sp<IBinder> binder = s.client->asBinder();
+ sp<IBinder> binder = IInterface::asBinder(s.client);
if (binder != NULL) {
String16 desc(binder->getInterfaceDescriptor());
if (desc == ISurfaceComposerClient::descriptor) {
@@ -2048,7 +2046,7 @@ uint32_t SurfaceFlinger::setDisplayStateLocked(const DisplayState& s)
if (disp.isValid()) {
const uint32_t what = s.what;
if (what & DisplayState::eSurfaceChanged) {
- if (disp.surface->asBinder() != s.surface->asBinder()) {
+ if (IInterface::asBinder(disp.surface) != IInterface::asBinder(s.surface)) {
disp.surface = s.surface;
flags |= eDisplayTransactionNeeded;
}
@@ -2939,7 +2937,7 @@ class GraphicProducerWrapper : public BBinder, public MessageHandler {
// Prevent reads below from happening before the read from Message
atomic_thread_fence(memory_order_acquire);
if (what == MSG_API_CALL) {
- result = impl->asBinder()->transact(code, data[0], reply);
+ result = IInterface::asBinder(impl)->transact(code, data[0], reply);
barrier.open();
} else if (what == MSG_EXIT) {
exitRequested = true;
@@ -2989,7 +2987,7 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display,
// if we have secure windows on this display, never allow the screen capture
// unless the producer interface is local (i.e.: we can take a screenshot for
// ourselves).
- if (!producer->asBinder()->localBinder()) {
+ if (!IInterface::asBinder(producer)->localBinder()) {
Mutex::Autolock _l(mStateLock);
sp<const DisplayDevice> hw(getDisplayDevice(display));
if (hw->getSecureLayerVisible()) {
@@ -3053,7 +3051,7 @@ status_t SurfaceFlinger::captureScreen(const sp<IBinder>& display,
result = flinger->captureScreenImplLocked(hw, producer,
sourceCrop, reqWidth, reqHeight, minLayerZ, maxLayerZ,
useIdentityTransform, rotation);
- static_cast<GraphicProducerWrapper*>(producer->asBinder().get())->exit(result);
+ static_cast<GraphicProducerWrapper*>(IInterface::asBinder(producer).get())->exit(result);
return true;
}
};