Skip to content

Commit 305f37f

Browse files
committed
MultiWindow: Improvement and more
there some bugs show up after merge @2add61e9fdea (Floating window multitasking) PS1: revert following @949706abd7c5 @6334e802e910 PS2: make floating window works together with floating window Thanks Squadzone and OMNI Signed-off-by: hany <hany.alsamman@gmail.com>
1 parent 1763e31 commit 305f37f

7 files changed

Lines changed: 170 additions & 184 deletions

File tree

core/java/android/app/Activity.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2696,9 +2696,7 @@ public boolean dispatchTouchEvent(MotionEvent ev) {
26962696
}
26972697
}
26982698

2699-
int mHaloEnabled = (Settings.System.getInt(getContentResolver(), Settings.System.HALO_ENABLED, 0));
2700-
2701-
if (mIsSplitView && mHaloEnabled != 1) {
2699+
if (mIsSplitView && ev.getAction() == MotionEvent.ACTION_DOWN) {
27022700
IWindowManager wm = (IWindowManager) WindowManagerGlobal.getWindowManagerService();
27032701
try {
27042702
wm.notifyActivityTouched(mToken, false);
@@ -5961,9 +5959,7 @@ final void attach(Context context, ActivityThread aThread,
59615959
mWindowManager = mWindow.getWindowManager();
59625960
mCurrentConfig = config;
59635961

5964-
int mHaloEnabled = (Settings.System.getInt(getContentResolver(), Settings.System.HALO_ENABLED, 0));
5965-
5966-
if ((intent.getFlags() & Intent.FLAG_ACTIVITY_SPLIT_VIEW) != 0 && mHaloEnabled != 1) {
5962+
if (((intent.getFlags() & Intent.FLAG_ACTIVITY_SPLIT_VIEW) != 0) && !mWindow.mIsFloatingWindow) {
59675963
final IWindowManager wm = (IWindowManager) WindowManagerGlobal.getWindowManagerService();
59685964
updateSplitViewMetrics(true);
59695965
}
@@ -6158,7 +6154,10 @@ final void performStart() {
61586154

61596155
final void performRestart() {
61606156
mFragments.noteStateNotSaved();
6161-
updateSplitViewMetrics(false);
6157+
6158+
if (!mWindow.mIsFloatingWindow) {
6159+
updateSplitViewMetrics(false);
6160+
}
61626161

61636162
if (mStopped) {
61646163
mStopped = false;

core/java/android/app/ActivityManagerNative.java

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,7 +1404,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14041404
config.writeToParcel(reply, 0);
14051405
return true;
14061406
}
1407-
1407+
14081408
case PROFILE_CONTROL_TRANSACTION: {
14091409
data.enforceInterface(IActivityManager.descriptor);
14101410
String process = data.readString();
@@ -1419,29 +1419,29 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14191419
reply.writeInt(res ? 1 : 0);
14201420
return true;
14211421
}
1422-
1422+
14231423
case SHUTDOWN_TRANSACTION: {
14241424
data.enforceInterface(IActivityManager.descriptor);
14251425
boolean res = shutdown(data.readInt());
14261426
reply.writeNoException();
14271427
reply.writeInt(res ? 1 : 0);
14281428
return true;
14291429
}
1430-
1430+
14311431
case STOP_APP_SWITCHES_TRANSACTION: {
14321432
data.enforceInterface(IActivityManager.descriptor);
14331433
stopAppSwitches();
14341434
reply.writeNoException();
14351435
return true;
14361436
}
1437-
1437+
14381438
case RESUME_APP_SWITCHES_TRANSACTION: {
14391439
data.enforceInterface(IActivityManager.descriptor);
14401440
resumeAppSwitches();
14411441
reply.writeNoException();
14421442
return true;
14431443
}
1444-
1444+
14451445
case PEEK_SERVICE_TRANSACTION: {
14461446
data.enforceInterface(IActivityManager.descriptor);
14471447
Intent service = Intent.CREATOR.createFromParcel(data);
@@ -1451,7 +1451,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14511451
reply.writeStrongBinder(binder);
14521452
return true;
14531453
}
1454-
1454+
14551455
case START_BACKUP_AGENT_TRANSACTION: {
14561456
data.enforceInterface(IActivityManager.descriptor);
14571457
ApplicationInfo info = ApplicationInfo.CREATOR.createFromParcel(data);
@@ -1478,7 +1478,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14781478
reply.writeNoException();
14791479
return true;
14801480
}
1481-
1481+
14821482
case KILL_APPLICATION_WITH_APPID_TRANSACTION: {
14831483
data.enforceInterface(IActivityManager.descriptor);
14841484
String pkg = data.readString();
@@ -1488,15 +1488,15 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
14881488
reply.writeNoException();
14891489
return true;
14901490
}
1491-
1491+
14921492
case CLOSE_SYSTEM_DIALOGS_TRANSACTION: {
14931493
data.enforceInterface(IActivityManager.descriptor);
14941494
String reason = data.readString();
14951495
closeSystemDialogs(reason);
14961496
reply.writeNoException();
14971497
return true;
14981498
}
1499-
1499+
15001500
case GET_PROCESS_MEMORY_INFO_TRANSACTION: {
15011501
data.enforceInterface(IActivityManager.descriptor);
15021502
int[] pids = data.createIntArray();
@@ -1514,7 +1514,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
15141514
reply.writeNoException();
15151515
return true;
15161516
}
1517-
1517+
15181518
case OVERRIDE_PENDING_TRANSITION_TRANSACTION: {
15191519
data.enforceInterface(IActivityManager.descriptor);
15201520
IBinder token = data.readStrongBinder();
@@ -1525,15 +1525,15 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
15251525
reply.writeNoException();
15261526
return true;
15271527
}
1528-
1528+
15291529
case IS_USER_A_MONKEY_TRANSACTION: {
15301530
data.enforceInterface(IActivityManager.descriptor);
15311531
boolean areThey = isUserAMonkey();
15321532
reply.writeNoException();
15331533
reply.writeInt(areThey ? 1 : 0);
15341534
return true;
15351535
}
1536-
1536+
15371537
case SET_USER_IS_MONKEY_TRANSACTION: {
15381538
data.enforceInterface(IActivityManager.descriptor);
15391539
final boolean monkey = (data.readInt() == 1);
@@ -1584,7 +1584,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
15841584
reply.writeNoException();
15851585
return true;
15861586
}
1587-
1587+
15881588
case IS_TOP_ACTIVITY_IMMERSIVE_TRANSACTION: {
15891589
data.enforceInterface(IActivityManager.descriptor);
15901590
boolean isit = isTopActivityImmersive();
@@ -1731,7 +1731,7 @@ public boolean onTransact(int code, Parcel data, Parcel reply, int flags)
17311731
reply.writeNoException();
17321732
return true;
17331733
}
1734-
1734+
17351735
case SWITCH_USER_TRANSACTION: {
17361736
data.enforceInterface(IActivityManager.descriptor);
17371737
int userid = data.readInt();
@@ -3034,7 +3034,7 @@ public PendingIntent getRunningServiceControlPanel(ComponentName service)
30343034
reply.recycle();
30353035
return res;
30363036
}
3037-
3037+
30383038
public ComponentName startService(IApplicationThread caller, Intent service,
30393039
String resolvedType, int userId) throws RemoteException
30403040
{
@@ -3137,7 +3137,7 @@ public boolean unbindService(IServiceConnection connection) throws RemoteExcepti
31373137
reply.recycle();
31383138
return res;
31393139
}
3140-
3140+
31413141
public void publishService(IBinder token,
31423142
Intent intent, IBinder service) throws RemoteException {
31433143
Parcel data = Parcel.obtain();
@@ -3180,7 +3180,7 @@ public void serviceDoneExecuting(IBinder token, int type, int startId,
31803180
data.recycle();
31813181
reply.recycle();
31823182
}
3183-
3183+
31843184
public IBinder peekService(Intent service, String resolvedType) throws RemoteException {
31853185
Parcel data = Parcel.obtain();
31863186
Parcel reply = Parcel.obtain();
@@ -3502,7 +3502,7 @@ public boolean clearApplicationUserData(final String packageName,
35023502
reply.recycle();
35033503
return res;
35043504
}
3505-
public int checkUriPermission(Uri uri, int pid, int uid, int mode)
3505+
public int checkUriPermission(Uri uri, int pid, int uid, int mode)
35063506
throws RemoteException {
35073507
Parcel data = Parcel.obtain();
35083508
Parcel reply = Parcel.obtain();
@@ -3853,7 +3853,7 @@ public void forceStopPackage(String packageName, int userId) throws RemoteExcept
38533853
data.recycle();
38543854
reply.recycle();
38553855
}
3856-
3856+
38573857
public void getMyMemoryState(ActivityManager.RunningAppProcessInfo outInfo)
38583858
throws RemoteException
38593859
{
@@ -3879,7 +3879,7 @@ public ConfigurationInfo getDeviceConfigurationInfo() throws RemoteException
38793879
data.recycle();
38803880
return res;
38813881
}
3882-
3882+
38833883
public boolean profileControl(String process, int userId, boolean start,
38843884
String path, ParcelFileDescriptor fd, int profileType) throws RemoteException
38853885
{
@@ -3904,7 +3904,7 @@ public boolean profileControl(String process, int userId, boolean start,
39043904
data.recycle();
39053905
return res;
39063906
}
3907-
3907+
39083908
public boolean shutdown(int timeout) throws RemoteException
39093909
{
39103910
Parcel data = Parcel.obtain();
@@ -3918,7 +3918,7 @@ public boolean shutdown(int timeout) throws RemoteException
39183918
data.recycle();
39193919
return res;
39203920
}
3921-
3921+
39223922
public void stopAppSwitches() throws RemoteException {
39233923
Parcel data = Parcel.obtain();
39243924
Parcel reply = Parcel.obtain();
@@ -3928,7 +3928,7 @@ public void stopAppSwitches() throws RemoteException {
39283928
reply.recycle();
39293929
data.recycle();
39303930
}
3931-
3931+
39323932
public void resumeAppSwitches() throws RemoteException {
39333933
Parcel data = Parcel.obtain();
39343934
Parcel reply = Parcel.obtain();
@@ -3938,7 +3938,7 @@ public void resumeAppSwitches() throws RemoteException {
39383938
reply.recycle();
39393939
data.recycle();
39403940
}
3941-
3941+
39423942
public void killApplicationWithAppId(String pkg, int appid, String reason)
39433943
throws RemoteException {
39443944
Parcel data = Parcel.obtain();
@@ -3952,7 +3952,7 @@ public void killApplicationWithAppId(String pkg, int appid, String reason)
39523952
data.recycle();
39533953
reply.recycle();
39543954
}
3955-
3955+
39563956
public void closeSystemDialogs(String reason) throws RemoteException {
39573957
Parcel data = Parcel.obtain();
39583958
Parcel reply = Parcel.obtain();
@@ -3963,7 +3963,7 @@ public void closeSystemDialogs(String reason) throws RemoteException {
39633963
data.recycle();
39643964
reply.recycle();
39653965
}
3966-
3966+
39673967
public Debug.MemoryInfo[] getProcessMemoryInfo(int[] pids)
39683968
throws RemoteException {
39693969
Parcel data = Parcel.obtain();
@@ -3989,7 +3989,7 @@ public void killApplicationProcess(String processName, int uid) throws RemoteExc
39893989
data.recycle();
39903990
reply.recycle();
39913991
}
3992-
3992+
39933993
public void overridePendingTransition(IBinder token, String packageName,
39943994
int enterAnim, int exitAnim) throws RemoteException {
39953995
Parcel data = Parcel.obtain();
@@ -4004,7 +4004,7 @@ public void overridePendingTransition(IBinder token, String packageName,
40044004
data.recycle();
40054005
reply.recycle();
40064006
}
4007-
4007+
40084008
public boolean isUserAMonkey() throws RemoteException {
40094009
Parcel data = Parcel.obtain();
40104010
Parcel reply = Parcel.obtain();
@@ -4223,7 +4223,7 @@ public boolean dumpHeap(String process, int userId, boolean managed,
42234223
data.recycle();
42244224
return res;
42254225
}
4226-
4226+
42274227
public int startActivities(IApplicationThread caller, String callingPackage,
42284228
Intent[] intents, String[] resolvedTypes, IBinder resultTo,
42294229
Bundle options, int userId) throws RemoteException {

core/java/android/inputmethodservice/InputMethodService.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -969,13 +969,12 @@ public void updateFullscreenMode() {
969969
boolean fullScreenOverride = Settings.System.getIntForUser(getContentResolver(),
970970
Settings.System.DISABLE_FULLSCREEN_KEYBOARD, 0,
971971
UserHandle.USER_CURRENT_OR_SELF) != 0;
972-
boolean isFullscreen;
973-
int mHaloEnabled = (Settings.System.getInt(getContentResolver(), Settings.System.HALO_ENABLED, 0));
974972

973+
boolean isFullscreen;
975974
if (fullScreenOverride) {
976975
isFullscreen = false;
977976
} else {
978-
isFullscreen = (mHaloEnabled != 1) ? (onEvaluateFullscreenMode() || onEvaluateSplitView()) : mShowInputRequested && onEvaluateFullscreenMode();
977+
isFullscreen = mShowInputRequested && (onEvaluateFullscreenMode() || onEvaluateSplitView());
979978
}
980979

981980
boolean changed = mLastShowInputRequested != mShowInputRequested;

packages/SystemUI/res/menu/recent_popup_menu.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
<item android:id="@+id/recent_inspect_item" android:title="@string/status_bar_recent_inspect_item_title" />
2323
<item android:id="@+id/recent_force_stop" android:title="@string/advanced_dev_option_force_stop" />
2424
<item android:id="@+id/recent_launch_floating" android:title="@string/status_bar_recent_floating_item_title" />
25+
<item android:id="@+id/recent_add_split_view" android:title="@string/status_bar_recent_add_to_split_view" />
2526
<item android:id="@+id/recent_wipe_app" android:title="@string/advanced_dev_option_wipe_app" />
2627
<item android:id="@+id/recent_lock_item" android:title="@string/status_bar_recent_lock_item_title" />
2728
</menu>

0 commit comments

Comments
 (0)