1 /* 2 * Copyright (C) 2019 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.launcher3.hybridhotseat; 17 18 import static com.android.launcher3.LauncherAnimUtils.SCALE_PROPERTY; 19 import static com.android.launcher3.LauncherState.NORMAL; 20 import static com.android.launcher3.anim.AnimatorListeners.forSuccessCallback; 21 import static com.android.launcher3.hybridhotseat.HotseatEduController.getSettingsIntent; 22 import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_PREDICTION_PINNED; 23 import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_HOTSEAT_RANKED; 24 import static com.android.launcher3.util.Executors.MAIN_EXECUTOR; 25 import static com.android.launcher3.util.FlagDebugUtils.appendFlag; 26 import static com.android.launcher3.util.OnboardingPrefs.HOTSEAT_LONGPRESS_TIP_SEEN; 27 28 import android.animation.Animator; 29 import android.animation.AnimatorSet; 30 import android.animation.ObjectAnimator; 31 import android.content.ComponentName; 32 import android.util.Log; 33 import android.view.HapticFeedbackConstants; 34 import android.view.View; 35 import android.view.ViewGroup; 36 37 import androidx.annotation.NonNull; 38 import androidx.annotation.Nullable; 39 import androidx.annotation.VisibleForTesting; 40 41 import com.android.launcher3.DeviceProfile; 42 import com.android.launcher3.DragSource; 43 import com.android.launcher3.DropTarget; 44 import com.android.launcher3.Flags; 45 import com.android.launcher3.Hotseat; 46 import com.android.launcher3.LauncherPrefs; 47 import com.android.launcher3.LauncherSettings; 48 import com.android.launcher3.R; 49 import com.android.launcher3.anim.AnimationSuccessListener; 50 import com.android.launcher3.dragndrop.DragController; 51 import com.android.launcher3.dragndrop.DragOptions; 52 import com.android.launcher3.graphics.DragPreviewProvider; 53 import com.android.launcher3.logger.LauncherAtom.ContainerInfo; 54 import com.android.launcher3.logger.LauncherAtom.PredictedHotseatContainer; 55 import com.android.launcher3.logging.InstanceId; 56 import com.android.launcher3.model.BgDataModel.FixedContainerItems; 57 import com.android.launcher3.model.data.ItemInfo; 58 import com.android.launcher3.model.data.WorkspaceItemInfo; 59 import com.android.launcher3.pm.UserCache; 60 import com.android.launcher3.popup.SystemShortcut; 61 import com.android.launcher3.testing.TestLogging; 62 import com.android.launcher3.testing.shared.TestProtocol; 63 import com.android.launcher3.touch.ItemLongClickListener; 64 import com.android.launcher3.uioverrides.PredictedAppIcon; 65 import com.android.launcher3.uioverrides.QuickstepLauncher; 66 import com.android.launcher3.views.Snackbar; 67 68 import java.io.PrintWriter; 69 import java.util.ArrayList; 70 import java.util.Collections; 71 import java.util.List; 72 import java.util.StringJoiner; 73 import java.util.function.Predicate; 74 import java.util.stream.Collectors; 75 76 /** 77 * Provides prediction ability for the hotseat. Fills gaps in hotseat with predicted items, allows 78 * pinning of predicted apps and manages replacement of predicted apps with user drag. 79 */ 80 public class HotseatPredictionController implements DragController.DragListener, 81 SystemShortcut.Factory<QuickstepLauncher>, DeviceProfile.OnDeviceProfileChangeListener, 82 DragSource, ViewGroup.OnHierarchyChangeListener { 83 84 private static final String TAG = "HotseatPredictionController"; 85 private static final int FLAG_UPDATE_PAUSED = 1 << 0; 86 private static final int FLAG_DRAG_IN_PROGRESS = 1 << 1; 87 private static final int FLAG_FILL_IN_PROGRESS = 1 << 2; 88 private static final int FLAG_REMOVING_PREDICTED_ICON = 1 << 3; 89 90 private int mHotSeatItemsCount; 91 92 private QuickstepLauncher mLauncher; 93 private final Hotseat mHotseat; 94 private final Runnable mUpdateFillIfNotLoading = this::updateFillIfNotLoading; 95 96 private List<ItemInfo> mPredictedItems = Collections.emptyList(); 97 98 private AnimatorSet mIconRemoveAnimators; 99 private int mPauseFlags = 0; 100 101 private List<PredictedAppIcon.PredictedIconOutlineDrawing> mOutlineDrawings = new ArrayList<>(); 102 103 private boolean mEnableHotseatLongPressTipForTesting = true; 104 105 private final View.OnLongClickListener mPredictionLongClickListener = v -> { 106 if (!ItemLongClickListener.canStartDrag(mLauncher)) return false; 107 if (mLauncher.getWorkspace().isSwitchingState()) return false; 108 109 TestLogging.recordEvent(TestProtocol.SEQUENCE_MAIN, "onWorkspaceItemLongClick"); 110 if (mEnableHotseatLongPressTipForTesting && !HOTSEAT_LONGPRESS_TIP_SEEN.get(mLauncher)) { 111 Snackbar.show(mLauncher, R.string.hotseat_tip_gaps_filled, 112 R.string.hotseat_prediction_settings, null, 113 () -> mLauncher.startActivity(getSettingsIntent())); 114 LauncherPrefs.get(mLauncher).put(HOTSEAT_LONGPRESS_TIP_SEEN, true); 115 mLauncher.getDragLayer().performHapticFeedback(HapticFeedbackConstants.LONG_PRESS); 116 return true; 117 } 118 119 // Start the drag 120 // Use a new itemInfo so that the original predicted item is stable 121 WorkspaceItemInfo dragItem = new WorkspaceItemInfo((WorkspaceItemInfo) v.getTag()); 122 v.setVisibility(View.INVISIBLE); 123 mLauncher.getWorkspace().beginDragShared( 124 v, null, this, dragItem, new DragPreviewProvider(v), new DragOptions()); 125 return true; 126 }; 127 HotseatPredictionController(QuickstepLauncher launcher)128 public HotseatPredictionController(QuickstepLauncher launcher) { 129 mLauncher = launcher; 130 mHotseat = launcher.getHotseat(); 131 mHotSeatItemsCount = mLauncher.getDeviceProfile().numShownHotseatIcons; 132 mLauncher.getDragController().addDragListener(this); 133 134 launcher.addOnDeviceProfileChangeListener(this); 135 mHotseat.getShortcutsAndWidgets().setOnHierarchyChangeListener(this); 136 } 137 138 @Override onChildViewAdded(View parent, View child)139 public void onChildViewAdded(View parent, View child) { 140 onHotseatHierarchyChanged(); 141 } 142 143 @Override onChildViewRemoved(View parent, View child)144 public void onChildViewRemoved(View parent, View child) { 145 onHotseatHierarchyChanged(); 146 } 147 148 /** Enables/disabled the hotseat prediction icon long press edu for testing. */ 149 @VisibleForTesting enableHotseatEdu(boolean enable)150 public void enableHotseatEdu(boolean enable) { 151 mEnableHotseatLongPressTipForTesting = enable; 152 } 153 onHotseatHierarchyChanged()154 private void onHotseatHierarchyChanged() { 155 if (mPauseFlags == 0 && !mLauncher.isWorkspaceLoading()) { 156 // Post update after a single frame to avoid layout within layout 157 MAIN_EXECUTOR.getHandler().removeCallbacks(mUpdateFillIfNotLoading); 158 MAIN_EXECUTOR.getHandler().post(mUpdateFillIfNotLoading); 159 } 160 } 161 updateFillIfNotLoading()162 private void updateFillIfNotLoading() { 163 if (mPauseFlags == 0 && !mLauncher.isWorkspaceLoading()) { 164 fillGapsWithPrediction(true); 165 } 166 } 167 168 /** 169 * Shows appropriate hotseat education based on prediction enabled and migration states. 170 */ showEdu()171 public void showEdu() { 172 mLauncher.getStateManager().goToState(NORMAL, true, forSuccessCallback(() -> { 173 HotseatEduController eduController = new HotseatEduController(mLauncher); 174 eduController.setPredictedApps(mPredictedItems.stream() 175 .map(i -> (WorkspaceItemInfo) i) 176 .collect(Collectors.toList())); 177 eduController.showEdu(); 178 })); 179 } 180 181 /** 182 * Returns if hotseat client has predictions 183 */ hasPredictions()184 public boolean hasPredictions() { 185 return !mPredictedItems.isEmpty(); 186 } 187 fillGapsWithPrediction()188 private void fillGapsWithPrediction() { 189 fillGapsWithPrediction(false); 190 } 191 fillGapsWithPrediction(boolean animate)192 private void fillGapsWithPrediction(boolean animate) { 193 if (mPauseFlags != 0) { 194 return; 195 } 196 197 int predictionIndex = 0; 198 int numViewsAnimated = 0; 199 ArrayList<WorkspaceItemInfo> newItems = new ArrayList<>(); 200 // make sure predicted icon removal and filling predictions don't step on each other 201 if (mIconRemoveAnimators != null && mIconRemoveAnimators.isRunning()) { 202 mIconRemoveAnimators.addListener(new AnimationSuccessListener() { 203 @Override 204 public void onAnimationSuccess(Animator animator) { 205 fillGapsWithPrediction(animate); 206 mIconRemoveAnimators.removeListener(this); 207 } 208 }); 209 return; 210 } 211 212 mPauseFlags |= FLAG_FILL_IN_PROGRESS; 213 for (int rank = 0; rank < mHotSeatItemsCount; rank++) { 214 View child = mHotseat.getChildAt( 215 mHotseat.getCellXFromOrder(rank), 216 mHotseat.getCellYFromOrder(rank)); 217 218 if (child != null && !isPredictedIcon(child)) { 219 continue; 220 } 221 if (mPredictedItems.size() <= predictionIndex) { 222 // Remove predicted apps from the past 223 if (isPredictedIcon(child)) { 224 mHotseat.removeView(child); 225 } 226 continue; 227 } 228 WorkspaceItemInfo predictedItem = 229 (WorkspaceItemInfo) mPredictedItems.get(predictionIndex++); 230 if (isPredictedIcon(child) && child.isEnabled()) { 231 PredictedAppIcon icon = (PredictedAppIcon) child; 232 if (icon.applyFromWorkspaceItemWithAnimation(predictedItem, numViewsAnimated)) { 233 numViewsAnimated++; 234 } 235 icon.finishBinding(mPredictionLongClickListener); 236 } else { 237 newItems.add(predictedItem); 238 } 239 preparePredictionInfo(predictedItem, rank); 240 } 241 bindItems(newItems, animate); 242 243 mPauseFlags &= ~FLAG_FILL_IN_PROGRESS; 244 } 245 bindItems(List<WorkspaceItemInfo> itemsToAdd, boolean animate)246 private void bindItems(List<WorkspaceItemInfo> itemsToAdd, boolean animate) { 247 AnimatorSet animationSet = new AnimatorSet(); 248 for (WorkspaceItemInfo item : itemsToAdd) { 249 PredictedAppIcon icon = PredictedAppIcon.createIcon(mHotseat, item); 250 mLauncher.getWorkspace().addInScreenFromBind(icon, item); 251 icon.finishBinding(mPredictionLongClickListener); 252 if (animate) { 253 animationSet.play(ObjectAnimator.ofFloat(icon, SCALE_PROPERTY, 0.2f, 1)); 254 } 255 } 256 if (animate) { 257 animationSet.addListener( 258 forSuccessCallback(this::removeOutlineDrawings)); 259 animationSet.start(); 260 } else { 261 removeOutlineDrawings(); 262 } 263 } 264 removeOutlineDrawings()265 private void removeOutlineDrawings() { 266 if (mOutlineDrawings.isEmpty()) return; 267 for (PredictedAppIcon.PredictedIconOutlineDrawing outlineDrawing : mOutlineDrawings) { 268 mHotseat.removeDelegatedCellDrawing(outlineDrawing); 269 } 270 mHotseat.invalidate(); 271 mOutlineDrawings.clear(); 272 } 273 274 275 /** 276 * Unregisters callbacks and frees resources 277 */ destroy()278 public void destroy() { 279 mLauncher.removeOnDeviceProfileChangeListener(this); 280 } 281 282 /** 283 * start and pauses predicted apps update on the hotseat 284 */ setPauseUIUpdate(boolean paused)285 public void setPauseUIUpdate(boolean paused) { 286 mPauseFlags = paused 287 ? (mPauseFlags | FLAG_UPDATE_PAUSED) 288 : (mPauseFlags & ~FLAG_UPDATE_PAUSED); 289 if (!paused) { 290 fillGapsWithPrediction(); 291 } 292 } 293 294 /** 295 * Ensures that if the flag FLAG_UPDATE_PAUSED is active we set it to false. 296 */ verifyUIUpdateNotPaused()297 public void verifyUIUpdateNotPaused() { 298 if ((mPauseFlags & FLAG_UPDATE_PAUSED) != 0) { 299 setPauseUIUpdate(false); 300 Log.e(TAG, "FLAG_UPDATE_PAUSED should not be set to true (see b/339700174)"); 301 } 302 } 303 304 /** 305 * Sets or updates the predicted items 306 */ setPredictedItems(FixedContainerItems items)307 public void setPredictedItems(FixedContainerItems items) { 308 mPredictedItems = new ArrayList(items.items); 309 if (mPredictedItems.isEmpty()) { 310 HotseatRestoreHelper.restoreBackup(mLauncher); 311 } 312 fillGapsWithPrediction(); 313 } 314 315 /** 316 * Pins a predicted app icon into place. 317 */ pinPrediction(ItemInfo info)318 public void pinPrediction(ItemInfo info) { 319 PredictedAppIcon icon = (PredictedAppIcon) mHotseat.getChildAt( 320 mHotseat.getCellXFromOrder(info.rank), 321 mHotseat.getCellYFromOrder(info.rank)); 322 if (icon == null) { 323 return; 324 } 325 WorkspaceItemInfo workspaceItemInfo = new WorkspaceItemInfo((WorkspaceItemInfo) info); 326 mLauncher.getModelWriter().addItemToDatabase(workspaceItemInfo, 327 LauncherSettings.Favorites.CONTAINER_HOTSEAT, workspaceItemInfo.screenId, 328 workspaceItemInfo.cellX, workspaceItemInfo.cellY); 329 ObjectAnimator.ofFloat(icon, SCALE_PROPERTY, 1, 0.8f, 1).start(); 330 icon.pin(workspaceItemInfo); 331 mLauncher.getStatsLogManager().logger() 332 .withItemInfo(workspaceItemInfo) 333 .log(LAUNCHER_HOTSEAT_PREDICTION_PINNED); 334 } 335 getPredictedIcons()336 private List<PredictedAppIcon> getPredictedIcons() { 337 List<PredictedAppIcon> icons = new ArrayList<>(); 338 ViewGroup vg = mHotseat.getShortcutsAndWidgets(); 339 for (int i = 0; i < vg.getChildCount(); i++) { 340 View child = vg.getChildAt(i); 341 if (isPredictedIcon(child)) { 342 icons.add((PredictedAppIcon) child); 343 } 344 } 345 return icons; 346 } 347 removePredictedApps(List<PredictedAppIcon.PredictedIconOutlineDrawing> outlines, DropTarget.DragObject dragObject)348 private void removePredictedApps(List<PredictedAppIcon.PredictedIconOutlineDrawing> outlines, 349 DropTarget.DragObject dragObject) { 350 if (mIconRemoveAnimators != null) { 351 mIconRemoveAnimators.end(); 352 } 353 mIconRemoveAnimators = new AnimatorSet(); 354 removeOutlineDrawings(); 355 for (PredictedAppIcon icon : getPredictedIcons()) { 356 if (!icon.isEnabled()) { 357 continue; 358 } 359 if (dragObject.dragSource == this && icon.equals(dragObject.originalView)) { 360 removeIconWithoutNotify(icon); 361 continue; 362 } 363 int rank = ((WorkspaceItemInfo) icon.getTag()).rank; 364 outlines.add(new PredictedAppIcon.PredictedIconOutlineDrawing( 365 mHotseat.getCellXFromOrder(rank), mHotseat.getCellYFromOrder(rank), icon)); 366 icon.setEnabled(false); 367 ObjectAnimator animator = ObjectAnimator.ofFloat(icon, SCALE_PROPERTY, 0); 368 animator.addListener(new AnimationSuccessListener() { 369 @Override 370 public void onAnimationSuccess(Animator animator) { 371 if (icon.getParent() != null) { 372 removeIconWithoutNotify(icon); 373 } 374 } 375 }); 376 mIconRemoveAnimators.play(animator); 377 } 378 mIconRemoveAnimators.start(); 379 } 380 381 /** 382 * Removes icon while suppressing any extra tasks performed on view-hierarchy changes. 383 * This avoids recursive/redundant updates as the control updates the UI anyway after 384 * it's animation. 385 */ removeIconWithoutNotify(PredictedAppIcon icon)386 private void removeIconWithoutNotify(PredictedAppIcon icon) { 387 mPauseFlags |= FLAG_REMOVING_PREDICTED_ICON; 388 mHotseat.removeView(icon); 389 mPauseFlags &= ~FLAG_REMOVING_PREDICTED_ICON; 390 } 391 392 @Override onDragStart(DropTarget.DragObject dragObject, DragOptions options)393 public void onDragStart(DropTarget.DragObject dragObject, DragOptions options) { 394 removePredictedApps(mOutlineDrawings, dragObject); 395 if (mOutlineDrawings.isEmpty()) return; 396 for (PredictedAppIcon.PredictedIconOutlineDrawing outlineDrawing : mOutlineDrawings) { 397 mHotseat.addDelegatedCellDrawing(outlineDrawing); 398 } 399 mPauseFlags |= FLAG_DRAG_IN_PROGRESS; 400 mHotseat.invalidate(); 401 } 402 403 @Override onDragEnd()404 public void onDragEnd() { 405 mPauseFlags &= ~FLAG_DRAG_IN_PROGRESS; 406 fillGapsWithPrediction(true); 407 } 408 409 @Nullable 410 @Override getShortcut(QuickstepLauncher activity, ItemInfo itemInfo, View originalView)411 public SystemShortcut<QuickstepLauncher> getShortcut(QuickstepLauncher activity, 412 ItemInfo itemInfo, View originalView) { 413 if (itemInfo.container != LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) { 414 return null; 415 } 416 if (Flags.enablePrivateSpace() && UserCache.getInstance( 417 activity.getApplicationContext()).getUserInfo(itemInfo.user).isPrivate()) { 418 return null; 419 } 420 return new PinPrediction(activity, itemInfo, originalView); 421 } 422 preparePredictionInfo(WorkspaceItemInfo itemInfo, int rank)423 private void preparePredictionInfo(WorkspaceItemInfo itemInfo, int rank) { 424 itemInfo.container = LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION; 425 itemInfo.rank = rank; 426 itemInfo.cellX = mHotseat.getCellXFromOrder(rank); 427 itemInfo.cellY = mHotseat.getCellYFromOrder(rank); 428 itemInfo.screenId = rank; 429 } 430 431 @Override onDeviceProfileChanged(DeviceProfile profile)432 public void onDeviceProfileChanged(DeviceProfile profile) { 433 this.mHotSeatItemsCount = profile.numShownHotseatIcons; 434 } 435 436 @Override onDropCompleted(View target, DropTarget.DragObject d, boolean success)437 public void onDropCompleted(View target, DropTarget.DragObject d, boolean success) { 438 //Does nothing 439 } 440 441 /** 442 * Logs rank info based on current list of predicted items 443 */ logLaunchedAppRankingInfo(@onNull ItemInfo itemInfo, InstanceId instanceId)444 public void logLaunchedAppRankingInfo(@NonNull ItemInfo itemInfo, InstanceId instanceId) { 445 ComponentName targetCN = itemInfo.getTargetComponent(); 446 if (targetCN == null) { 447 return; 448 } 449 int rank = -1; 450 for (int i = mPredictedItems.size() - 1; i >= 0; i--) { 451 ItemInfo info = mPredictedItems.get(i); 452 if (targetCN.equals(info.getTargetComponent()) && itemInfo.user.equals(info.user)) { 453 rank = i; 454 break; 455 } 456 } 457 if (rank < 0) { 458 return; 459 } 460 461 int cardinality = 0; 462 for (PredictedAppIcon icon : getPredictedIcons()) { 463 ItemInfo info = (ItemInfo) icon.getTag(); 464 cardinality |= 1 << info.screenId; 465 } 466 467 PredictedHotseatContainer.Builder containerBuilder = PredictedHotseatContainer.newBuilder(); 468 containerBuilder.setCardinality(cardinality); 469 if (itemInfo.container == LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION) { 470 containerBuilder.setIndex(rank); 471 } 472 mLauncher.getStatsLogManager().logger() 473 .withInstanceId(instanceId) 474 .withRank(rank) 475 .withContainerInfo(ContainerInfo.newBuilder() 476 .setPredictedHotseatContainer(containerBuilder) 477 .build()) 478 .log(LAUNCHER_HOTSEAT_RANKED); 479 } 480 481 /** 482 * Called when app/shortcut icon is removed by system. This is used to prune visible stale 483 * predictions while while waiting for AppAPrediction service to send new batch of predictions. 484 * 485 * @param matcher filter matching items that have been removed 486 */ onModelItemsRemoved(Predicate<ItemInfo> matcher)487 public void onModelItemsRemoved(Predicate<ItemInfo> matcher) { 488 if (mPredictedItems.removeIf(matcher)) { 489 fillGapsWithPrediction(true); 490 } 491 } 492 493 /** 494 * Called when user completes adding item requiring a config activity to the hotseat 495 */ onDeferredDrop(int cellX, int cellY)496 public void onDeferredDrop(int cellX, int cellY) { 497 View child = mHotseat.getChildAt(cellX, cellY); 498 if (child instanceof PredictedAppIcon) { 499 removeIconWithoutNotify((PredictedAppIcon) child); 500 } 501 } 502 503 private class PinPrediction extends SystemShortcut<QuickstepLauncher> { 504 PinPrediction(QuickstepLauncher target, ItemInfo itemInfo, View originalView)505 private PinPrediction(QuickstepLauncher target, ItemInfo itemInfo, View originalView) { 506 super(R.drawable.ic_pin, R.string.pin_prediction, target, 507 itemInfo, originalView); 508 } 509 510 @Override onClick(View view)511 public void onClick(View view) { 512 dismissTaskMenuView(); 513 pinPrediction(mItemInfo); 514 } 515 } 516 isPredictedIcon(View view)517 private static boolean isPredictedIcon(View view) { 518 return view instanceof PredictedAppIcon && view.getTag() instanceof WorkspaceItemInfo 519 && ((WorkspaceItemInfo) view.getTag()).container 520 == LauncherSettings.Favorites.CONTAINER_HOTSEAT_PREDICTION; 521 } 522 getStateString(int flags)523 private static String getStateString(int flags) { 524 StringJoiner str = new StringJoiner("|"); 525 appendFlag(str, flags, FLAG_UPDATE_PAUSED, "FLAG_UPDATE_PAUSED"); 526 appendFlag(str, flags, FLAG_DRAG_IN_PROGRESS, "FLAG_DRAG_IN_PROGRESS"); 527 appendFlag(str, flags, FLAG_FILL_IN_PROGRESS, "FLAG_FILL_IN_PROGRESS"); 528 appendFlag(str, flags, FLAG_REMOVING_PREDICTED_ICON, 529 "FLAG_REMOVING_PREDICTED_ICON"); 530 return str.toString(); 531 } 532 dump(String prefix, PrintWriter writer)533 public void dump(String prefix, PrintWriter writer) { 534 writer.println(prefix + "HotseatPredictionController"); 535 writer.println(prefix + "\tFlags: " + getStateString(mPauseFlags)); 536 writer.println(prefix + "\tmHotSeatItemsCount: " + mHotSeatItemsCount); 537 writer.println(prefix + "\tmPredictedItems: " + mPredictedItems.size()); 538 for (ItemInfo info : mPredictedItems) { 539 writer.println(prefix + "\t\t" + info); 540 } 541 } 542 } 543