PushManager extends AirshipComponent { public void setPushTokenRegistrationEnabled(boolean enabled) { getDataStore().put(PUSH_TOKEN_REGISTRATION_ENABLED_KEY, enabled); airshipChannel.updateRegistration(); } PushManager(@NonNull Context context, @NonNull PreferenceDataStore preferenceDataStore,
                       @NonNull AirshipConfigOptions configOptions, @Nullable PushProvider pushProvider,
                       @NonNull AirshipChannel airshipChannel, @NonNull Analytics analytics); @VisibleForTesting  PushManager(@NonNull Context context, @NonNull PreferenceDataStore preferenceDataStore,
                @NonNull AirshipConfigOptions configOptions, PushProvider provider,
                @NonNull AirshipChannel airshipChannel, @NonNull Analytics analytics,
                @NonNull JobDispatcher dispatcher); @Override @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) @AirshipComponentGroups.Group int getComponentGroup(); @Override @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void onComponentEnableChange(boolean isEnabled); @WorkerThread @JobInfo.JobResult @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) int onPerformJob(@NonNull UAirship airship, @NonNull JobInfo jobInfo); void setPushEnabled(boolean enabled); boolean isPushEnabled(); void setUserNotificationsEnabled(boolean enabled); boolean getUserNotificationsEnabled(); void setNotificationProvider(@Nullable NotificationProvider provider); @Nullable NotificationProvider getNotificationProvider(); @NonNull NotificationChannelRegistry getNotificationChannelRegistry(); @Deprecated boolean isSoundEnabled(); @Deprecated void setSoundEnabled(boolean enabled); @Deprecated boolean isVibrateEnabled(); @Deprecated void setVibrateEnabled(boolean enabled); @Deprecated boolean isQuietTimeEnabled(); @Deprecated void setQuietTimeEnabled(boolean enabled); @Deprecated boolean isInQuietTime(); @Deprecated @Nullable Date[] getQuietTimeInterval(); @Deprecated void setQuietTimeInterval(@NonNull Date startTime, @NonNull Date endTime); boolean isPushAvailable(); boolean isOptIn(); boolean areNotificationsOptedIn(); boolean isPushTokenRegistrationEnabled(); void setPushTokenRegistrationEnabled(boolean enabled); @Nullable String getLastReceivedMetadata(); void setNotificationListener(@Nullable NotificationListener listener); void addPushListener(@NonNull PushListener listener); void removePushListener(@NonNull PushListener listener); void addPushTokenListener(@NonNull PushTokenListener listener); void removePushTokenListener(@NonNull PushTokenListener listener); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) void addInternalNotificationListener(@NonNull InternalNotificationListener listener); @Nullable NotificationListener getNotificationListener(); void addNotificationActionButtonGroup(@NonNull String id, @NonNull NotificationActionButtonGroup group); void addNotificationActionButtonGroups(@NonNull Context context, @XmlRes int resId); void removeNotificationActionButtonGroup(@NonNull String id); @Nullable NotificationActionButtonGroup getNotificationActionGroup(@Nullable String id); @Nullable String getPushToken(); @Nullable @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP) PushProvider getPushProvider(); @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String ACTION_NOTIFICATION_RESPONSE; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String ACTION_NOTIFICATION_DISMISSED; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_ID; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_TAG; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_PUSH_MESSAGE_BUNDLE; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_BUTTON_ID; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_BUTTON_FOREGROUND; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_CONTENT_INTENT; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_DELETE_INTENT; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_ACTION_BUTTON_DESCRIPTION; @RestrictTo(RestrictTo.Scope.LIBRARY_GROUP)
    @NonNull
    static final String EXTRA_NOTIFICATION_BUTTON_ACTIONS_PAYLOAD; }
@Test public void testEnablingTokenRegistrationUpdatesChannel() { pushManager.setPushTokenRegistrationEnabled(true); verify(mockAirshipChannel).updateRegistration(); }