libgui: Format IDisplayEventConnection
Applies the framework default .clang-format and does a bit of tidying
up (reflowing comments to 100 characters, reordering includes, etc.).
Test: libgui_tests + manual testing
Change-Id: I8b3515339a93dbe42ce4421cb561b78ed2fe9104
diff --git a/include/gui/IDisplayEventConnection.h b/include/gui/IDisplayEventConnection.h
index 848368c..6512adb 100644
--- a/include/gui/IDisplayEventConnection.h
+++ b/include/gui/IDisplayEventConnection.h
@@ -14,26 +14,21 @@
* limitations under the License.
*/
-#ifndef ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
-#define ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
-
-#include <stdint.h>
-#include <sys/types.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
+#pragma once
#include <binder/IInterface.h>
+#include <utils/Errors.h>
+
+#include <sys/types.h>
+#include <cstdint>
+
namespace android {
-// ----------------------------------------------------------------------------
class BitTube;
-class IDisplayEventConnection : public IInterface
-{
+class IDisplayEventConnection : public IInterface {
public:
-
DECLARE_META_INTERFACE(DisplayEventConnection)
/*
@@ -42,32 +37,22 @@
virtual sp<BitTube> getDataChannel() const = 0;
/*
- * setVsyncRate() sets the vsync event delivery rate. A value of
- * 1 returns every vsync events. A value of 2 returns every other events,
- * etc... a value of 0 returns no event unless requestNextVsync() has
- * been called.
+ * setVsyncRate() sets the vsync event delivery rate. A value of 1 returns every vsync event.
+ * A value of 2 returns every other event, etc. A value of 0 returns no event unless
+ * requestNextVsync() has been called.
*/
virtual void setVsyncRate(uint32_t count) = 0;
/*
- * requestNextVsync() schedules the next vsync event. It has no effect
- * if the vsync rate is > 0.
+ * requestNextVsync() schedules the next vsync event. It has no effect if the vsync rate is > 0.
*/
- virtual void requestNextVsync() = 0; // asynchronous
+ virtual void requestNextVsync() = 0; // Asynchronous
};
-// ----------------------------------------------------------------------------
-
-class BnDisplayEventConnection : public BnInterface<IDisplayEventConnection>
-{
+class BnDisplayEventConnection : public BnInterface<IDisplayEventConnection> {
public:
- virtual status_t onTransact( uint32_t code,
- const Parcel& data,
- Parcel* reply,
- uint32_t flags = 0);
+ virtual status_t onTransact(uint32_t code, const Parcel& data, Parcel* reply,
+ uint32_t flags = 0);
};
-// ----------------------------------------------------------------------------
-}; // namespace android
-
-#endif // ANDROID_GUI_IDISPLAY_EVENT_CONNECTION_H
+} // namespace android
diff --git a/libs/gui/IDisplayEventConnection.cpp b/libs/gui/IDisplayEventConnection.cpp
index e5c3c48..4d2d7e9 100644
--- a/libs/gui/IDisplayEventConnection.cpp
+++ b/libs/gui/IDisplayEventConnection.cpp
@@ -14,38 +14,24 @@
* limitations under the License.
*/
-#include <stdint.h>
-
-#include <utils/Errors.h>
-#include <utils/RefBase.h>
-
-#include <binder/Parcel.h>
-
#include <gui/IDisplayEventConnection.h>
#include <private/gui/BitTube.h>
+#include <binder/Parcel.h>
+
namespace android {
-// ----------------------------------------------------------------------------
-enum {
- GET_DATA_CHANNEL = IBinder::FIRST_CALL_TRANSACTION,
- SET_VSYNC_RATE,
- REQUEST_NEXT_VSYNC
-};
+enum { GET_DATA_CHANNEL = IBinder::FIRST_CALL_TRANSACTION, SET_VSYNC_RATE, REQUEST_NEXT_VSYNC };
-class BpDisplayEventConnection : public BpInterface<IDisplayEventConnection>
-{
+class BpDisplayEventConnection : public BpInterface<IDisplayEventConnection> {
public:
explicit BpDisplayEventConnection(const sp<IBinder>& impl)
- : BpInterface<IDisplayEventConnection>(impl)
- {
- }
+ : BpInterface<IDisplayEventConnection>(impl) {}
virtual ~BpDisplayEventConnection();
- virtual sp<BitTube> getDataChannel() const
- {
+ virtual sp<BitTube> getDataChannel() const {
Parcel data, reply;
data.writeInterfaceToken(IDisplayEventConnection::getInterfaceDescriptor());
remote()->transact(GET_DATA_CHANNEL, data, &reply);
@@ -66,18 +52,15 @@
}
};
-// Out-of-line virtual method definition to trigger vtable emission in this
-// translation unit (see clang warning -Wweak-vtables)
+// Out-of-line virtual method definition to trigger vtable emission in this translation unit (see
+// clang warning -Wweak-vtables)
BpDisplayEventConnection::~BpDisplayEventConnection() {}
IMPLEMENT_META_INTERFACE(DisplayEventConnection, "android.gui.DisplayEventConnection");
-// ----------------------------------------------------------------------------
-
-status_t BnDisplayEventConnection::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags)
-{
- switch(code) {
+status_t BnDisplayEventConnection::onTransact(uint32_t code, const Parcel& data, Parcel* reply,
+ uint32_t flags) {
+ switch (code) {
case GET_DATA_CHANNEL: {
CHECK_INTERFACE(IDisplayEventConnection, data, reply);
sp<BitTube> channel(getDataChannel());
@@ -98,5 +81,4 @@
return BBinder::onTransact(code, data, reply, flags);
}
-// ----------------------------------------------------------------------------
-}; // namespace android
+} // namespace android