| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
package com.android.wm.shell.bubbles; |
| 18 |
|
| 19 |
import android.content.Context; |
| 20 |
import android.provider.Settings; |
| 21 |
|
| 22 |
import java.util.List; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
public class BubbleDebugConfig { |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
public static final boolean TAG_WITH_CLASS_NAME = false; |
| 37 |
|
| 38 |
|
| 39 |
public static final String TAG_BUBBLES = "Bubbles"; |
| 40 |
|
| 41 |
static final boolean DEBUG_BUBBLE_CONTROLLER = false; |
| 42 |
static final boolean DEBUG_BUBBLE_DATA = false; |
| 43 |
static final boolean DEBUG_BUBBLE_STACK_VIEW = false; |
| 44 |
static final boolean DEBUG_BUBBLE_EXPANDED_VIEW = false; |
| 45 |
static final boolean DEBUG_EXPERIMENTS = true; |
| 46 |
static final boolean DEBUG_OVERFLOW = false; |
| 47 |
static final boolean DEBUG_USER_EDUCATION = false; |
| 48 |
static final boolean DEBUG_POSITIONER = false; |
| 49 |
public static final boolean DEBUG_COLLAPSE_ANIMATOR = false; |
| 50 |
static final boolean DEBUG_BUBBLE_GESTURE = false; |
| 51 |
public static boolean DEBUG_EXPANDED_VIEW_DRAGGING = false; |
| 52 |
|
| 53 |
private static final boolean FORCE_SHOW_USER_EDUCATION = false; |
| 54 |
private static final String FORCE_SHOW_USER_EDUCATION_SETTING = |
| 55 |
"force_show_bubbles_user_education"; |
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
static boolean forceShowUserEducation(Context context) { |
| 61 |
boolean forceShow = Settings.Secure.getInt(context.getContentResolver(), |
| 62 |
FORCE_SHOW_USER_EDUCATION_SETTING, 0) != 0; |
| 63 |
return FORCE_SHOW_USER_EDUCATION || forceShow; |
| 64 |
} |
| 65 |
|
| 66 |
static String formatBubblesString(List<Bubble> bubbles, BubbleViewProvider selected) { |
| 67 |
StringBuilder sb = new StringBuilder(); |
| 68 |
for (Bubble bubble : bubbles) { |
| 69 |
if (bubble == null) { |
| 70 |
sb.append(" <null> !!!!!\n"); |
| 71 |
} else { |
| 72 |
boolean isSelected = (selected != null |
| 73 |
&& selected.getKey() != BubbleOverflow.KEY |
| 74 |
&& bubble == selected); |
| 75 |
String arrow = isSelected ? "=>" : " "; |
| 76 |
sb.append(String.format("%s Bubble{act=%12d, showInShade=%d, key=%s}\n", |
| 77 |
arrow, |
| 78 |
bubble.getLastActivity(), |
| 79 |
(bubble.showInShade() ? 1 : 0), |
| 80 |
bubble.getKey())); |
| 81 |
} |
| 82 |
} |
| 83 |
return sb.toString(); |
| 84 |
} |
| 85 |
} |