use of com.android.internal.widget.LockPatternUtils in project android_frameworks_base by ResurrectionRemix.
the class KeyguardAbsKeyInputView method onFinishInflate.
@Override
protected void onFinishInflate() {
mLockPatternUtils = new LockPatternUtils(mContext);
mSecurityMessageDisplay = KeyguardMessageArea.findSecurityMessageDisplay(this);
mEcaView = findViewById(R.id.keyguard_selector_fade_container);
mMaxCountdownTimes = mContext.getResources().getInteger(R.integer.config_max_unlock_countdown_times);
EmergencyButton button = (EmergencyButton) findViewById(R.id.emergency_call_button);
if (button != null) {
button.setCallback(this);
}
}
use of com.android.internal.widget.LockPatternUtils in project android_frameworks_base by ResurrectionRemix.
the class KeyguardHostView method onFinishInflate.
@Override
protected void onFinishInflate() {
mSecurityContainer = (KeyguardSecurityContainer) findViewById(R.id.keyguard_security_container);
mLockPatternUtils = new LockPatternUtils(mContext);
mSecurityContainer.setLockPatternUtils(mLockPatternUtils);
mSecurityContainer.setSecurityCallback(this);
mSecurityContainer.showPrimarySecurityScreen(false);
// mSecurityContainer.updateSecurityViews(false /* not bouncing */);
}
use of com.android.internal.widget.LockPatternUtils in project android_frameworks_base by ResurrectionRemix.
the class KeyguardBottomAreaView method onFinishInflate.
@Override
protected void onFinishInflate() {
super.onFinishInflate();
mLockPatternUtils = new LockPatternUtils(mContext);
mPreviewContainer = (ViewGroup) findViewById(R.id.preview_container);
mCameraImageView = (KeyguardAffordanceView) findViewById(R.id.camera_button);
mLeftAffordanceView = (KeyguardAffordanceView) findViewById(R.id.left_button);
mLockIcon = (LockIcon) findViewById(R.id.lock_icon);
mIndicationText = (TextView) findViewById(R.id.keyguard_indication_text);
mShortcutHelper = new LockscreenShortcutsHelper(mContext, this);
watchForCameraPolicyChanges();
updateCameraVisibility();
updateLeftButtonVisibility();
mUnlockMethodCache = UnlockMethodCache.getInstance(getContext());
mUnlockMethodCache.addListener(this);
updateCameraIconColor();
updatePhoneIconColor();
updateLockIconColor();
updateIndicationTextColor();
mLockIcon.update();
setClipChildren(false);
setClipToPadding(false);
mPreviewInflater = new PreviewInflater(mContext, new LockPatternUtils(mContext));
mLockIcon.setOnClickListener(this);
mLockIcon.setOnLongClickListener(this);
mCameraImageView.setOnClickListener(this);
mLeftAffordanceView.setOnClickListener(this);
initAccessibility();
updateCustomShortcuts();
}
use of com.android.internal.widget.LockPatternUtils in project android_frameworks_base by ParanoidAndroid.
the class DatabaseHelper method upgradeLockPatternLocation.
private void upgradeLockPatternLocation(SQLiteDatabase db) {
Cursor c = db.query(TABLE_SYSTEM, new String[] { "_id", "value" }, "name='lock_pattern'", null, null, null, null);
if (c.getCount() > 0) {
c.moveToFirst();
String lockPattern = c.getString(1);
if (!TextUtils.isEmpty(lockPattern)) {
// Convert lock pattern
try {
LockPatternUtils lpu = new LockPatternUtils(mContext);
List<LockPatternView.Cell> cellPattern = LockPatternUtils.stringToPattern(lockPattern);
lpu.saveLockPattern(cellPattern);
} catch (IllegalArgumentException e) {
// Don't want corrupted lock pattern to hang the reboot process
}
}
c.close();
db.delete(TABLE_SYSTEM, "name='lock_pattern'", null);
} else {
c.close();
}
}
use of com.android.internal.widget.LockPatternUtils 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