[repost, got an error while sending]

You can do that if you control the entire device obviously.

However, apps are lifecycle managed (they will get stopped and restarted
depending on the system's needs) and if you need to keep consistent
hardware state across the system's lifetime, apps are the wrong way to
go. The other thing you can do is set an app's "persistent" flag to
"true" in its manifest. The Phone app also provides a system service in
this fashion. In that case, the app will always be kept up by the
activity manager. If you plan on making many devices based on Android,
though, the HAL approach is the "clean" way to do it. It's, obviously,
all a case-by-case thing. Also, if you put your hw-driving code in an
app, you'll also need to make sure privileges are properly set to the
/dev/ entry to allow access only to that app, the "system service"
paradigm is much better adapted for that.

-- 
Karim Yaghmour
CEO - Opersys inc. / www.opersys.com
http://twitter.com/karimyaghmour


On 12-07-10 11:19 AM, Alvin Wong wrote:
> Is it possible to only expose `/dev/foo` from the driver and in the
> app it opens `/dev/foo` to perform read/write operations? This seems
> to be saving a lot of work.
>
> Karim Yaghmour於 2012年7月10日星期二UTC+8上午9時54分27秒寫道:
>
>
>     Given the recent questions/discussions regarding how the HAL works
>     and/or how to extend it, I've written a blog post that explains this:
>     http://www.opersys.com/blog/extending-android-hal
>     <http://www.opersys.com/blog/extending-android-hal>
>
>     Have a look within the blog for links to the related github code.
>
>     -- 
>     Karim Yaghmour
>     CEO - Opersys inc. / www.opersys.com <http://www.opersys.com>
>     http://twitter.com/karimyaghmour <http://twitter.com/karimyaghmour>
>
> -- 
> unsubscribe: android-porting+unsubscr...@googlegroups.com
> website: http://groups.google.com/group/android-porting


-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to