mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-02 08:56:55 +00:00
Implement LAUNCHER_ITEM_DRAG_STARTED event.
* Fixes null component issue when ItemInfo object copiedFrom.
* Fixes missing container when item is dragged from hybrid hotseat.
Sample Logs:
2020-04-30 14:09:45.499 30472-30472/com.google.android.apps.nexuslauncher D/StatsLogManager: LAUNCHER_ITEM_DRAG_STARTED
# com.android.launcher3.logger.LauncherAtom$ItemInfo@260f31f8
application {
component_name: "com.android.chrome/com.google.android.apps.chrome.Main"
package_name: "com.android.chrome"
}
container_info {
workspace {
grid_x: 2
grid_y: 2
page_index: 2
}
}
is_work: false
2020-04-30 14:23:15.230 31320-31320/com.google.android.apps.nexuslauncher D/StatsLogManager: LAUNCHER_ITEM_DRAG_STARTED
# com.android.launcher3.logger.LauncherAtom$ItemInfo@608f101
application {
component_name: "com.google.android.gm/.ConversationListActivityGmail"
package_name: "com.google.android.gm"
}
container_info {
hotseat {
index: 1
}
}
is_work: false
Bug: 152978018
Change-Id: I3d3ce213fd2fc6eb5ffb239e048ceb7c0fa88b53
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
package com.android.launcher3.logging;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
|
||||
import com.android.launcher3.R;
|
||||
import com.android.launcher3.logger.LauncherAtom;
|
||||
@@ -28,6 +29,8 @@ import com.android.launcher3.util.ResourceBasedOverride;
|
||||
*/
|
||||
public class StatsLogManager implements ResourceBasedOverride {
|
||||
|
||||
private static final String TAG = "StatsLogManager";
|
||||
|
||||
interface EventEnum {
|
||||
int getId();
|
||||
}
|
||||
@@ -40,7 +43,9 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
@LauncherUiEvent(doc = "Task launched from overview using SWIPE DOWN")
|
||||
TASK_LAUNCH_SWIPE_DOWN(2),
|
||||
@LauncherUiEvent(doc = "TASK dismissed from overview using SWIPE UP")
|
||||
TASK_DISMISS_SWIPE_UP(3);
|
||||
TASK_DISMISS_SWIPE_UP(3),
|
||||
@LauncherUiEvent(doc = "User dragged a launcher item")
|
||||
LAUNCHER_ITEM_DRAG_STARTED(383);
|
||||
// ADD MORE
|
||||
|
||||
private final int mId;
|
||||
@@ -54,6 +59,13 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
|
||||
protected LogStateProvider mStateProvider;
|
||||
|
||||
/**
|
||||
* Creates a new instance of {@link StatsLogManager} based on provided context.
|
||||
*/
|
||||
public static StatsLogManager newInstance(Context context) {
|
||||
return newInstance(context, null);
|
||||
}
|
||||
|
||||
public static StatsLogManager newInstance(Context context, LogStateProvider stateProvider) {
|
||||
StatsLogManager mgr = Overrides.getObject(StatsLogManager.class,
|
||||
context.getApplicationContext(), R.string.stats_log_manager_class);
|
||||
@@ -65,7 +77,10 @@ public class StatsLogManager implements ResourceBasedOverride {
|
||||
/**
|
||||
* Logs an event and accompanying {@link ItemInfo}
|
||||
*/
|
||||
public void log(LauncherEvent eventId, LauncherAtom.ItemInfo itemInfo) { }
|
||||
public void log(LauncherEvent event, LauncherAtom.ItemInfo itemInfo) {
|
||||
Log.d(TAG, String.format("%s\n%s", event.name(), itemInfo));
|
||||
// Call StatsLog method
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs snapshot, or impression of the current workspace.
|
||||
|
||||
Reference in New Issue
Block a user