Just to follow up with what Joe and Dianne mentioned, I don't think
fiddling with classes inside of com.android.internal.policy.impl is
really a way to support third party keyguards.
You could replace LockPatternKeyguardView with a new implementation /
subclass of KeyguardViewBase, and you would in fact have a different
keyguard, but it is still a far cry from supporting third party lock
screens in the robust we way do for say, the home screen:
- LockPatternKeygaurdView runs in the system process, and therefor any
crash or memory leak has serious implications (runtime restart and
general system slowness respectively)
- because it is just a View, and not and Activity, it has to go
through a lot of extra hoops to transition between screens, handle
orientation changes and the like, the whole KeyguardScreen interface
was created just to manage the complexity of the implementation.
expecting third party developers to do something similar each time is
a lot to ask
- it is trusted to behave with power management and input handling; a
poor implementation could prevent the screen from ever turning on
- etc etc
The bottom line is that the existing implementation is tightly coupled
into the window manager and power management code; it was done with
efficiency and user responsiveness in mind, and there simply wasn't
enough time before launch to get something more safe for third party
extension in place. For instance, you might notice that sometimes the
home screen takes a few seconds to come up when other applications,
such as the browser, have run and caused the home application to be
killed. Would users tolerate this delay for a keyguard? That's what
makes having the usual application responding to intent approach work
well for the keyguard.
Here are some hurdles / requirements I see needing to be met to get to
support third party keyguards:
- the code runs in a different process
- the implementation must respond within a certain amount of time,
otherwise a default keygaurd is brought up
- power management is not put in the hands of the keyguard (whether
the screen turns on, and for how long)
All that said, I commend your ability to dive into the policy.* code
and make sense of it. If you just want to play around with your own
keyguard implementation, implementing your own KeyguardViewbase and
building / flashing your own device would be a good way to start.
Let us know with any ideas for this you come up with, I'm happy to
provide any assitance I can in terms of understanding the existing
code, and / or evaluating ideas.
Karl
On Dec 31 2008, 3:57 am, qvark <
joseluishuertasfernan...@gmail.com>
wrote: