MessageCenter extends AirshipComponent { @Nullable public static String parseMessageId(@Nullable Intent intent) { if (intent == null || intent.getData() == null || intent.getAction() == null) { return null; } if (!MESSAGE_DATA_SCHEME.equalsIgnoreCase(intent.getData().getScheme())) { return null; } switch (intent.getAction()) { case VIEW_MESSAGE_CENTER_INTENT_ACTION: case VIEW_MESSAGE_INTENT_ACTION: return intent.getData().getSchemeSpecificPart(); default: return null; } } @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  MessageCenter(@NonNull Context context,
                         @NonNull PreferenceDataStore dataStore,
                         @NonNull AirshipChannel channel,
                         @NonNull PushManager pushManager); @VisibleForTesting @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)  MessageCenter(@NonNull Context context,
                  @NonNull PreferenceDataStore dataStore,
                  @NonNull Inbox inbox,
                  @NonNull PushManager pushManager); @NonNull static MessageCenter shared(); @Override @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @AirshipComponentGroups.Group int getComponentGroup(); @WorkerThread @JobInfo.JobResult @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) int onPerformJob(@NonNull UAirship airship, @NonNull JobInfo jobInfo); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void tearDown(); @NonNull Inbox getInbox(); @NonNull User getUser(); @Nullable Predicate<Message> getPredicate(); void setPredicate(@Nullable Predicate<Message> predicate); void setOnShowMessageCenterListener(@Nullable OnShowMessageCenterListener listener); void showMessageCenter(); void showMessageCenter(@Nullable String messageId); @Nullable static String parseMessageId(@Nullable Intent intent); @NonNull
    static final String VIEW_MESSAGE_CENTER_INTENT_ACTION; @NonNull
    static final String VIEW_MESSAGE_INTENT_ACTION; @NonNull
    static final String MESSAGE_DATA_SCHEME; }
@Test public void testParseMessageId() { Intent intent = new Intent(MessageCenter.VIEW_MESSAGE_INTENT_ACTION, Uri.parse("message:cool")); assertEquals("cool", MessageCenter.parseMessageId(intent)); intent.setAction(MessageCenter.VIEW_MESSAGE_CENTER_INTENT_ACTION); assertEquals("cool", MessageCenter.parseMessageId(intent)); intent.setAction("SOME OTHER ACTION"); assertNull(MessageCenter.parseMessageId(intent)); intent.setAction(MessageCenter.VIEW_MESSAGE_CENTER_INTENT_ACTION); intent.setData(Uri.parse("WHAT")); assertNull(MessageCenter.parseMessageId(intent)); }