5/ Remove OverviewInteractionState

- We can move the background call to UiThreadHelper, the last sysui flags
  and back button alpha to SystemUiProxy (and dedupe values there as well)

Bug: 141886704

Change-Id: I22183608700c6d71355597c7a08eefa19f4381fd
This commit is contained in:
Winson Chung
2019-10-01 14:56:10 -07:00
parent 8ff53f7e65
commit bfcee430fe
12 changed files with 105 additions and 168 deletions

View File

@@ -23,6 +23,7 @@ import android.os.Handler;
import android.os.IBinder;
import android.os.Message;
import android.view.inputmethod.InputMethodManager;
import com.android.launcher3.uioverrides.UiFactory;
/**
* Utility class for offloading some class from UI thread
@@ -52,10 +53,13 @@ public class UiThreadHelper {
.sendToTarget();
}
public static void runAsyncCommand(Context context, AsyncCommand command, boolean arg1,
float arg2) {
Message.obtain(getHandler(context), MSG_RUN_COMMAND, arg1 ? 1 : 0,
Float.floatToIntBits(arg2), command).sendToTarget();
public static void setBackButtonAlphaAsync(Context context, AsyncCommand command, float alpha,
boolean animate) {
runAsyncCommand(context, command, Float.floatToIntBits(alpha), animate ? 1 : 0);
}
public static void runAsyncCommand(Context context, AsyncCommand command, int arg1, int arg2) {
Message.obtain(getHandler(context), MSG_RUN_COMMAND, arg1, arg2, command).sendToTarget();
}
private static class UiCallbacks implements Handler.Callback {
@@ -78,8 +82,7 @@ public class UiThreadHelper {
((Activity) message.obj).setRequestedOrientation(message.arg1);
return true;
case MSG_RUN_COMMAND:
((AsyncCommand) message.obj).execute(mContext, message.arg1 == 1,
Float.intBitsToFloat(message.arg2));
((AsyncCommand) message.obj).execute(mContext, message.arg1, message.arg2);
return true;
}
return false;
@@ -87,6 +90,6 @@ public class UiThreadHelper {
}
public interface AsyncCommand {
void execute(Context proxy, boolean state, float value);
void execute(Context proxy, int arg1, int arg2);
}
}