YGPS/src/com/mediatek/ygps/YgpsActivity.java
private void resetParam(Bundle extras, boolean bAutoConnectTest) {
        Log.v("@M_" + TAG, "Enter resetParam function");
        mLocationManager.removeUpdates(mLocListener);
        try {
            Thread.sleep(ONE_SECOND / 2);  // wait for stop gps done.
        } catch (InterruptedException e) {
            Log.d("@M_" + TAG, "resetParam InterruptedException: " + e.getMessage());
        }
        if (!bAutoConnectTest) {
            mLocationManager.sendExtraCommand(LocationManager.GPS_PROVIDER,
                    "delete_aiding_data", extras);
        }

        if (!bAutoConnectTest) {
            clearLayout();
        }
        mFirstFix = false;
        mTtffValue = 0;
        if (!mHandler.hasMessages(HANDLE_COUNTER)) {
            mHandler.sendEmptyMessage(HANDLE_COUNTER);
        }
        try {
            if (bAutoConnectTest && mTestInterval != 0) {
                for (int i = mTestInterval; i >= 0 && mIsTestRunning; --i) {
                    setCountDown(i);
                    Thread.sleep(1 * ONE_SECOND);

                }
                if (!mIsTestRunning) {
                    setCountDown(0);
                }
            } else {
                Thread.sleep(ONE_SECOND / 2);
            }
        } catch (InterruptedException e) {
            Log.d("@M_" + TAG, "resetParam InterruptedException: " + e.getMessage());
        }
        if (!mIsExit) {
            mLocationManager.requestLocationUpdates(
                    LocationManager.GPS_PROVIDER, 0, 0, mLocListener);
        }
        // reset autotest start button
        if (!bAutoConnectTest && !mBtnGpsTestStart.isEnabled()) {
            setStartButtonEnable(true);
            removeDialog(DIALOG_WAITING_FOR_STOP);
            // added by chaozhong @2010.10.12
            mStopPressedHandling = false;
            mStartPressedHandling = false;

            // add end
        }
    }
/**
     * Set reset parameters to GPS driver.
     *
     * @param extras
     *            Data need to reset
     * @param bAutoConnectTest
     *            Whether auto test testing
     */
Set reset parameters to GPS driver.
@param extras
Data need to reset
@param bAutoConnectTest
Whether auto test testing
Set reset parameters to GPS driver . @param extras Data need to reset @param bAutoConnectTest Whether auto test testing
private void resetParam(Bundle extras, boolean bAutoConnectTest) {
        Log.v("@M_" + TAG, "Enter resetParam function");
        mLocationManager.removeUpdates(mLocListener);
        try {
            Thread.sleep(ONE_SECOND / 2);  
        } catch (InterruptedException e) {
            Log.d("@M_" + TAG, "resetParam InterruptedException: " + e.getMessage());
        }
        if (!bAutoConnectTest) {
            mLocationManager.sendExtraCommand(LocationManager.GPS_PROVIDER,
                    "delete_aiding_data", extras);
        }
        if (!bAutoConnectTest) {
            clearLayout();
        }
        mFirstFix = false;
        mTtffValue = 0;
        if (!mHandler.hasMessages(HANDLE_COUNTER)) {
            mHandler.sendEmptyMessage(HANDLE_COUNTER);
        }
        try {
            if (bAutoConnectTest && mTestInterval != 0) {
                for (int i = mTestInterval; i >= 0 && mIsTestRunning; --i) {
                    setCountDown(i);
                    Thread.sleep(1 * ONE_SECOND);
                }
                if (!mIsTestRunning) {
                    setCountDown(0);
                }
            } else {
                Thread.sleep(ONE_SECOND / 2);
            }
        } catch (InterruptedException e) {
            Log.d("@M_" + TAG, "resetParam InterruptedException: " + e.getMessage());
        }
        if (!mIsExit) {
            mLocationManager.requestLocationUpdates(
                    LocationManager.GPS_PROVIDER, 0, 0, mLocListener);
        }
        if (!bAutoConnectTest && !mBtnGpsTestStart.isEnabled()) {
            setStartButtonEnable(true);
            removeDialog(DIALOG_WAITING_FOR_STOP);
            mStopPressedHandling = false;
            mStartPressedHandling = false;
        }
    }
private void resetParam ( Bundle extras , boolean bAutoConnectTest ) { Log . v ( "@M_" + TAG , "Enter resetParam function" ) ; mLocationManager . removeUpdates ( mLocListener ) ; try { Thread . sleep ( ONE_SECOND / 2 ) ; } catch ( InterruptedException e ) { Log . d ( "@M_" + TAG , "resetParam InterruptedException: " + e . getMessage ( ) ) ; } if ( ! bAutoConnectTest ) { mLocationManager . sendExtraCommand ( LocationManager . GPS_PROVIDER , "delete_aiding_data" , extras ) ; } if ( ! bAutoConnectTest ) { clearLayout ( ) ; } mFirstFix = false ; mTtffValue = 0 ; if ( ! mHandler . hasMessages ( HANDLE_COUNTER ) ) { mHandler . sendEmptyMessage ( HANDLE_COUNTER ) ; } try { if ( bAutoConnectTest && mTestInterval != 0 ) { for ( int i = mTestInterval ; i >= 0 && mIsTestRunning ; -- i ) { setCountDown ( i ) ; Thread . sleep ( 1 * ONE_SECOND ) ; } if ( ! mIsTestRunning ) { setCountDown ( 0 ) ; } } else { Thread . sleep ( ONE_SECOND / 2 ) ; } } catch ( InterruptedException e ) { Log . d ( "@M_" + TAG , "resetParam InterruptedException: " + e . getMessage ( ) ) ; } if ( ! mIsExit ) { mLocationManager . requestLocationUpdates ( LocationManager . GPS_PROVIDER , 0 , 0 , mLocListener ) ; } if ( ! bAutoConnectTest && ! mBtnGpsTestStart . isEnabled ( ) ) { setStartButtonEnable ( true ) ; removeDialog ( DIALOG_WAITING_FOR_STOP ) ; mStopPressedHandling = false ; mStartPressedHandling = false ; } }
Set reset parameters to GPS driver.
Set reset parameters to GPS driver .
// wait for stop gps done. // reset autotest start button // added by chaozhong @2010.10.12 // add end