Hi, you should probably post this on android-porting where I believe the
engineer who works on it posts.

If it helps, the call to the remote service causes a dup of the fd at that
point, so the client would only close the fd it received, not globally close
it for all processes.

On Wed, Apr 1, 2009 at 4:10 PM, Huaka‘i Po <[email protected]> wrote:

>
> Hi all,
> is the file descriptor in SensorManager.java global to all threads?
>
> In setting up the event dispatch thread for sensor events, there is a
> call
> ParcelFileDescriptor fd = service.getDataChanel();
> getDataChanel() eventually winds up calling open_data_source in the
> sensor framework, which returns an open Linux fd.  Then the code
> instantiates a new thread with a SensorThreadRunnable, part of which
> is here:
>
> private class SensorThreadRunnable implements Runnable {
>  private ParcelFileDescriptor mSensorDataFd;
>  SensorThreadRunnable(ParcelFileDescriptor fd) {
>    mSensorDataFd = fd;
>  }
> ...
>
> The run() method of SensorThreadRunnable later closes mSensorDataFd.
> Does that close the original fd returned by getDataChanel?  (i.e. is
> the fd the same one in both threads, or are the semantics more like dup
> () because of the Parcel stuff?)
>
> Thanks,
> Hod
> >
>


-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support.  All such questions should be posted on public
forums, where I and others can see and answer them.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to