onServiceConnected not called by chance when boot is completed.

55 views
Skip to first unread message

yf...@mobvoi.com

unread,
Aug 2, 2016, 11:43:48 PM8/2/16
to android-platform
I found that when binding services at  booting or just after boot finished, there's a chance that onServiceConnected will not get called, such as KeyguardServiceDelegate will not work due to KeyguardService not calling onServiceConnected, or AmbietService(android wear code) will not work when executing onDreamStarted in DreamService.

Does anybody got the same problem? I'v looking around on internet but seems go nothing useful.

asys...@163.com

unread,
Aug 4, 2016, 10:28:00 AM8/4/16
to android-platform
in KeyguardServiceDelegate.java    what log can you  get?

    public void bindService(Context context) {
        Intent intent = new Intent();
        intent.setClassName(KEYGUARD_PACKAGE, KEYGUARD_CLASS);
        if (!context.bindServiceAsUser(intent, mKeyguardConnection,
                Context.BIND_AUTO_CREATE, UserHandle.OWNER)) {
            Log.v(TAG, "*** Keyguard: can't bind to " + KEYGUARD_CLASS);
            mKeyguardState.showing = false;
            mKeyguardState.showingAndNotOccluded = false;
            mKeyguardState.secure = false;
            mKeyguardState.deviceHasKeyguard = false;
            hideScrim();
        } else {
            if (DEBUG) Log.v(TAG, "*** Keyguard started");
        }
    }

在 2016年8月3日星期三 UTC+8上午11:43:48,yf...@mobvoi.com写道:

yf...@mobvoi.com

unread,
Aug 8, 2016, 10:55:12 AM8/8/16
to android-platform
onServiceConnected not called and no more log was print by KeyguardServiceDelegate, my guess is that keyguardService is not create successfully, but I cannot find any log or messages.
Reply all
Reply to author
Forward
0 new messages