Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 01835399 authored by ctso's avatar ctso
Browse files

Merge branch 'eclair' of git://github.com/cyanogen/android_frameworks_base into eclair

parents 58a51bf7 474d785c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1201,6 +1201,8 @@ public final class BatteryStatsImpl extends BatteryStats {
        if (mPhoneSignalStrengthBin != bin) {
            if (mPhoneSignalStrengthBin >= 0) {
                mPhoneSignalStrengthsTimer[mPhoneSignalStrengthBin].stopRunningLocked(this);
            } else {
                mPhoneSignalStrengthsTimer[SIGNAL_STRENGTH_NONE_OR_UNKNOWN].stopRunningLocked(this);
            }
            mPhoneSignalStrengthBin = bin;
            mPhoneSignalStrengthsTimer[bin].startRunningLocked(this);
+28 −1
Original line number Diff line number Diff line
@@ -78,7 +78,11 @@ public class LockPatternUtils {
    private final static String LOCKOUT_PERMANENT_KEY = "lockscreen.lockedoutpermanently";
    private final static String LOCKOUT_ATTEMPT_DEADLINE = "lockscreen.lockoutattemptdeadline";
    private final static String PATTERN_EVER_CHOSEN = "lockscreen.patterneverchosen";
    private static final String PIN_BASED_LOCKING_ENABLED = "lockscreen.pinbased";
    private final static String PIN_BASED_LOCKING_ENABLED = "lockscreen.pinbased";
    private final static String PIN_CHECK_TIMEOUT = "lockscreen.pinchecktimeout";

    private static final int PIN_CHECK_TIMEOUT_MIN = 500;
    private static final int PIN_CHECK_TIMEOUT_DEFAULT = 1500;
    
    private final ContentResolver mContentResolver;

@@ -294,6 +298,23 @@ public class LockPatternUtils {
        setBoolean(Settings.System.LOCK_PATTERN_TACTILE_FEEDBACK_ENABLED, enabled);
    }

    /**
     * @return delay when accepting patterns for the PIN lock mechanism
     */
    public int getPinCheckTimeout() {
    	return Math.max(
			PIN_CHECK_TIMEOUT_MIN,
			getInt(PIN_CHECK_TIMEOUT, PIN_CHECK_TIMEOUT_DEFAULT));
    }
    
    /**
     * Set the timeout pin check timeout, in milliseconds
     */
    public void setPinCheckTimeout(int timeoutMillis) {
    	timeoutMillis = Math.max(timeoutMillis, PIN_CHECK_TIMEOUT_MIN);
    	setInt(PIN_CHECK_TIMEOUT, timeoutMillis);
    }
    
    /**
     * Set and store the lockout deadline, meaning the user can't attempt his/her unlock
     * pattern until the deadline has passed.
@@ -375,5 +396,11 @@ public class LockPatternUtils {
        android.provider.Settings.System.putLong(mContentResolver, systemSettingKey, value);
    }

    private int getInt(String systemSettingKey, int def) {
        return android.provider.Settings.System.getInt(mContentResolver, systemSettingKey, def);
    }

    private void setInt(String systemSettingKey, int value) {
        android.provider.Settings.System.putInt(mContentResolver, systemSettingKey, value);
    }
}
+19 −12
Original line number Diff line number Diff line
@@ -50,13 +50,13 @@ public class PinLock extends View implements LockPattern {
    private final static String TAG = "PinLock";
    private static final int STATUS_BAR_HEIGHT = 25;
    private static final int REPLAY_INCREMENT_DURATION_MS = 600;
    private static final int PATTERN_COMPLETE_DELAY_MS = 1250;
    private static final boolean DEBUG = false;
    private static final long[] DEFAULT_VIBE_PATTERN = {0, 1, 40, 41};

    private EventListener mEventListener;
    private Handler mHandler = new Handler();
    private Paint mPaint = new Paint();
    private LockPatternUtils mLockPatternUtils;
    private ArrayList<Cell> mPattern = new ArrayList<Cell>(9);
    private int mReplayIndex = 0;
    private State mState = State.Record;
@@ -99,7 +99,8 @@ public class PinLock extends View implements LockPattern {
        mBitmapWidth = mBitmapBtnDefault.getWidth();
        mBitmapHeight = mBitmapBtnDefault.getHeight();

        // vibrator fun
        mLockPatternUtils = new LockPatternUtils(context.getContentResolver());
        
        mVibe = new Vibrator();
        mVibePattern = loadVibratePattern(com.android.internal.R.array.config_virtualKeyVibePattern);
    }
@@ -270,7 +271,7 @@ public class PinLock extends View implements LockPattern {
        }
    };

    private Runnable mCheckPatternCompleteRunnable = new Runnable() {
    private Runnable mPatternEntryFinishedRunnable = new Runnable() {
        public void run() {
            if (mEventListener != null) {
                mEventListener.onPatternDetected(mPattern);
@@ -349,7 +350,7 @@ public class PinLock extends View implements LockPattern {
        final Cell cell = checkForNewHit(x, y);

        if ((mDown != null) && (cell == mDown)) {
            addCellToPattern(cell);
        	mPattern.add(cell);

            if (mTactileFeedbackEnabled){
                mVibe.vibrate(mVibePattern, -1);
@@ -361,14 +362,18 @@ public class PinLock extends View implements LockPattern {
        return null;
    }

    private void addCellToPattern(Cell newCell) {
        mPattern.add(newCell);
    private void stopWaitingForTimeout() {
    	
    }
    
        mHandler.removeCallbacks(mCheckPatternCompleteRunnable);
    void cancelPatternEntryFinishedTimeout() {
        mHandler.removeCallbacks(mPatternEntryFinishedRunnable);
    }

    void schedulePatternEntryFinishedTimeout() {
        mHandler.postDelayed(
            mCheckPatternCompleteRunnable,
            PATTERN_COMPLETE_DELAY_MS);
            mPatternEntryFinishedRunnable,
            mLockPatternUtils.getPinCheckTimeout());
    }

    // helper method to find which cell a point maps to
@@ -437,6 +442,7 @@ public class PinLock extends View implements LockPattern {
        switch(motionEvent.getAction()) {
            case MotionEvent.ACTION_DOWN:
            	if (DEBUG) Log.i(TAG, "down");
        		cancelPatternEntryFinishedTimeout();
                mCurrent = mDown = checkForNewHit(x, y);
                invalidate();
                onUserInteraction();
@@ -457,6 +463,7 @@ public class PinLock extends View implements LockPattern {
                mCurrent = mDown = null;
                invalidate();
                onUserInteraction();
                schedulePatternEntryFinishedTimeout();
                return true;

            case MotionEvent.ACTION_MOVE:
+193 B (397 B)
Loading image diff...
+6 −3
Original line number Diff line number Diff line
@@ -305,9 +305,12 @@ public class SettingsProvider extends ContentProvider {
                    }
                } else if (prefix == '-' && index >= 0) {
                    // remove the provider from the list if present
                    // remove leading and trailing commas
                    if (index > 0) index--;
                    if (end < providers.length()) end++;
                    // remove leading or trailing comma
                    if (index > 0) {
                        index--;
                    } else if (end < providers.length()) {
                        end++;
                    }

                    newProviders = providers.substring(0, index);
                    if (end < providers.length()) {