Keyguard

来源:互联网 发布:医疗网络咨询培训 编辑:程序博客网 时间:2024/05/22 06:38


frameworks\base\core\java\com\android\internal\policy\IKeyguardService.aidl


frameworks\base\core\java\com\android\internal\policy\IKeyguardDrawnCallback.aidl

oneway interface IKeyguardDrawnCallback {    void onDrawn();}


frameworks\base\packages\SystemUI\src\com\android\systemui\keyguard\KeyguardViewMediator.java

* Mediates requests related to the keyguard.  This includes queries about the* state of the keyguard, power management events that effect whether the keyguard* should be shown or reset, callbacks to the phone window manager to notify* it of when the keyguard is showing, and events from the keyguard view itself* stating that the keyguard was succesfully unlocked.

.....


frameworks\base\packages\Keyguard\src\com\android\keyguard\KeyguardUpdateMonitorCallback.java

/** * Callback for general information relevant to lock screen. */public class KeyguardUpdateMonitorCallback {


frameworks\base\packages\SystemUI\src\com\android\systemui\keyguard\KeyguardService.java

public class KeyguardService extends Service {    static final String TAG = "KeyguardService";    static final String PERMISSION = android.Manifest.permission.CONTROL_KEYGUARD;    private KeyguardViewMediator mKeyguardViewMediator;
    private final IKeyguardService.Stub mBinder = new IKeyguardService.Stub() {}
private IKeyguardDrawnCallback mDrawnCallback;private boolean mIsPerUserLock;KeyguardUpdateMonitorCallback mUpdateCallback = new KeyguardUpdateMonitorCallback() {

/** * Used to keep the device awake while to ensure the keyguard finishes opening before * we sleep. */private PowerManager.WakeLock mShowKeyguardWakeLock;private StatusBarKeyguardViewManager mStatusBarKeyguardViewManager;

KeyguardService 实现了IKeyguardService 客户端接口,其实是通过 mKeyguardViewMediator 对应接口实现的。
frameworks\base\packages\SystemUI\AndroidManifest.xml
<service    android:name=".keyguard.KeyguardService"    android:exported="true"    android:enabled="@bool/config_enableKeyguardService" />
frameworks\base\packages\SystemUI\src\com\android\systemui\statusbar\phone\StatusBarKeyguardViewManager.java
/** * Manages creating, showing, hiding and resetting the keyguard within the status bar. Calls back * via {@link ViewMediatorCallback} to poke the wake lock and report that the keyguard is done, * which is in turn, reported to this class by the current * {@link com.android.keyguard.KeyguardViewBase}. */public class StatusBarKeyguardViewManager implements RemoteInputController.Callback {

原创粉丝点击