launchHomeFromHotKey();
launchHomeFromHotKey 中 laucn Home 的 code:
try {
ActivityManagerNative.getDefault().stopAppSwitches();
} catch (RemoteException e) {
}
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_HOME_KEY);
startDockOrHome();
- stopAppSwitches()
- sendCloseSystemWindows(SYSTEM_DIALOG_REASON_HOME_KEY)
- startDockOrHome()
stopAppSwitches():
好像是停止 app switch 5 sec.
sendCloseSystemWindows(SYSTEM_DIALOG_REASON_HOME_KEY):
是 call :
ActivityManagerNative.getDefault().closeSystemDialogs(reason);
就是把 windws map 叫出來,一個一個 send message:
Message msg = Message.obtain();
msg.what = CLOSE_SYSTEM_DIALOGS;
msg.obj = reason;
sendMessage(msg);
startDockOrHome:
mHomeIntent = new Intent(Intent.ACTION_MAIN, null);
mHomeIntent.addCategory(Intent.CATEGORY_HOME);
mHomeIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK
| Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
........
startActivity(mHomeIntent)
... framework 自己也用 startActivity...
沒有留言:
張貼留言