Loading packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ public class PeopleSpaceUtils { CharSequence content = (isMissedCall && !hasMessageText) ? context.getString(R.string.missed_call) : message.getText(); Uri dataUri = message != null ? message.getDataUri() : null; if (DEBUG) Log.d(TAG, "Notification message has text: " + hasMessageText); return tile .toBuilder() Loading packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java +3 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,7 @@ class PeopleTileViewHelper { statusText = getStatusTextByType(status.getActivity()); } views.setViewVisibility(R.id.predefined_icon, View.VISIBLE); views.setViewVisibility(R.id.messages_count, View.GONE); setMaxLines(views); // Secondary text color for statuses. TypedValue typedValue = new TypedValue(); Loading Loading @@ -530,6 +531,7 @@ class PeopleTileViewHelper { if (mLayoutSize == LAYOUT_SMALL) { views.setViewVisibility(R.id.predefined_icon, View.VISIBLE); views.setViewVisibility(R.id.name, View.GONE); views.setViewVisibility(R.id.messages_count, View.GONE); } else { views.setViewVisibility(R.id.predefined_icon, View.GONE); views.setViewVisibility(R.id.name, View.VISIBLE); Loading @@ -544,6 +546,7 @@ class PeopleTileViewHelper { if (mLayoutSize == LAYOUT_SMALL) { views.setViewVisibility(R.id.name, View.VISIBLE); views.setViewVisibility(R.id.predefined_icon, View.GONE); views.setViewVisibility(R.id.messages_count, View.GONE); } String status = PeopleSpaceUtils.getLastInteractionString(mContext, mTile.getLastInteractionTimestamp()); Loading packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ public class PeopleSpaceWidgetManager { updateTilesByUri(key, sbn, action); } } catch (Exception e) { Log.e(TAG, "Exception: " + e); Log.e(TAG, "Throwing exception: " + e); } } Loading Loading @@ -498,7 +498,7 @@ public class PeopleSpaceWidgetManager { if (notificationAction == PeopleSpaceUtils.NotificationAction.POSTED) { if (DEBUG) Log.i(TAG, "Adding notification to storage, appWidgetId: " + appWidgetId); storedTile = augmentTileFromNotification(mContext, storedTile, sbn); } else if (storedTile.getNotificationKey().equals(sbn.getKey())) { } else if (Objects.equals(storedTile.getNotificationKey(), sbn.getKey())) { if (DEBUG) { Log.i(TAG, "Removing notification from storage, appWidgetId: " + appWidgetId); } Loading packages/SystemUI/tests/src/com/android/systemui/people/PeopleTileViewHelperTest.java +15 −4 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { assertEquals(View.GONE, smallResult.findViewById(R.id.predefined_icon).getVisibility()); // Shows person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -220,6 +223,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -281,6 +286,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -342,6 +349,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -404,6 +413,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { smallResult.findViewById(R.id.predefined_icon).getVisibility()); // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -471,7 +482,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { smallResult.findViewById(R.id.person_icon).getVisibility()); // Has a single message, no count shown. assertEquals(View.GONE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading @@ -497,7 +508,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { assertThat(statusContent.getMaxLines()).isEqualTo(3); // Has a single message, no count shown. assertEquals(View.GONE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.GONE, largeResult.findViewById(R.id.messages_count).getVisibility()); } Loading Loading @@ -544,7 +555,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { smallResult.findViewById(R.id.person_icon).getVisibility()); // Has two messages, show count. assertEquals(View.VISIBLE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.VISIBLE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading @@ -570,7 +581,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { assertThat(statusContent.getMaxLines()).isEqualTo(3); // Has two messages, show count. assertEquals(View.VISIBLE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.VISIBLE, largeResult.findViewById(R.id.messages_count).getVisibility()); } Loading Loading
packages/SystemUI/src/com/android/systemui/people/PeopleSpaceUtils.java +1 −0 Original line number Diff line number Diff line Loading @@ -319,6 +319,7 @@ public class PeopleSpaceUtils { CharSequence content = (isMissedCall && !hasMessageText) ? context.getString(R.string.missed_call) : message.getText(); Uri dataUri = message != null ? message.getDataUri() : null; if (DEBUG) Log.d(TAG, "Notification message has text: " + hasMessageText); return tile .toBuilder() Loading
packages/SystemUI/src/com/android/systemui/people/PeopleTileViewHelper.java +3 −0 Original line number Diff line number Diff line Loading @@ -391,6 +391,7 @@ class PeopleTileViewHelper { statusText = getStatusTextByType(status.getActivity()); } views.setViewVisibility(R.id.predefined_icon, View.VISIBLE); views.setViewVisibility(R.id.messages_count, View.GONE); setMaxLines(views); // Secondary text color for statuses. TypedValue typedValue = new TypedValue(); Loading Loading @@ -530,6 +531,7 @@ class PeopleTileViewHelper { if (mLayoutSize == LAYOUT_SMALL) { views.setViewVisibility(R.id.predefined_icon, View.VISIBLE); views.setViewVisibility(R.id.name, View.GONE); views.setViewVisibility(R.id.messages_count, View.GONE); } else { views.setViewVisibility(R.id.predefined_icon, View.GONE); views.setViewVisibility(R.id.name, View.VISIBLE); Loading @@ -544,6 +546,7 @@ class PeopleTileViewHelper { if (mLayoutSize == LAYOUT_SMALL) { views.setViewVisibility(R.id.name, View.VISIBLE); views.setViewVisibility(R.id.predefined_icon, View.GONE); views.setViewVisibility(R.id.messages_count, View.GONE); } String status = PeopleSpaceUtils.getLastInteractionString(mContext, mTile.getLastInteractionTimestamp()); Loading
packages/SystemUI/src/com/android/systemui/people/widget/PeopleSpaceWidgetManager.java +2 −2 Original line number Diff line number Diff line Loading @@ -285,7 +285,7 @@ public class PeopleSpaceWidgetManager { updateTilesByUri(key, sbn, action); } } catch (Exception e) { Log.e(TAG, "Exception: " + e); Log.e(TAG, "Throwing exception: " + e); } } Loading Loading @@ -498,7 +498,7 @@ public class PeopleSpaceWidgetManager { if (notificationAction == PeopleSpaceUtils.NotificationAction.POSTED) { if (DEBUG) Log.i(TAG, "Adding notification to storage, appWidgetId: " + appWidgetId); storedTile = augmentTileFromNotification(mContext, storedTile, sbn); } else if (storedTile.getNotificationKey().equals(sbn.getKey())) { } else if (Objects.equals(storedTile.getNotificationKey(), sbn.getKey())) { if (DEBUG) { Log.i(TAG, "Removing notification from storage, appWidgetId: " + appWidgetId); } Loading
packages/SystemUI/tests/src/com/android/systemui/people/PeopleTileViewHelperTest.java +15 −4 Original line number Diff line number Diff line Loading @@ -162,6 +162,9 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { assertEquals(View.GONE, smallResult.findViewById(R.id.predefined_icon).getVisibility()); // Shows person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -220,6 +223,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -281,6 +286,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -342,6 +349,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -404,6 +413,8 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { smallResult.findViewById(R.id.predefined_icon).getVisibility()); // Has person icon. assertEquals(View.VISIBLE, smallResult.findViewById(R.id.person_icon).getVisibility()); // No messages count. assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading Loading @@ -471,7 +482,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { smallResult.findViewById(R.id.person_icon).getVisibility()); // Has a single message, no count shown. assertEquals(View.GONE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.GONE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading @@ -497,7 +508,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { assertThat(statusContent.getMaxLines()).isEqualTo(3); // Has a single message, no count shown. assertEquals(View.GONE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.GONE, largeResult.findViewById(R.id.messages_count).getVisibility()); } Loading Loading @@ -544,7 +555,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { smallResult.findViewById(R.id.person_icon).getVisibility()); // Has two messages, show count. assertEquals(View.VISIBLE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.VISIBLE, smallResult.findViewById(R.id.messages_count).getVisibility()); mOptions.putInt(OPTION_APPWIDGET_MIN_WIDTH, getSizeInDp(R.dimen.required_width_for_large)); Loading @@ -570,7 +581,7 @@ public class PeopleTileViewHelperTest extends SysuiTestCase { assertThat(statusContent.getMaxLines()).isEqualTo(3); // Has two messages, show count. assertEquals(View.VISIBLE, result.findViewById(R.id.messages_count).getVisibility()); assertEquals(View.VISIBLE, largeResult.findViewById(R.id.messages_count).getVisibility()); } Loading