0
Power off alarm API / documentation

  1. lembrg
    Cupcake Feb 11, 2020

    lembrg , Feb 11, 2020 :
    Hello!
    The stock alarm on OnePlus 7t has an option to work even the phone is shut down.
    This is a very useful feature that I would love to see implemented in my favorite third-party alarm app (Sleep as Android).
    I even see there is special permission in the permissions list.
    My questions are:
    Is there any API for using the "power off alarm" feature with third-party apps? Where I can find some documentation?
    Thank you!
     

    #1
  2. RobbM
    Gingerbread Feb 12, 2020

    RobbM , Feb 12, 2020 :
    Unless you allow it with root access somehow, I don't see OnePlus allowing 3rd party apps those kind of permissions. Allowing a rouge app (regardless of whether you trust this one or not) to turn on your phone whenever it wants could pose a security risk. I could be wrong though.
     

    #2
    Starcommander likes this.
  3. lembrg
    Cupcake Feb 13, 2020

    lembrg , Feb 13, 2020 :
    Don't you think it is all fine with risks as long as the app needs users' permission to do this?
    I've reached OP support team with this question and they said there is no API for power off alarm feature.
    I'm not sure how well informed they are...
    I found that the power off alarm is a hardware feature and that the stock clock app interacts with it via Quallcomm PowerOffAlarm.apk. (com.qualcomm.qti.poweroffalarm)
    It can be found in /vendor/app/poweroffalarm.
     

    #3
  4. RobbM
    Gingerbread Feb 13, 2020

    RobbM , via OnePlus 7T Pro McLaren Edition , Feb 13, 2020 :
    Regardless, there isn't currently a way for 3rd party apps to switch the phone on from a power off state. Why don't you use the factory alarm app?
     

    #4
  5. lembrg
    Cupcake Feb 13, 2020

    lembrg , Feb 13, 2020 :
    Because I love the functionality of my current alarm app and stock one doesn't have any of it.
    Android system settings treat third party alarm apps the same way as stock one: sound level, alarm icon on notification bar, etc... It is expected behavior if third party alarm can wake the phone from power off like a stock one...
     

    #5