use of com.android.internal.policy.impl.keyguard.KeyguardHostView.OnDismissAction in project android_frameworks_base by ParanoidAndroid.
the class KeyguardActivityLauncher method launchActivityWithAnimation.
public void launchActivityWithAnimation(final Intent intent, boolean showsWhileLocked, final Bundle animation, final Handler worker, final Runnable onStarted) {
LockPatternUtils lockPatternUtils = getLockPatternUtils();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
boolean isSecure = lockPatternUtils.isSecure();
if (!isSecure || showsWhileLocked) {
if (!isSecure) {
dismissKeyguardOnNextActivity();
}
try {
if (DEBUG)
Log.d(TAG, String.format("Starting activity for intent %s at %s", intent, SystemClock.uptimeMillis()));
startActivityForCurrentUser(intent, animation, worker, onStarted);
} catch (ActivityNotFoundException e) {
Log.w(TAG, "Activity not found for intent + " + intent.getAction());
}
} else {
// Create a runnable to start the activity and ask the user to enter their
// credentials.
KeyguardSecurityCallback callback = getCallback();
callback.setOnDismissAction(new OnDismissAction() {
@Override
public boolean onDismiss() {
dismissKeyguardOnNextActivity();
startActivityForCurrentUser(intent, animation, worker, onStarted);
return true;
}
});
callback.dismiss(false);
}
}
Aggregations