Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 195b5517 authored by Jim Miller's avatar Jim Miller
Browse files

Fix dependency between keyguard/dexopt/AccessibilityManagerService.

This fixes a bug on userdebug builds where dexopt hadn't completed
before the service is needed.  The resulting crash prevented dexopt
from completing, resulting in a reboot loop and perpetual issue starting
the service.

The solution is to hold off on creating keyguard until the system is ready.

It also moves the creation of the AccessibilityManagerService singleton back
into the system process.

Fixes bug 8287106

Change-Id: I96e15c084d38c255fd8f6bca6f21a0785b82ec74
parent 1430193d
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
# Copyright (C) 2010 The Android Open Source Project
# Copyright (C) 2013 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -18,7 +18,14 @@ include $(CLEAR_VARS)

LOCAL_SRC_FILES := $(call all-subdir-java-files) $(call all-subdir-Iaidl-files)

LOCAL_JAVA_LIBRARIES := services

LOCAL_PACKAGE_NAME := Keyguard

LOCAL_CERTIFICATE := platform

LOCAL_PROGUARD_FLAG_FILES := proguard.flags

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))
+2 −0
Original line number Diff line number Diff line
-keep public class com.android.keyguard.KeyguardService
+0 −4
Original line number Diff line number Diff line
@@ -106,10 +106,6 @@ public class KeyguardService extends Service {
            return mKeyguardViewMediator.isDismissable();
        }
        public void onSystemReady() {
            // Tell the accessibility layer that this process will
            // run as the current user, i.e. run across users.
            AccessibilityManager.createAsSharedAcrossUsers(KeyguardService.this);

            mKeyguardViewMediator.onSystemReady();
        }
        public void doKeyguardTimeout(Bundle options) {
+4 −10
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ import android.view.WindowManager;
import android.view.WindowManagerGlobal;
import android.view.WindowManagerPolicy;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;

@@ -820,9 +821,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        mWindowManager = windowManager;
        mWindowManagerFuncs = windowManagerFuncs;
        mHeadless = "1".equals(SystemProperties.get("ro.config.headless", "0"));
        if (!mHeadless) {
            startKeyguard(context);
        }
        mHandler = new PolicyHandler();
        mOrientationListener = new MyOrientationListener(mContext, mHandler);
        try {
@@ -915,10 +913,6 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        }
    }

    private void startKeyguard(Context context) {
        mKeyguardDelegate = new KeyguardServiceDelegate(context, null);
    }

    @Override
    public void setInitialDisplaySize(Display display, int width, int height, int density) {
        if (display.getDisplayId() != Display.DEFAULT_DISPLAY) {
@@ -4172,7 +4166,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    }

    public void dismissKeyguardLw() {
        if (mKeyguardDelegate.isShowing()) {
        if (mKeyguardDelegate != null && mKeyguardDelegate.isShowing()) { 
            mHandler.post(new Runnable() {
                public void run() {
                    if (mKeyguardDelegate.isDismissable()) {
@@ -4421,8 +4415,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {
    
    /** {@inheritDoc} */
    public void systemReady() {
        if (mKeyguardDelegate != null) {
            // tell the keyguard
        if (!mHeadless) {
            mKeyguardDelegate = new KeyguardServiceDelegate(mContext, null);
            mKeyguardDelegate.onSystemReady();
        }
        synchronized (mLock) {