Get Calling Pid from HAL on Android 11 (r3)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Get Calling Pid from HAL on Android 11 (r3)

Nguyễn Trung Thành
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

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/7860d177-5200-46ad-8055-12827a5f6c43n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: Get Calling Pid from HAL on Android 11 (r3)

Nguyễn Trung Thành
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.

On Monday, October 19, 2020 at 9:56:55 PM UTC+7 Nguyễn Trung Thành wrote:
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

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/android-platform/915ec33b-434f-4c3b-99cf-95b91de408fan%40googlegroups.com.