use of android.content.IntentSender in project android_packages_apps_Settings by SudaMod.
the class NotificationStation method formatPendingIntent.
private static String formatPendingIntent(PendingIntent pi) {
final StringBuilder sb = new StringBuilder();
final IntentSender is = pi.getIntentSender();
sb.append("Intent(pkg=").append(is.getCreatorPackage());
try {
final boolean isActivity = ActivityManager.getService().isIntentSenderAnActivity(is.getTarget());
if (isActivity)
sb.append(" (activity)");
} catch (RemoteException ex) {
}
sb.append(")");
return sb.toString();
}
use of android.content.IntentSender in project android_packages_apps_Settings by DirtyUnicorns.
the class NotificationStation method formatPendingIntent.
private static String formatPendingIntent(PendingIntent pi) {
final StringBuilder sb = new StringBuilder();
final IntentSender is = pi.getIntentSender();
sb.append("Intent(pkg=").append(is.getCreatorPackage());
try {
final boolean isActivity = ActivityManager.getService().isIntentSenderAnActivity(is.getTarget());
if (isActivity)
sb.append(" (activity)");
} catch (RemoteException ex) {
}
sb.append(")");
return sb.toString();
}
use of android.content.IntentSender in project android_packages_apps_Settings by DirtyUnicorns.
the class ChooseLockSettingsHelper method copyOptionalExtras.
private void copyOptionalExtras(Intent inIntent, Intent outIntent) {
IntentSender intentSender = inIntent.getParcelableExtra(Intent.EXTRA_INTENT);
if (intentSender != null) {
outIntent.putExtra(Intent.EXTRA_INTENT, intentSender);
}
int taskId = inIntent.getIntExtra(Intent.EXTRA_TASK_ID, -1);
if (taskId != -1) {
outIntent.putExtra(Intent.EXTRA_TASK_ID, taskId);
}
// TODO: Remove once that bug is fixed.
if (intentSender != null || taskId != -1) {
outIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
outIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
}
}
use of android.content.IntentSender in project android_packages_apps_Settings by DirtyUnicorns.
the class ConfirmDeviceCredentialBaseFragment method checkForPendingIntent.
protected void checkForPendingIntent() {
int taskId = getActivity().getIntent().getIntExtra(Intent.EXTRA_TASK_ID, -1);
if (taskId != -1) {
try {
IActivityManager activityManager = ActivityManager.getService();
final ActivityOptions options = ActivityOptions.makeBasic();
options.setLaunchStackId(ActivityManager.StackId.INVALID_STACK_ID);
activityManager.startActivityFromRecents(taskId, options.toBundle());
return;
} catch (RemoteException e) {
// Do nothing.
}
}
IntentSender intentSender = getActivity().getIntent().getParcelableExtra(Intent.EXTRA_INTENT);
if (intentSender != null) {
try {
getActivity().startIntentSenderForResult(intentSender, -1, null, 0, 0, 0);
} catch (IntentSender.SendIntentException e) {
/* ignore */
}
}
}
use of android.content.IntentSender in project platform_packages_apps_Settings by BlissRoms.
the class ChooseLockSettingsHelper method copyOptionalExtras.
private void copyOptionalExtras(Intent inIntent, Intent outIntent) {
IntentSender intentSender = inIntent.getParcelableExtra(Intent.EXTRA_INTENT);
if (intentSender != null) {
outIntent.putExtra(Intent.EXTRA_INTENT, intentSender);
}
int taskId = inIntent.getIntExtra(Intent.EXTRA_TASK_ID, -1);
if (taskId != -1) {
outIntent.putExtra(Intent.EXTRA_TASK_ID, taskId);
}
// TODO: Remove once that bug is fixed.
if (intentSender != null || taskId != -1) {
outIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
outIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
}
}
Aggregations