On stock aosp, and pixel android, I can auto rotate the phone up, left, or right, but if I turn the phone upside down the screen won’t rotate.

Is there a way to enable upside down rotation? I think it would be quite useful.

I.e. When phone is charging, or hanging phone up by a strap, or when using a usb-c device and you want to prop it up on a desk

  • Skull giver@popplesburger.hilciferous.nl
    link
    fedilink
    English
    arrow-up
    7
    ·
    edit-2
    9 months ago

    I believe Lineage has a setting for this, but I’m not so sure about AOSP.

    There’s a setting (config_allowAllRotations) in the Android source code that can be toggled to true by the ROM manufacturer to allow for 180 degree rotation automatically. On rooted devices, there are also modules you can use to override this without building the ROM yourself.

    If your ROM makers haven’t enabled this setting during build time, and the ROM doesn’t provide an alternative (like Lineage used to), and you haven’t rooted your phone, auto rotate won’t be able to rotate to 180 degrees. There’s also another code path that prevents some applications from rotating to 180 degrees even with that setting on, but I don’t think that’s commonly enabled.

    If you can get the phone to think you’re charging in a car dock, 180 degrees rotation is actually enabled by default. However, most normal USB chargers won’t identify as cars (and neither do many chargers built into cars, actually!).

    When the phone is hooked up to a computer, you can use adb to set the rotation manually (adb shell settings put system user_rotation 2). However, that setting makes the auto rotation handler act a bit weird on my phone, so you may need to adb it to another position (0, 1, 3) to get it to go back to normal.

    As far as I know, user_rotation isn’t a setting apps (without root permissions) are able to use, so I don’t know if you can get this to work if you’re not charging from a computer.

    • glibg10b@lemmy.ml
      link
      fedilink
      English
      arrow-up
      1
      ·
      9 months ago

      This can be automated by an app with Shizuku integration, but Shizuku unfortunately needs to be set up every time the device is rebooted.

      • Skull giver@popplesburger.hilciferous.nl
        link
        fedilink
        English
        arrow-up
        1
        ·
        9 months ago

        Cool project! Adding that to my list.

        It makes sense that ADB would require some extra steps, but I’m not sure what is preventing this project from creating a companion app that includes a cross-compiled adb binary (like the one Termux can use) to basically connect to localhost and set up debugging that way.