Loading core/jni/android_os_HwRemoteBinder.cpp +3 −16 Original line number Diff line number Diff line Loading @@ -269,22 +269,9 @@ jobject JHwRemoteBinder::NewObject( return obj; } JHwRemoteBinder::JHwRemoteBinder( JNIEnv *env, jobject thiz, const sp<hardware::IBinder> &binder) : mBinder(binder) { mDeathRecipientList = new HwBinderDeathRecipientList(); jclass clazz = env->GetObjectClass(thiz); CHECK(clazz != NULL); mObject = env->NewWeakGlobalRef(thiz); } JHwRemoteBinder::~JHwRemoteBinder() { JNIEnv *env = AndroidRuntime::getJNIEnv(); env->DeleteWeakGlobalRef(mObject); mObject = NULL; } JHwRemoteBinder::JHwRemoteBinder(JNIEnv* env, jobject /* thiz */, const sp<hardware::IBinder>& binder) : mBinder(binder), mDeathRecipientList(new HwBinderDeathRecipientList()) {} sp<hardware::IBinder> JHwRemoteBinder::getBinder() const { return mBinder; Loading core/jni/android_os_HwRemoteBinder.h +6 −7 Original line number Diff line number Diff line Loading @@ -36,9 +36,13 @@ class HwBinderDeathRecipientList : public RefBase { std::vector<sp<HwBinderDeathRecipient>> mList; Mutex mLock; protected: ~HwBinderDeathRecipientList() override; public: HwBinderDeathRecipientList(); ~HwBinderDeathRecipientList(); explicit HwBinderDeathRecipientList(); DISALLOW_COPY_AND_ASSIGN(HwBinderDeathRecipientList); void add(const sp<HwBinderDeathRecipient>& recipient); void remove(const sp<HwBinderDeathRecipient>& recipient); Loading Loading @@ -66,12 +70,7 @@ struct JHwRemoteBinder : public RefBase { void setBinder(const sp<hardware::IBinder> &binder); sp<HwBinderDeathRecipientList> getDeathRecipientList() const; protected: virtual ~JHwRemoteBinder(); private: jobject mObject; sp<hardware::IBinder> mBinder; sp<HwBinderDeathRecipientList> mDeathRecipientList; DISALLOW_COPY_AND_ASSIGN(JHwRemoteBinder); Loading Loading
core/jni/android_os_HwRemoteBinder.cpp +3 −16 Original line number Diff line number Diff line Loading @@ -269,22 +269,9 @@ jobject JHwRemoteBinder::NewObject( return obj; } JHwRemoteBinder::JHwRemoteBinder( JNIEnv *env, jobject thiz, const sp<hardware::IBinder> &binder) : mBinder(binder) { mDeathRecipientList = new HwBinderDeathRecipientList(); jclass clazz = env->GetObjectClass(thiz); CHECK(clazz != NULL); mObject = env->NewWeakGlobalRef(thiz); } JHwRemoteBinder::~JHwRemoteBinder() { JNIEnv *env = AndroidRuntime::getJNIEnv(); env->DeleteWeakGlobalRef(mObject); mObject = NULL; } JHwRemoteBinder::JHwRemoteBinder(JNIEnv* env, jobject /* thiz */, const sp<hardware::IBinder>& binder) : mBinder(binder), mDeathRecipientList(new HwBinderDeathRecipientList()) {} sp<hardware::IBinder> JHwRemoteBinder::getBinder() const { return mBinder; Loading
core/jni/android_os_HwRemoteBinder.h +6 −7 Original line number Diff line number Diff line Loading @@ -36,9 +36,13 @@ class HwBinderDeathRecipientList : public RefBase { std::vector<sp<HwBinderDeathRecipient>> mList; Mutex mLock; protected: ~HwBinderDeathRecipientList() override; public: HwBinderDeathRecipientList(); ~HwBinderDeathRecipientList(); explicit HwBinderDeathRecipientList(); DISALLOW_COPY_AND_ASSIGN(HwBinderDeathRecipientList); void add(const sp<HwBinderDeathRecipient>& recipient); void remove(const sp<HwBinderDeathRecipient>& recipient); Loading Loading @@ -66,12 +70,7 @@ struct JHwRemoteBinder : public RefBase { void setBinder(const sp<hardware::IBinder> &binder); sp<HwBinderDeathRecipientList> getDeathRecipientList() const; protected: virtual ~JHwRemoteBinder(); private: jobject mObject; sp<hardware::IBinder> mBinder; sp<HwBinderDeathRecipientList> mDeathRecipientList; DISALLOW_COPY_AND_ASSIGN(JHwRemoteBinder); Loading