release-request-c7529296-e389-4c5b-82be-b0ae60d66df2-for-git_pi-release-4290469 snap-temp-L99200000095525646
Change-Id: I6cc0a951eac237f944a888602a7b787eef5efb26
This commit is contained in:
@@ -77,6 +77,9 @@ public abstract class ConfirmDeviceCredentialBaseFragment extends OptionsMenuFra
|
||||
protected static final int USER_TYPE_MANAGED_PROFILE = 2;
|
||||
protected static final int USER_TYPE_SECONDARY = 3;
|
||||
|
||||
/** Time we wait before clearing a wrong input attempt (e.g. pattern) and the error message. */
|
||||
protected static final long CLEAR_WRONG_ATTEMPT_TIMEOUT_MS = 3000;
|
||||
|
||||
private FingerprintUiHelper mFingerprintHelper;
|
||||
protected boolean mReturnCredentials = false;
|
||||
protected Button mCancelButton;
|
||||
|
||||
@@ -93,7 +93,6 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
public static class ConfirmLockPasswordFragment extends ConfirmDeviceCredentialBaseFragment
|
||||
implements OnClickListener, OnEditorActionListener,
|
||||
CredentialCheckResultTracker.Listener {
|
||||
private static final long ERROR_MESSAGE_TIMEOUT = 3000;
|
||||
private static final String FRAGMENT_TAG_CHECK_LOCK_RESULT = "check_lock_result";
|
||||
private ImeAwareEditText mPasswordEntry;
|
||||
private TextViewInputDisabler mPasswordEntryInputDisabler;
|
||||
@@ -460,7 +459,7 @@ public class ConfirmLockPassword extends ConfirmDeviceCredentialBaseActivity {
|
||||
effectiveUserId, timeoutMs);
|
||||
handleAttemptLockout(deadline);
|
||||
} else {
|
||||
showError(getErrorMessage(), ERROR_MESSAGE_TIMEOUT);
|
||||
showError(getErrorMessage(), CLEAR_WRONG_ATTEMPT_TIMEOUT_MS);
|
||||
}
|
||||
if (newResult) {
|
||||
reportFailedAttempt();
|
||||
|
||||
@@ -79,9 +79,6 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
public static class ConfirmLockPatternFragment extends ConfirmDeviceCredentialBaseFragment
|
||||
implements AppearAnimationCreator<Object>, CredentialCheckResultTracker.Listener {
|
||||
|
||||
// how long we wait to clear a wrong pattern
|
||||
private static final int WRONG_PATTERN_CLEAR_TIMEOUT_MS = 2000;
|
||||
|
||||
private static final String FRAGMENT_TAG_CHECK_LOCK_RESULT = "check_lock_result";
|
||||
|
||||
private LockPatternView mLockPatternView;
|
||||
@@ -315,7 +312,8 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
mLockPatternView.clearPattern();
|
||||
break;
|
||||
case NeedToUnlockWrong:
|
||||
mErrorTextView.setText(R.string.lockpattern_need_to_unlock_wrong);
|
||||
showError(R.string.lockpattern_need_to_unlock_wrong,
|
||||
CLEAR_WRONG_ATTEMPT_TIMEOUT_MS);
|
||||
|
||||
mLockPatternView.setDisplayMode(LockPatternView.DisplayMode.Wrong);
|
||||
mLockPatternView.setEnabled(true);
|
||||
@@ -349,7 +347,7 @@ public class ConfirmLockPattern extends ConfirmDeviceCredentialBaseActivity {
|
||||
// already
|
||||
private void postClearPatternRunnable() {
|
||||
mLockPatternView.removeCallbacks(mClearPatternRunnable);
|
||||
mLockPatternView.postDelayed(mClearPatternRunnable, WRONG_PATTERN_CLEAR_TIMEOUT_MS);
|
||||
mLockPatternView.postDelayed(mClearPatternRunnable, CLEAR_WRONG_ATTEMPT_TIMEOUT_MS);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,11 +26,15 @@ import android.graphics.PorterDuffColorFilter;
|
||||
import android.graphics.Typeface;
|
||||
import android.support.annotation.ColorRes;
|
||||
import android.text.TextPaint;
|
||||
import android.text.TextUtils;
|
||||
import android.util.AttributeSet;
|
||||
import android.view.View;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.Utils;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
/**
|
||||
* DonutView represents a donut graph. It visualizes a certain percentage of fullness with a
|
||||
* corresponding label with the fullness on the inside (i.e. "50%" inside of the donut).
|
||||
@@ -101,12 +105,19 @@ public class DonutView extends View {
|
||||
mFilledArc.setColorFilter(mAccentColorFilter);
|
||||
}
|
||||
|
||||
final Locale locale = resources.getConfiguration().locale;
|
||||
final int layoutDirection = TextUtils.getLayoutDirectionFromLocale(locale);
|
||||
final int bidiFlags = (layoutDirection == LAYOUT_DIRECTION_LTR)
|
||||
? Paint.BIDI_LTR
|
||||
: Paint.BIDI_RTL;
|
||||
|
||||
mTextPaint = new TextPaint();
|
||||
mTextPaint.setColor(Utils.getColorAccent(getContext()));
|
||||
mTextPaint.setAntiAlias(true);
|
||||
mTextPaint.setTextSize(
|
||||
resources.getDimension(R.dimen.storage_donut_view_label_text_size));
|
||||
mTextPaint.setTextAlign(Paint.Align.CENTER);
|
||||
mTextPaint.setBidiFlags(bidiFlags);
|
||||
|
||||
mBigNumberPaint = new TextPaint();
|
||||
mBigNumberPaint.setColor(Utils.getColorAccent(getContext()));
|
||||
@@ -117,6 +128,7 @@ public class DonutView extends View {
|
||||
mBigNumberPaint.setTypeface(Typeface.create(
|
||||
context.getString(com.android.internal.R.string.config_headlineFontFamily),
|
||||
Typeface.NORMAL));
|
||||
mBigNumberPaint.setBidiFlags(bidiFlags);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user