mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge changes from topics "TaskbarLogging", "taskbar-log" into sc-v2-dev
* changes: Add logs for taskbar and overview split action Add TaskBarContainer to launcher_atom.proto
This commit is contained in:
@@ -19,6 +19,7 @@ import static android.view.ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;
|
||||
import static android.view.WindowManager.LayoutParams.TYPE_NAVIGATION_BAR_PANEL;
|
||||
|
||||
import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_OPEN;
|
||||
import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_BOTTOM_TAPPABLE_ELEMENT;
|
||||
import static com.android.systemui.shared.system.WindowManagerWrapper.ITYPE_EXTRA_NAVIGATION_BAR;
|
||||
|
||||
@@ -52,6 +53,7 @@ import com.android.launcher3.LauncherSettings.Favorites;
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.folder.Folder;
|
||||
import com.android.launcher3.folder.FolderIcon;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
import com.android.launcher3.model.data.FolderInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.taskbar.contextual.RotationButtonController;
|
||||
@@ -231,6 +233,60 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change from hotseat/predicted hotseat to taskbar container.
|
||||
*/
|
||||
@Override
|
||||
public void applyOverwritesToLogItem(LauncherAtom.ItemInfo.Builder itemInfoBuilder) {
|
||||
if (!itemInfoBuilder.hasContainerInfo()) {
|
||||
return;
|
||||
}
|
||||
LauncherAtom.ContainerInfo oldContainer = itemInfoBuilder.getContainerInfo();
|
||||
|
||||
if (oldContainer.hasPredictedHotseatContainer()) {
|
||||
LauncherAtom.PredictedHotseatContainer predictedHotseat =
|
||||
oldContainer.getPredictedHotseatContainer();
|
||||
LauncherAtom.TaskBarContainer.Builder taskbarBuilder =
|
||||
LauncherAtom.TaskBarContainer.newBuilder();
|
||||
|
||||
if (predictedHotseat.hasIndex()) {
|
||||
taskbarBuilder.setIndex(predictedHotseat.getIndex());
|
||||
}
|
||||
if (predictedHotseat.hasCardinality()) {
|
||||
taskbarBuilder.setCardinality(predictedHotseat.getCardinality());
|
||||
}
|
||||
|
||||
itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
|
||||
.setTaskBarContainer(taskbarBuilder));
|
||||
} else if (oldContainer.hasHotseat()) {
|
||||
LauncherAtom.HotseatContainer hotseat = oldContainer.getHotseat();
|
||||
LauncherAtom.TaskBarContainer.Builder taskbarBuilder =
|
||||
LauncherAtom.TaskBarContainer.newBuilder();
|
||||
|
||||
if (hotseat.hasIndex()) {
|
||||
taskbarBuilder.setIndex(hotseat.getIndex());
|
||||
}
|
||||
|
||||
itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
|
||||
.setTaskBarContainer(taskbarBuilder));
|
||||
} else if (oldContainer.hasFolder() && oldContainer.getFolder().hasHotseat()) {
|
||||
LauncherAtom.FolderContainer.Builder folderBuilder = oldContainer.getFolder()
|
||||
.toBuilder();
|
||||
LauncherAtom.HotseatContainer hotseat = folderBuilder.getHotseat();
|
||||
LauncherAtom.TaskBarContainer.Builder taskbarBuilder =
|
||||
LauncherAtom.TaskBarContainer.newBuilder();
|
||||
|
||||
if (hotseat.hasIndex()) {
|
||||
taskbarBuilder.setIndex(hotseat.getIndex());
|
||||
}
|
||||
|
||||
folderBuilder.setTaskbar(taskbarBuilder);
|
||||
folderBuilder.clearHotseat();
|
||||
itemInfoBuilder.setContainerInfo(LauncherAtom.ContainerInfo.newBuilder()
|
||||
.setFolder(folderBuilder));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a new data-source for this taskbar instance
|
||||
*/
|
||||
@@ -328,6 +384,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
|
||||
getDragLayer().post(() -> {
|
||||
folder.animateOpen();
|
||||
getStatsLogManager().logger().withItemInfo(folder.mInfo).log(LAUNCHER_FOLDER_OPEN);
|
||||
|
||||
folder.iterateOverItems((itemInfo, itemView) -> {
|
||||
mControllers.taskbarViewController
|
||||
@@ -365,6 +422,8 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
|
||||
getSystemService(LauncherApps.class).startMainActivity(
|
||||
intent.getComponent(), info.user, intent.getSourceBounds(), null);
|
||||
}
|
||||
|
||||
mControllers.uiController.onTaskbarIconLaunched(info);
|
||||
} catch (NullPointerException | ActivityNotFoundException | SecurityException e) {
|
||||
Toast.makeText(this, R.string.activity_not_found, Toast.LENGTH_SHORT)
|
||||
.show();
|
||||
|
||||
Reference in New Issue
Block a user