Android WMS

WindowManagerService

Posted by LXG on July 31, 2020

Activity Window View


public class Activity extends ContextThemeWrapper
        implements LayoutInflater.Factory2,
        Window.Callback, KeyEvent.Callback,
        OnCreateContextMenuListener, ComponentCallbacks2,
        Window.OnWindowDismissedCallback, WindowControllerCallback,
        AutofillManager.AutofillClient {


    private IBinder mToken;


    private Window mWindow;

    final void attach(Context context, ActivityThread aThread,
            Instrumentation instr, IBinder token, int ident,
            Application application, Intent intent, ActivityInfo info,
            CharSequence title, Activity parent, String id,
            NonConfigurationInstances lastNonConfigurationInstances,
            Configuration config, String referrer, IVoiceInteractor voiceInteractor,
            Window window, ActivityConfigCallback activityConfigCallback) {
        attachBaseContext(context);

        mWindow = new PhoneWindow(this, window, activityConfigCallback);

        mToken = token;

    }

}

activity_window

WindowManager WindowManagerImpl WindowManagerGlobal

view_root_impl

下图引用自窗口管理-简书

window_global

AMS App WMS Token

apptoken

AMS_WMS_APP 中Token惟一性-简书

Window 加载视图过程

Window加载视图过程-简书

start_activity_gityuan

wms_add_view

Input ViewRootImpl

ViewRootImpl接收事件-简书

input_viewrootimpl

InputChannel

数据结构

input_channel

事件处理

input_handle