summaryrefslogtreecommitdiff
path: root/libs/binder/include/binder/IInterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/include/binder/IInterface.h')
-rw-r--r--libs/binder/include/binder/IInterface.h28
1 files changed, 5 insertions, 23 deletions
diff --git a/libs/binder/include/binder/IInterface.h b/libs/binder/include/binder/IInterface.h
index 7116154951..ff90b30380 100644
--- a/libs/binder/include/binder/IInterface.h
+++ b/libs/binder/include/binder/IInterface.h
@@ -14,9 +14,7 @@
* limitations under the License.
*/
-//
-#ifndef ANDROID_IINTERFACE_H
-#define ANDROID_IINTERFACE_H
+#pragma once
#include <binder/Binder.h>
@@ -145,11 +143,10 @@ public: \
{ \
::android::sp<I##INTERFACE> intr; \
if (obj != nullptr) { \
- intr = static_cast<I##INTERFACE*>( \
- obj->queryLocalInterface( \
- I##INTERFACE::descriptor).get()); \
+ intr = ::android::sp<I##INTERFACE>::cast( \
+ obj->queryLocalInterface(I##INTERFACE::descriptor)); \
if (intr == nullptr) { \
- intr = new Bp##INTERFACE(obj); \
+ intr = ::android::sp<Bp##INTERFACE>::make(obj); \
} \
} \
return intr; \
@@ -188,7 +185,7 @@ template<typename INTERFACE>
inline sp<IInterface> BnInterface<INTERFACE>::queryLocalInterface(
const String16& _descriptor)
{
- if (_descriptor == INTERFACE::descriptor) return this;
+ if (_descriptor == INTERFACE::descriptor) return sp<IInterface>::fromExisting(this);
return nullptr;
}
@@ -242,23 +239,11 @@ constexpr const char* const kManualInterfaces[] = {
"android.hardware.ICameraRecordingProxyListener",
"android.hardware.ICrypto",
"android.hardware.IOMXObserver",
- "android.hardware.ISoundTrigger",
- "android.hardware.ISoundTriggerClient",
- "android.hardware.ISoundTriggerHwService",
"android.hardware.IStreamListener",
"android.hardware.IStreamSource",
- "android.input.IInputFlinger",
- "android.input.ISetInputWindowsListener",
- "android.media.IAudioFlinger",
- "android.media.IAudioFlingerClient",
- "android.media.IAudioPolicyService",
- "android.media.IAudioPolicyServiceClient",
"android.media.IAudioService",
- "android.media.IAudioTrack",
"android.media.IDataSource",
"android.media.IDrmClient",
- "android.media.IEffect",
- "android.media.IEffectClient",
"android.media.IMediaCodecList",
"android.media.IMediaDrmService",
"android.media.IMediaExtractor",
@@ -282,7 +267,6 @@ constexpr const char* const kManualInterfaces[] = {
"android.os.IComplexTypeInterface",
"android.os.IPermissionController",
"android.os.IPingResponder",
- "android.os.IPowerManager",
"android.os.IProcessInfoService",
"android.os.ISchedulingPolicyService",
"android.os.IStringConstants",
@@ -335,5 +319,3 @@ constexpr bool allowedManualInterface(const char* name) {
} // namespace internal
} // namespace android
-
-#endif // ANDROID_IINTERFACE_H