Hi, this is my Android 4.4 based on the development of the Multi-window system, there are a lot of shortcomings, please also advise Ah, the code is all open source.
Video Address
Source Address
Done:
1. The app is displayed in windowed format
Filter by PackageName in PHONEWINDOWMANAGER::LAYOUTWINDOWLW () to make the specified app appear in a non-full-screen size, because an app typically displays multiple activity in a task unit, Therefore, the method of PackageName filtration is adopted.
2. Multiple apps are in Onresume state at the same time
Modify the place in AMS Notification OnPause (), specify that Pkg does not notify pause. The area of activity life cycle control in AMS is to be optimized later.
3. Modify the touch Region of the window
Modify INPUTMONITOR::ADDINPUTWINDOWHANDLELW () so that window intercepts the region of touch event only within the scope of this window.
4. Touch window moves up to the top level of the screen
Add interface to ams,windowsession, intercept touch event in Viewrootimpl, notify WMS, and AMS via windowsession, Move window and task to the top level.
5. Recentactivity boot into the APP stack
Because the visibility switch in the same stack is also better controlled, but if the control is more difficult to switch across the stack, the recentactivity is moved to the app stack to start, so the outgoing recentactivity is When you switch apps, there are no bugs appearing on the display.
6. Add TitleBar to Window
Add TitleBar in Phonewindow::generatelayout (), including close, minimum, maximum, drag area, resize.
Minimum has not yet been implemented, as it also has to do some work to control the activity life cycle with AMS.
7. Add a portal App
The user chooses which app to start in windowed form and registers a custom service in ServiceManager, which stores the pkgs to be windowed and is then called by the framework.
Next Plan:
1. Fix various bugs
The number of bugs just can't bear to look straight ... The key is not familiar with many areas of the source code, so always a piecemeal, foot pain medical teaching.
2. Familiar with AMS control process
Design a reasonable multi-window activity life cycle, complete minimum.