start of WindowManagerService
frameworks/base/services/java/com/android/server/SystemServer.java
class ServerThread extends Thread {
......

@Override
public void run() {
......
WindowManagerService wm = null;
......

// Critical services...
try {
......
Slog.i(TAG, "Window Manager");
wm = WindowManagerService.main(context, power,
factoryTest != SystemServer.FACTORY_TEST_LOW_LEVEL);
ServiceManager.addService(Context.WINDOW_SERVICE, wm);

((ActivityManagerService)ServiceManager.getService("activity"))
.setWindowManager(wm);
......
} catch (RuntimeException e) {
Slog.e("System", "Failure starting core service", e);
}

......
}

......
}


frameworks\base\services\java\com\android\server\WindowManagerService.java
public static WindowManagerService main(Context context,
PowerManagerService pm, boolean haveInputMethods) {
WMThread thr = new WMThread(context, pm, haveInputMethods);
thr.start();

synchronized (thr) {
while (thr.mService == null) {
try {
thr.wait();
} catch (InterruptedException e) {
}
}
}

return thr.mService;
}

frameworks\base\core\java\android\os\Looper.java


frameworks\base\services\java\com\android\server\WindowManagerService.java
private WindowManagerService(Context context, PowerManagerService pm,
boolean haveInputMethods) {
mContext = context;
mHaveInputMethods = haveInputMethods;
mLimitedAlphaCompositing = context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_limitedAlpha);

mPowerManager = pm;
mPowerManager.setPolicy(mPolicy);
PowerManager pmc = (PowerManager)context.getSystemService(Context.POWER_SERVICE);
mScreenFrozenLock = pmc.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK,
"SCREEN_FROZEN");
mScreenFrozenLock.setReferenceCounted(false);

mActivityManager = ActivityManagerNative.getDefault();
mBatteryStats = BatteryStatsService.getService();

// Get persisted window scale setting
mWindowAnimationScale = Settings.System.getFloat(context.getContentResolver(),
Settings.System.WINDOW_ANIMATION_SCALE, mWindowAnimationScale);
mTransitionAnimationScale = Settings.System.getFloat(context.getContentResolver(),
Settings.System.TRANSITION_ANIMATION_SCALE, mTransitionAnimationScale);

// Track changes to DevicePolicyManager state so we can enable/disable keyguard.
IntentFilter filter = new IntentFilter();
filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED);
mContext.registerReceiver(mBroadcastReceiver, filter);

mHoldingScreenWakeLock = pmc.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK,
"KEEP_SCREEN_ON_FLAG");
mHoldingScreenWakeLock.setReferenceCounted(false);

mInputManager = new InputManager(context, this);

PolicyThread thr = new PolicyThread(mPolicy, this, context, pm);
thr.start();

synchronized (thr) {
while (!thr.mRunning) {
try {
thr.wait();
} catch (InterruptedException e) {
}
}
}

mInputManager.start();

// Add ourself to the Watchdog monitors.
Watchdog.getInstance().addMonitor(this);
}

frameworks\base\services\java\com\android\server\SystemServer.java
Slog.i(TAG, "Activity Manager");
context = ActivityManagerService.main(factoryTest);

frameworks/base/core/java/android/content/Context.java


mLimitedAlphaCompositing = context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_limitedAlpha);
// to get the config
http://book.51cto.com/art/201207/348776.htm
http://en.wikipedia.org/wiki/Alpha_transparency

frameworks\base\services\java\com\android\server\WindowManagerService.java
mLimitedAlphaCompositing = context.getResources().getBoolean(
com.android.internal.R.bool.config_sf_limitedAlpha);
config_sf_limitedAlpha
Flag indicating whether the surface flinger has limited alpha compositing functionality in hardware.
http://developer.oesf.biz/em/developer/reference/blueberry/com/android/internal/R.bool.html

there should be a java windowmanagerservice and a native windowmanagerservice in the new ARCH. In case native windowmanagerservice needs something from the java service, it can ask the java brother to help.

更多相关文章

  1. 代码中设置drawableleft
  2. android 3.0 隐藏 系统标题栏
  3. Android开发中activity切换动画的实现
  4. Android(安卓)学习 笔记_05. 文件下载
  5. Android中直播视频技术探究之—摄像头Camera视频源数据采集解析
  6. 技术博客汇总
  7. android 2.3 wifi (一)
  8. AndRoid Notification的清空和修改
  9. Android中的Chronometer

随机推荐

  1. shape基本用法及全部属性定义
  2. 深入理解android之IPC机制与Binder框架
  3. Android线程池使用
  4. 在Ubuntu上为Android增加硬件抽象层(HAL)模
  5. Android(安卓)M及以上版本系统 悬浮窗权
  6. android 中管理短信
  7. Android(安卓)之 Handler总结
  8. Android开发之数据存储之二:SQLite数据库
  9. Android(安卓)调试模式工具的Stetho
  10. 【Android】windows下使用android studio