Loading quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -69,8 +69,8 @@ public class UiFactory { } } public static void onLauncherStateOrFocusChanged(Launcher launcher) { public static void onLauncherStateOrFocusChanged(Launcher launcher) { OverviewInteractionState.setBackButtonVisible(launcher, !launcher.isInState(NORMAL) OverviewInteractionState.setBackButtonVisible(launcher, launcher == null || !launcher.hasWindowFocus()); || !launcher.isInState(NORMAL) || !launcher.hasWindowFocus()); } } public static Bitmap createFromRenderer(int width, int height, boolean forceSoftwareRenderer, public static Bitmap createFromRenderer(int width, int height, boolean forceSoftwareRenderer, Loading quickstep/src/com/android/quickstep/OverviewInteractionState.java +32 −5 Original line number Original line Diff line number Diff line Loading @@ -18,9 +18,13 @@ package com.android.quickstep; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_HIDE_BACK_BUTTON; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_HIDE_BACK_BUTTON; import android.content.Context; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.RemoteException; import android.util.Log; import android.util.Log; import com.android.launcher3.util.UiThreadHelper; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.ISystemUiProxy; /** /** Loading @@ -36,11 +40,35 @@ import com.android.systemui.shared.recents.ISystemUiProxy; public class OverviewInteractionState { public class OverviewInteractionState { private static final String TAG = "OverviewFlags"; private static final String TAG = "OverviewFlags"; private static final Handler sUiHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { updateOverviewInteractionFlag((Context) msg.obj, msg.what, msg.arg1 == 1); } }; private static final Handler sBackgroundHandler = new Handler( UiThreadHelper.getBackgroundLooper()) { @Override public void handleMessage(Message msg) { ISystemUiProxy systemUiProxy = (ISystemUiProxy) msg.obj; int flags = msg.what; try { systemUiProxy.setInteractionState(flags); } catch (RemoteException e) { Log.w(TAG, "Unable to update overview interaction flags", e); } } }; private static int sFlags; private static int sFlags; public static void setBackButtonVisible(Context context, boolean visible) { public static void setBackButtonVisible(Context context, boolean visible) { updateOverviewInteractionFlag(context, FLAG_HIDE_BACK_BUTTON, !visible); updateFlagOnUi(context, FLAG_HIDE_BACK_BUTTON, !visible); } private static void updateFlagOnUi(Context context, int flag, boolean enabled) { sUiHandler.removeMessages(flag); sUiHandler.sendMessage(sUiHandler.obtainMessage(flag, enabled ? 1 : 0, 0, context)); } } private static void updateOverviewInteractionFlag(Context context, int flag, boolean enabled) { private static void updateOverviewInteractionFlag(Context context, int flag, boolean enabled) { Loading @@ -55,10 +83,9 @@ public class OverviewInteractionState { Log.w(TAG, "Unable to update overview interaction flags; not bound to service"); Log.w(TAG, "Unable to update overview interaction flags; not bound to service"); return; return; } } try { // If we aren't already setting these flags, do so now on the background thread. systemUiProxy.setInteractionState(sFlags); if (!sBackgroundHandler.hasMessages(sFlags)) { } catch (RemoteException e) { sBackgroundHandler.sendMessage(sBackgroundHandler.obtainMessage(sFlags, systemUiProxy)); Log.w(TAG, "Unable to update overview interaction flags", e); } } } } } } quickstep/src/com/android/quickstep/TouchInteractionService.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherAppState; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.R; import com.android.launcher3.R; import com.android.launcher3.uioverrides.UiFactory; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.ActivityManagerWrapper; Loading Loading @@ -84,6 +85,9 @@ public class TouchInteractionService extends Service { mRecentsModel.setSystemUiProxy(mISystemUiProxy); mRecentsModel.setSystemUiProxy(mISystemUiProxy); RemoteRunnable.executeSafely(() -> mISystemUiProxy.setRecentsOnboardingText( RemoteRunnable.executeSafely(() -> mISystemUiProxy.setRecentsOnboardingText( getResources().getString(R.string.recents_swipe_up_onboarding))); getResources().getString(R.string.recents_swipe_up_onboarding))); Launcher launcher = (Launcher) LauncherAppState.getInstance( TouchInteractionService.this).getModel().getCallback(); UiFactory.onLauncherStateOrFocusChanged(launcher); } } @Override @Override Loading Loading
quickstep/src/com/android/launcher3/uioverrides/UiFactory.java +2 −2 Original line number Original line Diff line number Diff line Loading @@ -69,8 +69,8 @@ public class UiFactory { } } public static void onLauncherStateOrFocusChanged(Launcher launcher) { public static void onLauncherStateOrFocusChanged(Launcher launcher) { OverviewInteractionState.setBackButtonVisible(launcher, !launcher.isInState(NORMAL) OverviewInteractionState.setBackButtonVisible(launcher, launcher == null || !launcher.hasWindowFocus()); || !launcher.isInState(NORMAL) || !launcher.hasWindowFocus()); } } public static Bitmap createFromRenderer(int width, int height, boolean forceSoftwareRenderer, public static Bitmap createFromRenderer(int width, int height, boolean forceSoftwareRenderer, Loading
quickstep/src/com/android/quickstep/OverviewInteractionState.java +32 −5 Original line number Original line Diff line number Diff line Loading @@ -18,9 +18,13 @@ package com.android.quickstep; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_HIDE_BACK_BUTTON; import static com.android.systemui.shared.system.NavigationBarCompat.FLAG_HIDE_BACK_BUTTON; import android.content.Context; import android.content.Context; import android.os.Handler; import android.os.Looper; import android.os.Message; import android.os.RemoteException; import android.os.RemoteException; import android.util.Log; import android.util.Log; import com.android.launcher3.util.UiThreadHelper; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.ISystemUiProxy; /** /** Loading @@ -36,11 +40,35 @@ import com.android.systemui.shared.recents.ISystemUiProxy; public class OverviewInteractionState { public class OverviewInteractionState { private static final String TAG = "OverviewFlags"; private static final String TAG = "OverviewFlags"; private static final Handler sUiHandler = new Handler(Looper.getMainLooper()) { @Override public void handleMessage(Message msg) { updateOverviewInteractionFlag((Context) msg.obj, msg.what, msg.arg1 == 1); } }; private static final Handler sBackgroundHandler = new Handler( UiThreadHelper.getBackgroundLooper()) { @Override public void handleMessage(Message msg) { ISystemUiProxy systemUiProxy = (ISystemUiProxy) msg.obj; int flags = msg.what; try { systemUiProxy.setInteractionState(flags); } catch (RemoteException e) { Log.w(TAG, "Unable to update overview interaction flags", e); } } }; private static int sFlags; private static int sFlags; public static void setBackButtonVisible(Context context, boolean visible) { public static void setBackButtonVisible(Context context, boolean visible) { updateOverviewInteractionFlag(context, FLAG_HIDE_BACK_BUTTON, !visible); updateFlagOnUi(context, FLAG_HIDE_BACK_BUTTON, !visible); } private static void updateFlagOnUi(Context context, int flag, boolean enabled) { sUiHandler.removeMessages(flag); sUiHandler.sendMessage(sUiHandler.obtainMessage(flag, enabled ? 1 : 0, 0, context)); } } private static void updateOverviewInteractionFlag(Context context, int flag, boolean enabled) { private static void updateOverviewInteractionFlag(Context context, int flag, boolean enabled) { Loading @@ -55,10 +83,9 @@ public class OverviewInteractionState { Log.w(TAG, "Unable to update overview interaction flags; not bound to service"); Log.w(TAG, "Unable to update overview interaction flags; not bound to service"); return; return; } } try { // If we aren't already setting these flags, do so now on the background thread. systemUiProxy.setInteractionState(sFlags); if (!sBackgroundHandler.hasMessages(sFlags)) { } catch (RemoteException e) { sBackgroundHandler.sendMessage(sBackgroundHandler.obtainMessage(sFlags, systemUiProxy)); Log.w(TAG, "Unable to update overview interaction flags", e); } } } } } }
quickstep/src/com/android/quickstep/TouchInteractionService.java +4 −0 Original line number Original line Diff line number Diff line Loading @@ -46,6 +46,7 @@ import com.android.launcher3.Launcher; import com.android.launcher3.LauncherAppState; import com.android.launcher3.LauncherAppState; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.MainThreadExecutor; import com.android.launcher3.R; import com.android.launcher3.R; import com.android.launcher3.uioverrides.UiFactory; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.IOverviewProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.recents.ISystemUiProxy; import com.android.systemui.shared.system.ActivityManagerWrapper; import com.android.systemui.shared.system.ActivityManagerWrapper; Loading Loading @@ -84,6 +85,9 @@ public class TouchInteractionService extends Service { mRecentsModel.setSystemUiProxy(mISystemUiProxy); mRecentsModel.setSystemUiProxy(mISystemUiProxy); RemoteRunnable.executeSafely(() -> mISystemUiProxy.setRecentsOnboardingText( RemoteRunnable.executeSafely(() -> mISystemUiProxy.setRecentsOnboardingText( getResources().getString(R.string.recents_swipe_up_onboarding))); getResources().getString(R.string.recents_swipe_up_onboarding))); Launcher launcher = (Launcher) LauncherAppState.getInstance( TouchInteractionService.this).getModel().getCallback(); UiFactory.onLauncherStateOrFocusChanged(launcher); } } @Override @Override Loading