标签

,

1. services/java/com/android/server/SystemServer.java

232             wm = WindowManagerService.main(context, power,
233                     factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL,
234                     !firstBoot, onlyCore);

…..

304         try {
305             wm.displayReady();   
306         } catch (Throwable e) {
307             reportWtf(“making display ready”, e);
308         }

2.wm.displayReady() –> services/java/com/android/server/wm/WindowManagerService.java

6835     public void systemReady() {
6836         mPolicy.systemReady();
6837     }

===>

330     final WindowManagerPolicy mPolicy = PolicyManager.makeNewWindowManager();

3.core/java/com/android/internal/policy/PolicyManager.java

66     public static WindowManagerPolicy makeNewWindowManager() {
67         return sPolicy.makeNewWindowManager();
68     }
===>

32     private static final String POLICY_IMPL_CLASS_NAME =
33         “com.android.internal.policy.impl.Policy”;
34
35     private static final IPolicy sPolicy;
36
37     static {
38         // Pull in the actual implementation of the policy at run-time
39         try {
 40             Class policyClass = Class.forName(POLICY_IMPL_CLASS_NAME);
 41             sPolicy = (IPolicy)policyClass.newInstance();
42         } catch (ClassNotFoundException ex) {
43             throw new RuntimeException(
44                     POLICY_IMPL_CLASS_NAME + ” could not be loaded”, ex);
45         } catch (InstantiationException ex) {
46             throw new RuntimeException(
47                     POLICY_IMPL_CLASS_NAME + ” could not be instantiated”, ex);
48         } catch (IllegalAccessException ex) {
49             throw new RuntimeException(
50                     POLICY_IMPL_CLASS_NAME + ” could not be instantiated”, ex);
51         }
52     }

4.sPolicy.makeNewWindowManager() –> policy/src/com/android/internal/policy/impl/Policy.java

70     public WindowManagerPolicy makeNewWindowManager() {
71         return new PhoneWindowManager();
72     }

5.  OVER

Advertisements