Merge "Dump notification dot counts" into ub-launcher3-rvc-dev

This commit is contained in:
Tony Wickham
2020-04-10 21:55:27 +00:00
committed by Android (Google) Code Review
4 changed files with 23 additions and 1 deletions
+2 -1
View File
@@ -2565,9 +2565,10 @@ public class Launcher extends BaseDraggingActivity implements LauncherExterns,
writer.println(prefix + "\tmRotationHelper: " + mRotationHelper);
writer.println(prefix + "\tmAppWidgetHost.isListening: " + mAppWidgetHost.isListening());
// Extra logging for b/116853349
// Extra logging for general debugging
mDragLayer.dump(prefix, writer);
mStateManager.dump(prefix, writer);
mPopupDataProvider.dump(prefix, writer);
try {
FileLog.flushAll(writer);
@@ -16,6 +16,8 @@
package com.android.launcher3.dot;
import androidx.annotation.NonNull;
import com.android.launcher3.notification.NotificationInfo;
import com.android.launcher3.notification.NotificationKeyData;
@@ -83,4 +85,10 @@ public class DotInfo {
public int getNotificationCount() {
return Math.min(mTotalCount, MAX_COUNT);
}
@NonNull
@Override
public String toString() {
return Integer.toString(mTotalCount);
}
}
@@ -33,6 +33,7 @@ import com.android.launcher3.util.PackageUserKey;
import com.android.launcher3.util.ShortcutUtil;
import com.android.launcher3.widget.WidgetListRowEntry;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -238,6 +239,11 @@ public class PopupDataProvider implements NotificationListener.NotificationsChan
}).collect(Collectors.toList());
}
public void dump(String prefix, PrintWriter writer) {
writer.println(prefix + "PopupDataProvider:");
writer.println(prefix + "\tmPackageUserToDotInfos:" + mPackageUserToDotInfos);
}
public interface PopupDataChangeListener {
PopupDataChangeListener INSTANCE = new PopupDataChangeListener() { };
@@ -3,6 +3,7 @@ package com.android.launcher3.util;
import android.os.UserHandle;
import android.service.notification.StatusBarNotification;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.android.launcher3.model.data.ItemInfo;
@@ -60,4 +61,10 @@ public class PackageUserKey {
PackageUserKey otherKey = (PackageUserKey) obj;
return mPackageName.equals(otherKey.mPackageName) && mUser.equals(otherKey.mUser);
}
@NonNull
@Override
public String toString() {
return mPackageName + "#" + mUser;
}
}