Add logs for when sectionInfo is computed or added for bugreport.
bug: 336947811 Test: manually/presubmit: https://screenshot.googleplex.com/A2st8q57pajFBcG dump: https://screenshot.googleplex.com/8JGoqz2ixodHH94 Flag: NONE adding logs Change-Id: I3edc953fa8ec58a3677cc65f858b50d95184592c
This commit is contained in:
1 parent
cd53b74000
commit
71fff87e2d
4 files changed
+32
No files matched your search
@@ -26,6 +26,7 @@ import android.content.Context;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableString;
|
||||
import android.text.style.ImageSpan;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.annotation.VisibleForTesting;
|
||||
@@ -39,6 +40,7 @@ import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.util.LabelComparator;
|
||||
import com.android.launcher3.views.ActivityContext;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
@@ -270,6 +272,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
List<AdapterItem> oldItems = new ArrayList<>(mAdapterItems);
|
||||
// Prepare to update the list of sections, filtered apps, etc.
|
||||
mFastScrollerSections.clear();
|
||||
Log.d(TAG, "Clearing FastScrollerSections.");
|
||||
mAdapterItems.clear();
|
||||
mAccessibilityResultsCount = 0;
|
||||
|
||||
@@ -290,6 +293,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
mFastScrollerSections.add(new FastScrollSectionInfo(
|
||||
mActivityContext.getResources().getString(
|
||||
R.string.work_profile_edu_section), 0));
|
||||
Log.d(TAG, "Adding FastScrollSection for work edu card.");
|
||||
}
|
||||
position = addAppsWithSections(mApps, position);
|
||||
}
|
||||
@@ -303,6 +307,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
mFastScrollerSections.add(new FastScrollSectionInfo(
|
||||
mFastScrollerSections.get(mFastScrollerSections.size() - 1).sectionName,
|
||||
position++));
|
||||
Log.d(TAG, "Adding FastScrollSection duplicate to scroll to the bottom.");
|
||||
}
|
||||
}
|
||||
mAccessibilityResultsCount = (int) mAdapterItems.stream()
|
||||
@@ -346,6 +351,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
&& !mPrivateApps.isEmpty()) {
|
||||
// Always add PS Header if Space is present and visible.
|
||||
position = mPrivateProviderManager.addPrivateSpaceHeader(mAdapterItems);
|
||||
Log.d(TAG, "Adding FastScrollSection for Private Space header. ");
|
||||
mFastScrollerSections.add(new FastScrollSectionInfo(
|
||||
mPrivateProfileAppScrollerBadge, position));
|
||||
int privateSpaceState = mPrivateProviderManager.getCurrentState();
|
||||
@@ -407,6 +413,7 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
hasPrivateApps = appList.stream().
|
||||
allMatch(mPrivateProviderManager.getItemInfoMatcher());
|
||||
}
|
||||
Log.d(TAG, "Adding apps with sections. HasPrivateApps: " + hasPrivateApps);
|
||||
for (int i = 0; i < appList.size(); i++) {
|
||||
AppInfo info = appList.get(i);
|
||||
// Apply decorator to private apps.
|
||||
@@ -421,6 +428,8 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
String sectionName = info.sectionName;
|
||||
// Create a new section if the section names do not match
|
||||
if (!sectionName.equals(lastSectionName)) {
|
||||
Log.d(TAG, "addAppsWithSections: adding sectionName: " + sectionName
|
||||
+ " with appInfoTitle: " + info.title);
|
||||
lastSectionName = sectionName;
|
||||
mFastScrollerSections.add(new FastScrollSectionInfo(hasPrivateApps ?
|
||||
mPrivateProfileAppScrollerBadge : sectionName, position));
|
||||
@@ -471,6 +480,13 @@ public class AlphabeticalAppsList<T extends Context & ActivityContext> implement
|
||||
return mPrivateProviderManager;
|
||||
}
|
||||
|
||||
public void dump(String prefix, PrintWriter writer) {
|
||||
writer.println(prefix + "SectionInfo[] size: " + mFastScrollerSections.size());
|
||||
for (int i = 0; i < mFastScrollerSections.size(); i++) {
|
||||
writer.println("\tFastScrollSection: " + mFastScrollerSections.get(i).sectionName);
|
||||
}
|
||||
}
|
||||
|
||||
private static class MyDiffCallback extends DiffUtil.Callback {
|
||||
|
||||
private final List<AdapterItem> mOldList;
|
||||
|
||||
Reference in new issue
Block a user