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

Commit ad22c18b authored by Suchi Amalapurapu's avatar Suchi Amalapurapu Committed by The Android Open Source Project
Browse files

Automated import from //branches/cupcake/...@142231,142231

parent 75898be5
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -296,13 +296,18 @@ public class PhoneWindowManager implements WindowManagerPolicy {
        return false;
    }
    
    /*
     * We always let the sensor be switched on by default except when
     * the user has explicitly disabled sensor based rotation or when the
     * screen is switched off.
     */
    boolean needSensorRunningLp() {
        if (mCurrentAppOrientation == ActivityInfo.SCREEN_ORIENTATION_SENSOR) {
            // If the application has explicitly requested to follow the
            // orientation, then we need to turn the sensor or.
            return true;
        }
        if (mAccelerometerDefault != 0) {
        if (mAccelerometerDefault == 0) {
            // If the setting for using the sensor by default is enabled, then
            // we will always leave it on.  Note that the user could go to
            // a window that forces an orientation that does not use the
@@ -311,10 +316,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            // orientation for a little bit, which can cause orientation
            // changes to lag, so we'd like to keep it always on.  (It will
            // still be turned off when the screen is off.)
            return true;
        }
            return false;
        }
        return true;
    }
    
    /*
     * Various use cases for invoking this function