Fixes folder logging.

Only LAUNCHER_FOLDER_LABEL_UPDATED events will have FromState, ToState
and FolderLabelInfo. Other folder events such as OPEN, DRAG etc will have
basic fields only populated.

Sample Log: https://paste.googleplex.com/5468394805526528
Screencast: http://rcll/hSUQjtQXfQM5i9DjjAQTf2/Zn5FeiVDONaQj0mK1JNjg

Bug: 159164315
Change-Id: I903fc7b62bcee748aa3ef695453be3e14d388712
This commit is contained in:
thiruram
2020-06-17 21:31:23 -07:00
parent 72ac78189f
commit b53764bd4b
6 changed files with 164 additions and 95 deletions

View File

@@ -21,6 +21,8 @@ import androidx.annotation.Nullable;
import com.android.launcher3.R;
import com.android.launcher3.logger.LauncherAtom.ContainerInfo;
import com.android.launcher3.logger.LauncherAtom.FromState;
import com.android.launcher3.logger.LauncherAtom.ToState;
import com.android.launcher3.logging.StatsLogUtils.LogStateProvider;
import com.android.launcher3.model.data.ItemInfo;
import com.android.launcher3.util.ResourceBasedOverride;
@@ -66,8 +68,10 @@ public class StatsLogManager implements ResourceBasedOverride {
+ "resulting in a new folder creation")
LAUNCHER_ITEM_DROP_FOLDER_CREATED(386),
@UiEvent(doc = "User action resulted in or manually updated the folder label to "
+ "new/same value.")
@UiEvent(doc = "Folder's label is automatically assigned.")
LAUNCHER_FOLDER_AUTO_LABELED(591),
@UiEvent(doc = "User manually updated the folder label.")
LAUNCHER_FOLDER_LABEL_UPDATED(460),
@UiEvent(doc = "User long pressed on the workspace empty space.")
@@ -245,6 +249,27 @@ public class StatsLogManager implements ResourceBasedOverride {
return this;
}
/**
* Sets FromState field of log message.
*/
default StatsLogger withFromState(FromState fromState) {
return this;
}
/**
* Sets ToState field of log message.
*/
default StatsLogger withToState(ToState toState) {
return this;
}
/**
* Sets editText field of log message.
*/
default StatsLogger withEditText(String editText) {
return this;
}
/**
* Sets the final value for container related fields of log message.
*