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

Commit 485a8d14 authored by Trevor Bunker's avatar Trevor Bunker Committed by Android (Google) Code Review
Browse files

Merge "Use public device orientation sensor for window orientation"

parents 30916e8e 8e4591c4
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -679,17 +679,6 @@
        <!-- rotation: 270 (rotate CW)  --> <item>-25</item> <item>65</item>
    </integer-array>

    <!-- Indicate the name of the window orientation sensor type if present. A
         window orientation sensor produces values to be used in lieu of the
         typical, accelerometer based sensor. It must only produce integral
         values between 0 and 3, inclusive, with each one corresponding to a
         given rotation:
            0: 0 degrees of rotation (natural)
            1: 90 degrees of rotation (rotate CCW)
            2: 180 degrees of rotation (reverse)
            3: 270 degrees of rotation (rotate CW) -->
    <string name="config_orientationSensorType" translatable="false">@null</string>

    <!-- Lid switch behavior -->

    <!-- The number of degrees to rotate the display when the keyboard is open.
+0 −1
Original line number Diff line number Diff line
@@ -1593,7 +1593,6 @@
  <java-symbol type="string" name="bugreport_option_interactive_title" />
  <java-symbol type="string" name="bugreport_status" />
  <java-symbol type="string" name="bugreport_title" />
  <java-symbol type="string" name="config_orientationSensorType" />
  <java-symbol type="string" name="faceunlock_multiple_failures" />
  <java-symbol type="string" name="global_action_power_off" />
  <java-symbol type="string" name="global_actions_airplane_mode_off_status" />
+3 −15
Original line number Diff line number Diff line
@@ -87,23 +87,11 @@ public abstract class WindowOrientationListener {
        mHandler = handler;
        mSensorManager = (SensorManager)context.getSystemService(Context.SENSOR_SERVICE);
        mRate = rate;
        mSensor = mSensorManager.getDefaultSensor(Sensor.TYPE_DEVICE_ORIENTATION);

        mSensorType = context.getResources().getString(
                com.android.internal.R.string.config_orientationSensorType);
        if (!TextUtils.isEmpty(mSensorType)) {
            List<Sensor> sensors = mSensorManager.getSensorList(Sensor.TYPE_ALL);
            final int N = sensors.size();
            for (int i = 0; i < N; i++) {
                Sensor sensor = sensors.get(i);
                if (mSensorType.equals(sensor.getStringType())) {
                    mSensor = sensor;
                    break;
                }
            }
        if (mSensor != null) {
            mOrientationJudge = new OrientationSensorJudge();
        }
        }

        if (mOrientationJudge == null) {
            mSensor = mSensorManager.getDefaultSensor(USE_GRAVITY_SENSOR