diff --git a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java index 70e01f53a0..a16031d804 100644 --- a/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java +++ b/quickstep/src/com/android/launcher3/appprediction/PredictionRowView.java @@ -286,7 +286,7 @@ public class PredictionRowView } 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); diff --git a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java index 1c5a75dd1c..866dbe584c 100644 --- a/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java +++ b/quickstep/src/com/android/launcher3/hybridhotseat/HotseatPredictionController.java @@ -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); diff --git a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java index 184ea717cd..fe9ade9896 100644 --- a/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java +++ b/quickstep/src/com/android/launcher3/popup/QuickstepSystemShortcut.java @@ -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 getSplitSelectShortcutByPosition( SplitPositionOption position) { diff --git a/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt b/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt index 2b6f77f231..c94edceb43 100644 --- a/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt +++ b/quickstep/src/com/android/launcher3/splitscreen/SplitShortcut.kt @@ -45,7 +45,7 @@ abstract class SplitShortcut( ) : SystemShortcut(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? diff --git a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java index 882682dc4a..747612d823 100644 --- a/quickstep/src/com/android/launcher3/statehandlers/DepthController.java +++ b/quickstep/src/com/android/launcher3/statehandlers/DepthController.java @@ -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); diff --git a/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java index c0ecc6151a..06d9ee6c96 100644 --- a/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/FallbackTaskbarUIController.java @@ -133,4 +133,9 @@ public class FallbackTaskbarUIController extends TaskbarUIController { protected TISBindHelper getTISBindHelper() { return mRecentsActivity.getTISBindHelper(); } + + @Override + protected String getTaskbarUIControllerName() { + return "FallbackTaskbarUIController"; + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java index 2ce6a41cb9..4f021224c3 100644 --- a/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/LauncherTaskbarUIController.java @@ -446,4 +446,9 @@ public class LauncherTaskbarUIController extends TaskbarUIController { mTaskbarLauncherStateController.dumpLogs(prefix + "\t", pw); } + + @Override + protected String getTaskbarUIControllerName() { + return "LauncherTaskbarUIController"; + } } diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java index ee21eacb8c..6ea52cb888 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarLauncherStateController.java @@ -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. */ diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java index ade4649dab..13a68a04a7 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarNavButtonController.java @@ -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; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java index 4da77627f7..f764a835f6 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarStashController.java @@ -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; diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java index 32e4097de4..6abd5a9c75 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarUIController.java @@ -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())); } /** diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java index 77f8a8a088..df7a7ba84a 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarView.java @@ -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(); diff --git a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java index e0b446e5a9..0ee3d7f361 100644 --- a/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/TaskbarViewController.java @@ -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 = () -> { }; diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java index 90e0108b40..5789f0c611 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarController.java @@ -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; /** diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java index 4334807021..d08015e0ca 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarView.java @@ -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. diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java index ac02f1fe5e..cd8eaf9a5e 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleBarViewController.java @@ -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; diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java index a40f33c595..0e6fa3c5e8 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleDismissController.java @@ -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; diff --git a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java index d0462aa3da..5d01b9bd08 100644 --- a/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java +++ b/quickstep/src/com/android/launcher3/taskbar/bubbles/BubbleStashController.java @@ -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. diff --git a/quickstep/src/com/android/quickstep/SystemUiProxy.java b/quickstep/src/com/android/quickstep/SystemUiProxy.java index 0ad60b7f1e..4d3fe41f5d 100644 --- a/quickstep/src/com/android/quickstep/SystemUiProxy.java +++ b/quickstep/src/com/android/quickstep/SystemUiProxy.java @@ -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 INSTANCE = new MainThreadInitializedObject<>(SystemUiProxy::new); diff --git a/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt b/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt index 06edb14a1f..8258ab81af 100644 --- a/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt +++ b/quickstep/src/com/android/quickstep/util/SplitSelectDataHolder.kt @@ -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") diff --git a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java index f823affef9..99f10a75db 100644 --- a/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java +++ b/quickstep/src/com/android/quickstep/util/SwipePipToHomeAnimator.java @@ -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; diff --git a/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java b/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java index 21c9e09b10..69137cc1b6 100644 --- a/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java +++ b/quickstep/src/com/android/quickstep/util/TaskKeyByLastActiveTimeCache.java @@ -37,7 +37,7 @@ import java.util.function.Predicate; * @param Type of object stored in the cache */ public class TaskKeyByLastActiveTimeCache implements TaskKeyCache { - private static final String TAG = TaskKeyByLastActiveTimeCache.class.getSimpleName(); + private static final String TAG = "TaskKeyByLastActiveTimeCache"; private final AtomicInteger mMaxSize; private final Map> mMap; // To sort task id by last active time diff --git a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java index 57bc2d78ba..1bedad4ef2 100644 --- a/quickstep/src/com/android/quickstep/views/DesktopTaskView.java +++ b/quickstep/src/com/android/quickstep/views/DesktopTaskView.java @@ -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; diff --git a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java index f92b9ddb55..4df9414832 100644 --- a/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java +++ b/quickstep/src/com/android/quickstep/views/DigitalWellBeingToast.java @@ -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; diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index 1b4d22fc2e..1ccb7640a8 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -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; diff --git a/quickstep/src/com/android/quickstep/views/TaskView.java b/quickstep/src/com/android/quickstep/views/TaskView.java index 65a8c771e8..1187222171 100644 --- a/quickstep/src/com/android/quickstep/views/TaskView.java +++ b/quickstep/src/com/android/quickstep/views/TaskView.java @@ -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; diff --git a/src/com/android/launcher3/DevicePaddings.java b/src/com/android/launcher3/DevicePaddings.java index 08fb47b2cf..8494d11937 100644 --- a/src/com/android/launcher3/DevicePaddings.java +++ b/src/com/android/launcher3/DevicePaddings.java @@ -47,7 +47,7 @@ public class DevicePaddings { private static final String WORKSPACE_BOTTOM_PADDING = "workspaceBottomPadding"; private static final String HOTSEAT_BOTTOM_PADDING = "hotseatBottomPadding"; - private static final String TAG = DevicePaddings.class.getSimpleName(); + private static final String TAG = "DevicePaddings"; private static final boolean DEBUG = false; ArrayList mDevicePaddings = new ArrayList<>(); diff --git a/src/com/android/launcher3/PagedView.java b/src/com/android/launcher3/PagedView.java index cc9f08eadc..365fbd3919 100644 --- a/src/com/android/launcher3/PagedView.java +++ b/src/com/android/launcher3/PagedView.java @@ -788,7 +788,7 @@ public abstract class PagedView extends ViewGrou if (mScroller.isFinished() && pageScrollChanged) { // TODO(b/246283207): Remove logging once root cause of flake detected. if (Utilities.isRunningInTestHarness() && !(this instanceof Workspace)) { - Log.d("b/246283207", this.getClass().getSimpleName() + "#onLayout() -> " + Log.d("b/246283207", TAG + "#onLayout() -> " + "if(mScroller.isFinished() && pageScrollChanged) -> getNextPage(): " + getNextPage() + ", getScrollForPage(getNextPage()): " + getScrollForPage(getNextPage())); diff --git a/src/com/android/launcher3/model/data/ItemInfo.java b/src/com/android/launcher3/model/data/ItemInfo.java index 72e85c7cb7..b82d0a0985 100644 --- a/src/com/android/launcher3/model/data/ItemInfo.java +++ b/src/com/android/launcher3/model/data/ItemInfo.java @@ -73,6 +73,7 @@ import java.util.Optional; * Represents an item in the launcher. */ public class ItemInfo { + private static final String TAG = "ItemInfo"; public static final boolean DEBUG = false; public static final int NO_ID = -1; @@ -285,7 +286,7 @@ public class ItemInfo { @Override @NonNull public final String toString() { - return getClass().getSimpleName() + "(" + dumpProperties() + ")"; + return TAG + "(" + dumpProperties() + ")"; } @NonNull diff --git a/src/com/android/launcher3/pm/PackageInstallInfo.java b/src/com/android/launcher3/pm/PackageInstallInfo.java index 1797c1fc81..23d3b61f82 100644 --- a/src/com/android/launcher3/pm/PackageInstallInfo.java +++ b/src/com/android/launcher3/pm/PackageInstallInfo.java @@ -22,6 +22,7 @@ import android.os.UserHandle; import androidx.annotation.NonNull; public final class PackageInstallInfo { + private static final String TAG = "PackageInstallInfo"; public static final int STATUS_INSTALLED = 0; public static final int STATUS_INSTALLING = 1; @@ -61,7 +62,7 @@ public final class PackageInstallInfo { @Override public String toString() { - return getClass().getSimpleName() + "(" + dumpProperties() + ")"; + return TAG + "(" + dumpProperties() + ")"; } private String dumpProperties() { diff --git a/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt b/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt index 7502a43ff9..2c3035f3ac 100644 --- a/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt +++ b/src/com/android/launcher3/responsive/HotseatSpecsProvider.kt @@ -135,7 +135,7 @@ data class HotseatSpec( hotseatQsbSpace.fixedSize + edgePadding.fixedSize <= maxAvailableSize private fun logError(message: String) { - Log.e(LOG_TAG, "${this::class.simpleName}#isValid - $message - $this") + Log.e(LOG_TAG, "$LOG_TAG #isValid - $message - $this") } companion object { diff --git a/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt b/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt index a4b25e529a..ef9b7dfc6f 100644 --- a/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt +++ b/src/com/android/launcher3/responsive/ResponsiveCellSpecsProvider.kt @@ -31,7 +31,7 @@ class ResponsiveCellSpecsProvider(groupOfSpecs: List check(group.widthSpecs.isEmpty() && group.heightSpecs.isNotEmpty()) { - "${this::class.simpleName} is invalid, only heightSpecs are allowed - " + + "$LOG_TAG is invalid, only heightSpecs are allowed - " + "width list size = ${group.widthSpecs.size}; " + "height list size = ${group.heightSpecs.size}." } @@ -65,6 +65,7 @@ class ResponsiveCellSpecsProvider(groupOfSpecs: List check(group.widthSpecs.isNotEmpty() && group.heightSpecs.isNotEmpty()) { - "${this::class.simpleName} is incomplete - " + + "$LOG_TAG is incomplete - " + "width list size = ${group.widthSpecs.size}; " + "height list size = ${group.heightSpecs.size}." } @@ -124,6 +124,7 @@ class ResponsiveSpecsProvider( } companion object { + private const val LOG_TAG = "ResponsiveSpecsProvider" @JvmStatic fun create( resourceHelper: ResourceHelper, diff --git a/src/com/android/launcher3/touch/ItemClickHandler.java b/src/com/android/launcher3/touch/ItemClickHandler.java index 0ed6ea05c4..d925629822 100644 --- a/src/com/android/launcher3/touch/ItemClickHandler.java +++ b/src/com/android/launcher3/touch/ItemClickHandler.java @@ -84,7 +84,7 @@ import java.util.function.Consumer; */ public class ItemClickHandler { - private static final String TAG = ItemClickHandler.class.getSimpleName(); + private static final String TAG = "ItemClickHandler"; /** * Instance used for click handling on items diff --git a/src/com/android/launcher3/views/ArrowTipView.java b/src/com/android/launcher3/views/ArrowTipView.java index 2f0da03418..bb4f04008b 100644 --- a/src/com/android/launcher3/views/ArrowTipView.java +++ b/src/com/android/launcher3/views/ArrowTipView.java @@ -54,7 +54,7 @@ import com.android.launcher3.graphics.TriangleShape; */ public class ArrowTipView extends AbstractFloatingView { - private static final String TAG = ArrowTipView.class.getSimpleName(); + private static final String TAG = "ArrowTipView"; private static final long AUTO_CLOSE_TIMEOUT_MILLIS = 10 * 1000; private static final long SHOW_DELAY_MS = 200; private static final long SHOW_DURATION_MS = 300; diff --git a/src/com/android/launcher3/views/FloatingIconView.java b/src/com/android/launcher3/views/FloatingIconView.java index 0d07f639a1..1d5a9dcb97 100644 --- a/src/com/android/launcher3/views/FloatingIconView.java +++ b/src/com/android/launcher3/views/FloatingIconView.java @@ -68,7 +68,7 @@ import java.util.function.Supplier; public class FloatingIconView extends FrameLayout implements Animator.AnimatorListener, OnGlobalLayoutListener, FloatingView { - private static final String TAG = FloatingIconView.class.getSimpleName(); + private static final String TAG = "FloatingIconView"; // Manages loading the icon on a worker thread private static @Nullable IconLoadResult sIconLoadResult;