use of androidx.core.app.TaskStackBuilder in project android-oss by kickstarter.
the class PushNotifications method projectUpdateContentIntent.
@NonNull
private PendingIntent projectUpdateContentIntent(@NonNull final PushNotificationEnvelope envelope, @NonNull final Update update, @NonNull final String projectParam) {
final Intent projectIntent = IntentExtKt.getProjectIntent(new Intent(), this.context).putExtra(IntentKey.PROJECT_PARAM, projectParam).putExtra(IntentKey.REF_TAG, RefTag.push());
final Intent updateIntent = new Intent(this.context, UpdateActivity.class).putExtra(IntentKey.PROJECT_PARAM, projectParam).putExtra(IntentKey.UPDATE, update).putExtra(IntentKey.PUSH_NOTIFICATION_ENVELOPE, envelope);
final TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(this.context).addNextIntentWithParentStack(projectIntent).addNextIntent(updateIntent);
return taskStackBuilder.getPendingIntent(envelope.signature(), PendingIntent.FLAG_IMMUTABLE);
}
use of androidx.core.app.TaskStackBuilder in project android-oss by kickstarter.
the class PushNotifications method messageThreadIntent.
@VisibleForTesting
@NonNull
public PendingIntent messageThreadIntent(@NonNull final PushNotificationEnvelope envelope, @NonNull final MessageThread messageThread) {
this.messageThreadIntent = new Intent(this.context, MessagesActivity.class).putExtra(IntentKey.MESSAGE_THREAD, messageThread).putExtra(IntentKey.MESSAGE_SCREEN_SOURCE_CONTEXT, MessagePreviousScreenType.PUSH);
final TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(this.context).addNextIntentWithParentStack(this.messageThreadIntent);
return taskStackBuilder.getPendingIntent(envelope.signature(), PendingIntent.FLAG_IMMUTABLE);
}
use of androidx.core.app.TaskStackBuilder in project android-oss by kickstarter.
the class PushNotifications method friendFollowActivityIntent.
@NonNull
private PendingIntent friendFollowActivityIntent(@NonNull final PushNotificationEnvelope envelope) {
final Intent messageThreadIntent = new Intent(this.context, ActivityFeedActivity.class);
final TaskStackBuilder taskStackBuilder = TaskStackBuilder.create(this.context).addNextIntentWithParentStack(messageThreadIntent);
return taskStackBuilder.getPendingIntent(envelope.signature(), PendingIntent.FLAG_IMMUTABLE);
}
use of androidx.core.app.TaskStackBuilder in project Signal-Android by signalapp.
the class ShortcutLauncherActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String rawId = getIntent().getStringExtra(KEY_RECIPIENT);
if (rawId == null) {
Toast.makeText(this, R.string.ShortcutLauncherActivity_invalid_shortcut, Toast.LENGTH_SHORT).show();
// TODO [greyson] Navigation
startActivity(MainActivity.clearTop(this));
finish();
return;
}
Recipient recipient = Recipient.live(RecipientId.from(rawId)).get();
// TODO [greyson] Navigation
TaskStackBuilder backStack = TaskStackBuilder.create(this).addNextIntent(MainActivity.clearTop(this));
CommunicationActions.startConversation(this, recipient, null, backStack);
finish();
}
use of androidx.core.app.TaskStackBuilder in project android_packages_apps_Settings by omnirom.
the class SimActivationNotifier method sendEnableDsdsNotification.
/**
* Sends a push notification for enabling DSDS.
*/
public void sendEnableDsdsNotification() {
Intent parentIntent = new Intent(mContext, Settings.MobileNetworkListActivity.class);
Intent clickIntent = new Intent(mContext, DsdsDialogActivity.class);
TaskStackBuilder stackBuilder = TaskStackBuilder.create(mContext).addNextIntentWithParentStack(parentIntent).addNextIntent(clickIntent);
PendingIntent contentIntent = stackBuilder.getPendingIntent(0, /* requestCode */
PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_IMMUTABLE);
Notification.Builder builder = new Notification.Builder(mContext, SIM_SETUP_CHANNEL_ID).setContentTitle(mContext.getString(R.string.dsds_notification_after_suw_title)).setContentText(mContext.getString(R.string.dsds_notification_after_suw_text)).setContentIntent(contentIntent).setSmallIcon(R.drawable.ic_sim_alert).setAutoCancel(true);
mNotificationManager.notify(SIM_ACTIVATION_NOTIFICATION_ID, builder.build());
}
Aggregations