Camera: use wp for NotificationListener
Bug: 30737827
Change-Id: I01b8bee39fe329bf250b9179a84a8928d209a357
diff --git a/services/camera/libcameraservice/common/CameraDeviceBase.h b/services/camera/libcameraservice/common/CameraDeviceBase.h
index 8707f2a..984d84b 100644
--- a/services/camera/libcameraservice/common/CameraDeviceBase.h
+++ b/services/camera/libcameraservice/common/CameraDeviceBase.h
@@ -190,7 +190,7 @@
/**
* Abstract class for HAL notification listeners
*/
- class NotificationListener {
+ class NotificationListener : public virtual RefBase {
public:
// The set of notifications is a merge of the notifications required for
// API1 and API2.
@@ -219,7 +219,7 @@
* Connect HAL notifications to a listener. Overwrites previous
* listener. Set to NULL to stop receiving notifications.
*/
- virtual status_t setNotifyCallback(NotificationListener *listener) = 0;
+ virtual status_t setNotifyCallback(wp<NotificationListener> listener) = 0;
/**
* Whether the device supports calling notifyAutofocus, notifyAutoExposure,