mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Merge "Hardcode the className instead of class.getSimpleName()." into main
This commit is contained in:
committed by
Android (Google) Code Review
commit
798340dc6d
@@ -286,7 +286,7 @@ public class PredictionRowView<T extends Context & ActivityContext>
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
writer.println(prefix + this.getClass().getSimpleName());
|
||||
writer.println(prefix + "PredictionRowView");
|
||||
writer.println(prefix + "\tmPredictionsEnabled: " + mPredictionsEnabled);
|
||||
writer.println(prefix + "\tmPredictionUiUpdatePaused: " + mPredictionUiUpdatePaused);
|
||||
writer.println(prefix + "\tmNumPredictedAppsPerRow: " + mNumPredictedAppsPerRow);
|
||||
|
||||
@@ -521,7 +521,7 @@ public class HotseatPredictionController implements DragController.DragListener,
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
writer.println(prefix + this.getClass().getSimpleName());
|
||||
writer.println(prefix + "HotseatPredictionController");
|
||||
writer.println(prefix + "\tFlags: " + getStateString(mPauseFlags));
|
||||
writer.println(prefix + "\tmHotSeatItemsCount: " + mHotSeatItemsCount);
|
||||
writer.println(prefix + "\tmPredictedItems: " + mPredictedItems);
|
||||
|
||||
@@ -25,7 +25,7 @@ import com.android.launcher3.util.SplitConfigurationOptions.SplitPositionOption;
|
||||
/** {@link SystemShortcut.Factory} implementation to create workspace split shortcuts */
|
||||
public interface QuickstepSystemShortcut {
|
||||
|
||||
String TAG = QuickstepSystemShortcut.class.getSimpleName();
|
||||
String TAG = "QuickstepSystemShortcut";
|
||||
|
||||
static SystemShortcut.Factory<QuickstepLauncher> getSplitSelectShortcutByPosition(
|
||||
SplitPositionOption position) {
|
||||
|
||||
@@ -45,7 +45,7 @@ abstract class SplitShortcut<T>(
|
||||
) : SystemShortcut<T>(iconResId, labelResId, target, itemInfo, originalView) where
|
||||
T : Context?,
|
||||
T : ActivityContext? {
|
||||
private val TAG = SystemShortcut::class.java.simpleName
|
||||
private val TAG = "SplitShortcut"
|
||||
|
||||
// Initiate splitscreen from the Home screen or Home All Apps
|
||||
protected val splitSelectSource: SplitSelectSource?
|
||||
|
||||
@@ -182,7 +182,7 @@ public class DepthController extends BaseDepthController implements StateHandler
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
writer.println(prefix + this.getClass().getSimpleName());
|
||||
writer.println(prefix + "DepthController");
|
||||
writer.println(prefix + "\tmMaxBlurRadius=" + mMaxBlurRadius);
|
||||
writer.println(prefix + "\tmCrossWindowBlursEnabled=" + mCrossWindowBlursEnabled);
|
||||
writer.println(prefix + "\tmSurface=" + mSurface);
|
||||
|
||||
@@ -133,4 +133,9 @@ public class FallbackTaskbarUIController extends TaskbarUIController {
|
||||
protected TISBindHelper getTISBindHelper() {
|
||||
return mRecentsActivity.getTISBindHelper();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskbarUIControllerName() {
|
||||
return "FallbackTaskbarUIController";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -446,4 +446,9 @@ public class LauncherTaskbarUIController extends TaskbarUIController {
|
||||
|
||||
mTaskbarLauncherStateController.dumpLogs(prefix + "\t", pw);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getTaskbarUIControllerName() {
|
||||
return "LauncherTaskbarUIController";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ import java.util.StringJoiner;
|
||||
*/
|
||||
public class TaskbarLauncherStateController {
|
||||
|
||||
private static final String TAG = TaskbarLauncherStateController.class.getSimpleName();
|
||||
private static final String TAG = "TaskbarLauncherStateController";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/** Launcher activity is visible and focused. */
|
||||
|
||||
@@ -66,7 +66,7 @@ public class TaskbarNavButtonController implements TaskbarControllers.LoggableTa
|
||||
/** Allow some time in between the long press for back and recents. */
|
||||
static final int SCREEN_PIN_LONG_PRESS_THRESHOLD = 200;
|
||||
static final int SCREEN_PIN_LONG_PRESS_RESET = SCREEN_PIN_LONG_PRESS_THRESHOLD + 100;
|
||||
private static final String TAG = TaskbarNavButtonController.class.getSimpleName();
|
||||
private static final String TAG = "TaskbarNavButtonController";
|
||||
|
||||
private long mLastScreenPinLongPress;
|
||||
private boolean mScreenPinned;
|
||||
|
||||
@@ -78,7 +78,7 @@ import java.util.function.IntPredicate;
|
||||
* create a cohesive animation between stashed/unstashed states.
|
||||
*/
|
||||
public class TaskbarStashController implements TaskbarControllers.LoggableTaskbarController {
|
||||
private static final String TAG = TaskbarStashController.class.getSimpleName();
|
||||
private static final String TAG = "TaskbarStashController";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
public static final int FLAG_IN_APP = 1 << 0;
|
||||
|
||||
@@ -55,7 +55,6 @@ import java.util.stream.Stream;
|
||||
* Base class for providing different taskbar UI
|
||||
*/
|
||||
public class TaskbarUIController {
|
||||
|
||||
public static final TaskbarUIController DEFAULT = new TaskbarUIController();
|
||||
|
||||
// Initialized in init.
|
||||
@@ -91,6 +90,10 @@ public class TaskbarUIController {
|
||||
*/
|
||||
protected void onIconLayoutBoundsChanged() { }
|
||||
|
||||
protected String getTaskbarUIControllerName() {
|
||||
return "TaskbarUIController";
|
||||
}
|
||||
|
||||
/** Called when an icon is launched. */
|
||||
@CallSuper
|
||||
public void onTaskbarIconLaunched(ItemInfo item) {
|
||||
@@ -207,7 +210,7 @@ public class TaskbarUIController {
|
||||
pw.println(String.format(
|
||||
"%sTaskbarUIController: using an instance of %s",
|
||||
prefix,
|
||||
getClass().getSimpleName()));
|
||||
getTaskbarUIControllerName()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -71,7 +71,7 @@ import java.util.function.Predicate;
|
||||
*/
|
||||
public class TaskbarView extends FrameLayout implements FolderIcon.FolderIconParent, Insettable,
|
||||
DeviceProfile.OnDeviceProfileChangeListener {
|
||||
private static final String TAG = TaskbarView.class.getSimpleName();
|
||||
private static final String TAG = "TaskbarView";
|
||||
|
||||
private static final Rect sTmpRect = new Rect();
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ import java.util.function.Predicate;
|
||||
*/
|
||||
public class TaskbarViewController implements TaskbarControllers.LoggableTaskbarController {
|
||||
|
||||
private static final String TAG = TaskbarViewController.class.getSimpleName();
|
||||
private static final String TAG = "TaskbarViewController";
|
||||
|
||||
private static final Runnable NO_OP = () -> { };
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ import java.util.concurrent.Executors;
|
||||
*/
|
||||
public class BubbleBarController extends IBubblesListener.Stub {
|
||||
|
||||
private static final String TAG = BubbleBarController.class.getSimpleName();
|
||||
private static final String TAG = "BubbleBarController";
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
/**
|
||||
|
||||
@@ -76,7 +76,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public class BubbleBarView extends FrameLayout {
|
||||
|
||||
private static final String TAG = BubbleBarView.class.getSimpleName();
|
||||
private static final String TAG = "BubbleBarView";
|
||||
|
||||
// TODO: (b/273594744) calculate the amount of space we have and base the max on that
|
||||
// if it's smaller than 5.
|
||||
|
||||
@@ -55,7 +55,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public class BubbleBarViewController {
|
||||
|
||||
private static final String TAG = BubbleBarViewController.class.getSimpleName();
|
||||
private static final String TAG = "BubbleBarViewController";
|
||||
private static final float APP_ICON_SMALL_DP = 44f;
|
||||
private static final float APP_ICON_MEDIUM_DP = 48f;
|
||||
private static final float APP_ICON_LARGE_DP = 52f;
|
||||
|
||||
@@ -40,7 +40,7 @@ import com.android.wm.shell.common.magnetictarget.MagnetizedObject;
|
||||
* @see BubbleDragController
|
||||
*/
|
||||
public class BubbleDismissController {
|
||||
private static final String TAG = BubbleDismissController.class.getSimpleName();
|
||||
private static final String TAG = "BubbleDismissController";
|
||||
private static final float FLING_TO_DISMISS_MIN_VELOCITY = 6000f;
|
||||
private final TaskbarActivityContext mActivity;
|
||||
private final TaskbarDragLayer mDragLayer;
|
||||
|
||||
@@ -42,7 +42,7 @@ import com.android.wm.shell.shared.animation.PhysicsAnimator;
|
||||
*/
|
||||
public class BubbleStashController {
|
||||
|
||||
private static final String TAG = BubbleStashController.class.getSimpleName();
|
||||
private static final String TAG = "BubbleStashController";
|
||||
|
||||
/**
|
||||
* How long to stash/unstash.
|
||||
|
||||
@@ -111,7 +111,7 @@ import java.util.List;
|
||||
* Holds the reference to SystemUI.
|
||||
*/
|
||||
public class SystemUiProxy implements ISystemUiProxy, NavHandle, SafeCloseable {
|
||||
private static final String TAG = SystemUiProxy.class.getSimpleName();
|
||||
private static final String TAG = "SystemUiProxy";
|
||||
|
||||
public static final MainThreadInitializedObject<SystemUiProxy> INSTANCE =
|
||||
new MainThreadInitializedObject<>(SystemUiProxy::new);
|
||||
|
||||
@@ -38,36 +38,40 @@ import com.android.quickstep.util.SplitSelectDataHolder.Companion.SplitLaunchTyp
|
||||
import java.io.PrintWriter
|
||||
|
||||
/**
|
||||
* Holds/transforms/signs/seals/delivers information for the transient state of the user
|
||||
* selecting a first app to start split with and then choosing a second app.
|
||||
* This class DOES NOT associate itself with drag-and-drop split screen starts because they come
|
||||
* from the bad part of town.
|
||||
* Holds/transforms/signs/seals/delivers information for the transient state of the user selecting a
|
||||
* first app to start split with and then choosing a second app. This class DOES NOT associate
|
||||
* itself with drag-and-drop split screen starts because they come from the bad part of town.
|
||||
*
|
||||
* After setting the correct fields for initial/second.* variables, this converts them into the
|
||||
* correct [PendingIntent] and [ShortcutInfo] objects where applicable and sends the necessary
|
||||
* data back via [getSplitLaunchData]. Note: there should be only one "initial" field and one
|
||||
* "second" field set, with the rest remaining null. (Exception: [Intent] and [UserHandle] are
|
||||
* always passed in together as a set, and are converted to a single [PendingIntent] or
|
||||
* correct [PendingIntent] and [ShortcutInfo] objects where applicable and sends the necessary data
|
||||
* back via [getSplitLaunchData]. Note: there should be only one "initial" field and one "second"
|
||||
* field set, with the rest remaining null. (Exception: [Intent] and [UserHandle] are always passed
|
||||
* in together as a set, and are converted to a single [PendingIntent] or
|
||||
* [ShortcutInfo]+[PendingIntent] before launch.)
|
||||
*
|
||||
* [SplitLaunchType] indicates the type of tasks/apps/intents being launched given the provided
|
||||
* state
|
||||
*/
|
||||
class SplitSelectDataHolder(
|
||||
var context: Context?
|
||||
) {
|
||||
class SplitSelectDataHolder(var context: Context?) {
|
||||
val TAG = SplitSelectDataHolder::class.simpleName
|
||||
|
||||
/**
|
||||
* Order of the constant indicates the order of which task/app was selected.
|
||||
* Ex. SPLIT_TASK_SHORTCUT means primary split app identified by task, secondary is shortcut
|
||||
* Order of the constant indicates the order of which task/app was selected. Ex.
|
||||
* SPLIT_TASK_SHORTCUT means primary split app identified by task, secondary is shortcut
|
||||
* SPLIT_SHORTCUT_TASK means primary split app is determined by shortcut, secondary is task
|
||||
*/
|
||||
companion object {
|
||||
@IntDef(SPLIT_TASK_TASK, SPLIT_TASK_PENDINGINTENT, SPLIT_TASK_SHORTCUT,
|
||||
SPLIT_PENDINGINTENT_TASK, SPLIT_PENDINGINTENT_PENDINGINTENT, SPLIT_SHORTCUT_TASK,
|
||||
SPLIT_SINGLE_TASK_FULLSCREEN, SPLIT_SINGLE_INTENT_FULLSCREEN,
|
||||
SPLIT_SINGLE_SHORTCUT_FULLSCREEN)
|
||||
@IntDef(
|
||||
SPLIT_TASK_TASK,
|
||||
SPLIT_TASK_PENDINGINTENT,
|
||||
SPLIT_TASK_SHORTCUT,
|
||||
SPLIT_PENDINGINTENT_TASK,
|
||||
SPLIT_PENDINGINTENT_PENDINGINTENT,
|
||||
SPLIT_SHORTCUT_TASK,
|
||||
SPLIT_SINGLE_TASK_FULLSCREEN,
|
||||
SPLIT_SINGLE_INTENT_FULLSCREEN,
|
||||
SPLIT_SINGLE_SHORTCUT_FULLSCREEN
|
||||
)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class SplitLaunchType
|
||||
|
||||
@@ -84,8 +88,7 @@ class SplitSelectDataHolder(
|
||||
const val SPLIT_SINGLE_SHORTCUT_FULLSCREEN = 8
|
||||
}
|
||||
|
||||
@StagePosition
|
||||
private var initialStagePosition: Int = STAGE_POSITION_UNDEFINED
|
||||
@StagePosition private var initialStagePosition: Int = STAGE_POSITION_UNDEFINED
|
||||
private var itemInfo: ItemInfo? = null
|
||||
private var secondItemInfo: ItemInfo? = null
|
||||
private var splitEvent: EventEnum? = null
|
||||
@@ -108,12 +111,16 @@ class SplitSelectDataHolder(
|
||||
|
||||
/**
|
||||
* @param alreadyRunningTask if set to [android.app.ActivityTaskManager.INVALID_TASK_ID]
|
||||
* then @param intent will be used to launch the initial task
|
||||
* then @param intent will be used to launch the initial task
|
||||
* @param intent will be ignored if @param alreadyRunningTask is set
|
||||
*/
|
||||
fun setInitialTaskSelect(intent: Intent?, @StagePosition stagePosition: Int,
|
||||
itemInfo: ItemInfo?, splitEvent: EventEnum?,
|
||||
alreadyRunningTask: Int) {
|
||||
fun setInitialTaskSelect(
|
||||
intent: Intent?,
|
||||
@StagePosition stagePosition: Int,
|
||||
itemInfo: ItemInfo?,
|
||||
splitEvent: EventEnum?,
|
||||
alreadyRunningTask: Int
|
||||
) {
|
||||
if (alreadyRunningTask != INVALID_TASK_ID) {
|
||||
initialTaskId = alreadyRunningTask
|
||||
} else {
|
||||
@@ -127,15 +134,21 @@ class SplitSelectDataHolder(
|
||||
* To be called after first task selected from using a split shortcut from the fullscreen
|
||||
* running app.
|
||||
*/
|
||||
fun setInitialTaskSelect(info: RunningTaskInfo,
|
||||
@StagePosition stagePosition: Int, itemInfo: ItemInfo?,
|
||||
splitEvent: EventEnum?) {
|
||||
fun setInitialTaskSelect(
|
||||
info: RunningTaskInfo,
|
||||
@StagePosition stagePosition: Int,
|
||||
itemInfo: ItemInfo?,
|
||||
splitEvent: EventEnum?
|
||||
) {
|
||||
initialTaskId = info.taskId
|
||||
setInitialData(stagePosition, splitEvent, itemInfo)
|
||||
}
|
||||
|
||||
private fun setInitialData(@StagePosition stagePosition: Int,
|
||||
event: EventEnum?, item: ItemInfo?) {
|
||||
private fun setInitialData(
|
||||
@StagePosition stagePosition: Int,
|
||||
event: EventEnum?,
|
||||
item: ItemInfo?
|
||||
) {
|
||||
itemInfo = item
|
||||
initialStagePosition = stagePosition
|
||||
splitEvent = event
|
||||
@@ -143,6 +156,7 @@ class SplitSelectDataHolder(
|
||||
|
||||
/**
|
||||
* To be called as soon as user selects the second task (even if animations aren't complete)
|
||||
*
|
||||
* @param taskId The second task that will be launched.
|
||||
*/
|
||||
fun setSecondTask(taskId: Int, itemInfo: ItemInfo) {
|
||||
@@ -152,6 +166,7 @@ class SplitSelectDataHolder(
|
||||
|
||||
/**
|
||||
* To be called as soon as user selects the second app (even if animations aren't complete)
|
||||
*
|
||||
* @param intent The second intent that will be launched.
|
||||
* @param user The user of that intent.
|
||||
*/
|
||||
@@ -162,8 +177,9 @@ class SplitSelectDataHolder(
|
||||
}
|
||||
|
||||
/**
|
||||
* To be called as soon as user selects the second app (even if animations aren't complete)
|
||||
* Sets [secondUser] from that of the pendingIntent
|
||||
* To be called as soon as user selects the second app (even if animations aren't complete) Sets
|
||||
* [secondUser] from that of the pendingIntent
|
||||
*
|
||||
* @param pendingIntent The second PendingIntent that will be launched.
|
||||
*/
|
||||
fun setSecondTask(pendingIntent: PendingIntent, itemInfo: ItemInfo) {
|
||||
@@ -173,9 +189,9 @@ class SplitSelectDataHolder(
|
||||
}
|
||||
|
||||
/**
|
||||
* Similar to [setSecondTask] except this is to be called for widgets which can pass through
|
||||
* an extra intent from their RemoteResponse.
|
||||
* See [android.widget.RemoteViews.RemoteResponse.getLaunchOptions].first
|
||||
* Similar to [setSecondTask] except this is to be called for widgets which can pass through an
|
||||
* extra intent from their RemoteResponse. See
|
||||
* [android.widget.RemoteViews.RemoteResponse.getLaunchOptions].first
|
||||
*/
|
||||
fun setSecondWidget(pendingIntent: PendingIntent, widgetIntent: Intent?, itemInfo: ItemInfo) {
|
||||
setSecondTask(pendingIntent, itemInfo)
|
||||
@@ -184,8 +200,7 @@ class SplitSelectDataHolder(
|
||||
|
||||
private fun getShortcutInfo(intent: Intent?, user: UserHandle?): ShortcutInfo? {
|
||||
val intentPackage = intent?.getPackage() ?: return null
|
||||
val shortcutId = intent.getStringExtra(ShortcutKey.EXTRA_SHORTCUT_ID)
|
||||
?: return null
|
||||
val shortcutId = intent.getStringExtra(ShortcutKey.EXTRA_SHORTCUT_ID) ?: return null
|
||||
try {
|
||||
val context: Context =
|
||||
if (user != null) {
|
||||
@@ -200,9 +215,7 @@ class SplitSelectDataHolder(
|
||||
return null
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts intents to pendingIntents, associating the [user] with the intent if provided
|
||||
*/
|
||||
/** Converts intents to pendingIntents, associating the [user] with the intent if provided */
|
||||
private fun getPendingIntent(intent: Intent?, user: UserHandle?): PendingIntent? {
|
||||
if (intent != initialIntent && intent != secondIntent) {
|
||||
throw IllegalStateException("Invalid intent to convert to PendingIntent")
|
||||
@@ -211,12 +224,21 @@ class SplitSelectDataHolder(
|
||||
return if (intent == null) {
|
||||
null
|
||||
} else if (user != null) {
|
||||
PendingIntent.getActivityAsUser(context, 0, intent,
|
||||
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT,
|
||||
null /* options */, user)
|
||||
PendingIntent.getActivityAsUser(
|
||||
context,
|
||||
0,
|
||||
intent,
|
||||
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT,
|
||||
null /* options */,
|
||||
user
|
||||
)
|
||||
} else {
|
||||
PendingIntent.getActivity(context, 0, intent,
|
||||
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT)
|
||||
PendingIntent.getActivity(
|
||||
context,
|
||||
0,
|
||||
intent,
|
||||
PendingIntent.FLAG_MUTABLE or PendingIntent.FLAG_ALLOW_UNSAFE_IMPLICIT_INTENT
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,7 +246,7 @@ class SplitSelectDataHolder(
|
||||
* @return [SplitLaunchData] with the necessary fields populated as determined by
|
||||
* [SplitLaunchData.splitLaunchType]. This is to be used for launching splitscreen
|
||||
*/
|
||||
fun getSplitLaunchData() : SplitLaunchData {
|
||||
fun getSplitLaunchData(): SplitLaunchData {
|
||||
// Convert all intents to shortcut infos to see if determine if we launch shortcut or intent
|
||||
convertIntentsToFinalTypes()
|
||||
val splitLaunchType = getSplitLaunchType()
|
||||
@@ -241,7 +263,7 @@ class SplitSelectDataHolder(
|
||||
* [SplitLaunchData.splitLaunchType]. This is to be used for launching an initially selected
|
||||
* split task in fullscreen
|
||||
*/
|
||||
fun getFullscreenLaunchData() : SplitLaunchData {
|
||||
fun getFullscreenLaunchData(): SplitLaunchData {
|
||||
// Convert all intents to shortcut infos to determine if we launch shortcut or intent
|
||||
convertIntentsToFinalTypes()
|
||||
val splitLaunchType = getFullscreenLaunchType()
|
||||
@@ -249,21 +271,22 @@ class SplitSelectDataHolder(
|
||||
return generateSplitLaunchData(splitLaunchType)
|
||||
}
|
||||
|
||||
private fun generateSplitLaunchData(@SplitLaunchType splitLaunchType: Int) : SplitLaunchData {
|
||||
private fun generateSplitLaunchData(@SplitLaunchType splitLaunchType: Int): SplitLaunchData {
|
||||
return SplitLaunchData(
|
||||
splitLaunchType,
|
||||
initialTaskId,
|
||||
secondTaskId,
|
||||
initialPendingIntent,
|
||||
secondPendingIntent,
|
||||
widgetSecondIntent,
|
||||
initialUser?.identifier ?: -1,
|
||||
secondUser?.identifier ?: -1,
|
||||
initialShortcut,
|
||||
secondShortcut,
|
||||
itemInfo,
|
||||
splitEvent,
|
||||
initialStagePosition)
|
||||
splitLaunchType,
|
||||
initialTaskId,
|
||||
secondTaskId,
|
||||
initialPendingIntent,
|
||||
secondPendingIntent,
|
||||
widgetSecondIntent,
|
||||
initialUser?.identifier ?: -1,
|
||||
secondUser?.identifier ?: -1,
|
||||
initialShortcut,
|
||||
secondShortcut,
|
||||
itemInfo,
|
||||
splitEvent,
|
||||
initialStagePosition
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,8 +296,7 @@ class SplitSelectDataHolder(
|
||||
* Note that both [initialIntent] and [secondIntent] will be nullified on method return
|
||||
*
|
||||
* One caveat is that if [secondPendingIntent] is set, we will use that and *not* attempt to
|
||||
* convert [secondIntent].
|
||||
* This also leaves [widgetSecondIntent] untouched.
|
||||
* convert [secondIntent]. This also leaves [widgetSecondIntent] untouched.
|
||||
*/
|
||||
private fun convertIntentsToFinalTypes() {
|
||||
initialShortcut = getShortcutInfo(initialIntent, initialUser)
|
||||
@@ -297,8 +319,8 @@ class SplitSelectDataHolder(
|
||||
}
|
||||
|
||||
/**
|
||||
* Only valid data fields at this point should be tasks, shortcuts, or pendingIntents
|
||||
* Intents need to be converted in [convertIntentsToFinalTypes] prior to calling this method
|
||||
* Only valid data fields at this point should be tasks, shortcuts, or pendingIntents Intents
|
||||
* need to be converted in [convertIntentsToFinalTypes] prior to calling this method
|
||||
*/
|
||||
@VisibleForTesting
|
||||
@SplitLaunchType
|
||||
@@ -354,41 +376,40 @@ class SplitSelectDataHolder(
|
||||
}
|
||||
|
||||
data class SplitLaunchData(
|
||||
@SplitLaunchType
|
||||
val splitLaunchType: Int,
|
||||
var initialTaskId: Int = INVALID_TASK_ID,
|
||||
var secondTaskId: Int = INVALID_TASK_ID,
|
||||
var initialPendingIntent: PendingIntent? = null,
|
||||
var secondPendingIntent: PendingIntent? = null,
|
||||
var widgetSecondIntent: Intent? = null,
|
||||
var initialUserId: Int = -1,
|
||||
var secondUserId: Int = -1,
|
||||
var initialShortcut: ShortcutInfo? = null,
|
||||
var secondShortcut: ShortcutInfo? = null,
|
||||
var itemInfo: ItemInfo? = null,
|
||||
var splitEvent: EventEnum? = null,
|
||||
val initialStagePosition: Int = STAGE_POSITION_UNDEFINED
|
||||
@SplitLaunchType val splitLaunchType: Int,
|
||||
var initialTaskId: Int = INVALID_TASK_ID,
|
||||
var secondTaskId: Int = INVALID_TASK_ID,
|
||||
var initialPendingIntent: PendingIntent? = null,
|
||||
var secondPendingIntent: PendingIntent? = null,
|
||||
var widgetSecondIntent: Intent? = null,
|
||||
var initialUserId: Int = -1,
|
||||
var secondUserId: Int = -1,
|
||||
var initialShortcut: ShortcutInfo? = null,
|
||||
var secondShortcut: ShortcutInfo? = null,
|
||||
var itemInfo: ItemInfo? = null,
|
||||
var splitEvent: EventEnum? = null,
|
||||
val initialStagePosition: Int = STAGE_POSITION_UNDEFINED
|
||||
)
|
||||
|
||||
/**
|
||||
* @return `true` if first task has been selected and waiting for the second task to be
|
||||
* chosen
|
||||
* @return `true` if first task has been selected and waiting for the second task to be chosen
|
||||
*/
|
||||
fun isSplitSelectActive(): Boolean {
|
||||
return isInitialTaskIntentSet() && !isSecondTaskIntentSet()
|
||||
}
|
||||
|
||||
/**
|
||||
* @return `true` if the first and second task have been chosen and split is waiting to
|
||||
* be launched
|
||||
* @return `true` if the first and second task have been chosen and split is waiting to be
|
||||
* launched
|
||||
*/
|
||||
fun isBothSplitAppsConfirmed(): Boolean {
|
||||
return isInitialTaskIntentSet() && isSecondTaskIntentSet()
|
||||
}
|
||||
|
||||
private fun isInitialTaskIntentSet(): Boolean {
|
||||
return initialTaskId != INVALID_TASK_ID || initialIntent != null ||
|
||||
initialPendingIntent != null
|
||||
return initialTaskId != INVALID_TASK_ID ||
|
||||
initialIntent != null ||
|
||||
initialPendingIntent != null
|
||||
}
|
||||
|
||||
fun getInitialTaskId(): Int {
|
||||
@@ -416,8 +437,9 @@ class SplitSelectDataHolder(
|
||||
}
|
||||
|
||||
private fun isSecondTaskIntentSet(): Boolean {
|
||||
return secondTaskId != INVALID_TASK_ID || secondIntent != null
|
||||
|| secondPendingIntent != null
|
||||
return secondTaskId != INVALID_TASK_ID ||
|
||||
secondIntent != null ||
|
||||
secondPendingIntent != null
|
||||
}
|
||||
|
||||
fun resetState() {
|
||||
@@ -437,7 +459,7 @@ class SplitSelectDataHolder(
|
||||
}
|
||||
|
||||
fun dump(prefix: String, writer: PrintWriter) {
|
||||
writer.println("$prefix ${javaClass.simpleName}")
|
||||
writer.println("$prefix SplitSelectDataHolder")
|
||||
writer.println("$prefix\tinitialStagePosition= $initialStagePosition")
|
||||
writer.println("$prefix\tinitialTaskId= $initialTaskId")
|
||||
writer.println("$prefix\tsecondTaskId= $secondTaskId")
|
||||
|
||||
@@ -46,7 +46,7 @@ import com.android.wm.shell.pip.PipContentOverlay;
|
||||
* when swiping up (in gesture navigation mode).
|
||||
*/
|
||||
public class SwipePipToHomeAnimator extends RectFSpringAnim {
|
||||
private static final String TAG = SwipePipToHomeAnimator.class.getSimpleName();
|
||||
private static final String TAG = "SwipePipToHomeAnimator";
|
||||
|
||||
private static final float END_PROGRESS = 1.0f;
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import java.util.function.Predicate;
|
||||
* @param <V> Type of object stored in the cache
|
||||
*/
|
||||
public class TaskKeyByLastActiveTimeCache<V> implements TaskKeyCache<V> {
|
||||
private static final String TAG = TaskKeyByLastActiveTimeCache.class.getSimpleName();
|
||||
private static final String TAG = "TaskKeyByLastActiveTimeCache";
|
||||
private final AtomicInteger mMaxSize;
|
||||
private final Map<Integer, Entry<V>> mMap;
|
||||
// To sort task id by last active time
|
||||
|
||||
@@ -66,7 +66,7 @@ import java.util.function.Consumer;
|
||||
// TODO(b/249371338): TaskView needs to be refactored to have better support for N tasks.
|
||||
public class DesktopTaskView extends TaskView {
|
||||
|
||||
private static final String TAG = DesktopTaskView.class.getSimpleName();
|
||||
private static final String TAG = "DesktopTaskView";
|
||||
|
||||
private static final boolean DEBUG = false;
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ public final class DigitalWellBeingToast {
|
||||
static final Intent OPEN_APP_USAGE_SETTINGS_TEMPLATE = new Intent(ACTION_APP_USAGE_SETTINGS);
|
||||
static final int MINUTE_MS = 60000;
|
||||
|
||||
private static final String TAG = DigitalWellBeingToast.class.getSimpleName();
|
||||
private static final String TAG = "DigitalWellBeingToast";
|
||||
|
||||
private final RecentsViewContainer mContainer;
|
||||
private final TaskView mTaskView;
|
||||
|
||||
@@ -63,7 +63,7 @@ import java.util.function.Consumer;
|
||||
*/
|
||||
public class GroupedTaskView extends TaskView {
|
||||
|
||||
private static final String TAG = GroupedTaskView.class.getSimpleName();
|
||||
private static final String TAG = "GroupedTaskView";
|
||||
// TODO(b/336612373): Support new TTV for GroupedTaskView
|
||||
private TaskThumbnailViewDeprecated mSnapshotView2;
|
||||
private TaskViewIcon mIconView2;
|
||||
|
||||
@@ -136,7 +136,7 @@ import java.util.stream.Stream;
|
||||
*/
|
||||
public class TaskView extends FrameLayout implements Reusable {
|
||||
|
||||
private static final String TAG = TaskView.class.getSimpleName();
|
||||
private static final String TAG = "TaskView";
|
||||
public static final int FLAG_UPDATE_ICON = 1;
|
||||
public static final int FLAG_UPDATE_THUMBNAIL = FLAG_UPDATE_ICON << 1;
|
||||
public static final int FLAG_UPDATE_CORNER_RADIUS = FLAG_UPDATE_THUMBNAIL << 1;
|
||||
|
||||
Reference in New Issue
Block a user