首先是android层:
PhoneWindow.java 中加入了GestureDetector成员, 来实现全局滑屏手势监听
onFling方法中,调用了mDecor.getRootWindowSession().setOnlyShowInExtendDisplay(mDecor.getWindow(),res);
调用了Session.java的
+ public void setOnlyShowInExtendDisplay(IWindow window,int transit){
+ mService.setOnlyShowInExtendDisplay(this, window,transit);
+ }
调用了WindowManagerService中的,public void setOnlyShowInExtendDisplay(Session session,IWindow client,int transit)
PhoneWindowManager.java中的SettingsObserver中,加入了DisplayShowSynchronizationObserver(也是ContentObserver子类)成员,监听DISPLAY_SHOW_SYNCHRONIZATION设置变化
ContentResolver resolver = mContext.getContentResolver();
resolver.registerContentObserver(Settings.System.getUriFor(Settings.System.DISPLAY_SHOW_SYNCHRONIZATION), false, this);
重载onChange, 调用 mWindowManager.updateDisplayShowSynchronization();