Get Calling Pid from HAL on Android 11 (r3)

362 views
Skip to first unread message

Nguyễn Trung Thành

unread,
Oct 19, 2020, 10:56:55 AM10/19/20
to android-platform
Hello all,

I need to get calling PID from HAL. From code, I call
if (getCurrentServingCall() == BinderCallType::HWBINDER) {
        pid = hardware::IPCThreadState::self()->getCallingPid();
}
else
{
        pid = IPCThreadState::self()->getCallingPid();
}

The code works well on Android 10. However, it always return 0 on Android 11 (r3)

Could you help me to solve the problem?

Regards,
Thanh

Nguyễn Trung Thành

unread,
Oct 27, 2020, 3:02:05 PM10/27/20
to android-platform
I resolved my problem. The problem is occurred due to  I call above code from HAL interface. However, the interface is oneway interface. It seems none PID will be passed to oneway interface. I remove oneway. It works.
Reply all
Reply to author
Forward
0 new messages