BlackyHawky/Clock

Power off alarm

islam2hamy opened this issue · 14 comments

Describe the bug

For Snapdragon phones only, the alarm is triggered when the phone is switched off;

Couldn't get this work

To Reproduce

  1. Set alarm after one hour
  2. press power off button

Expected behavior

i will see the next alarm at the power screen footer, as the built in clock app does

Screenshots

App version

2.6

Device (please complete the following information):

  • Model: readmi note 12
  • OS: Android 14

Additional context

Hi, xiaomi with its miui / hyperos is very restrictive. Go to the settings search for apps, select this app and make sure you give all the necessary permissions including the poweroff alarm permission. In addition to giving all the permissions that the app requires you must also give the extra permissions of xiaomi, in the past with miui there was an option in the developer settings that allowed you to disable miui optimization, see if there is something similar for hyperos too

in the past with miui there was an option in the developer settings that allowed you to disable miui optimization, see if there is something similar for hyperos too

couldn't see it in hyperos

For other xiaomi permissions I mean a screen similar to these.
I also leave you this written guide, and it is also linked to the app "don't kill my app"
2AE0B2C8-3A02-4111-A86C-D44DDF58E151
F357730A-5A3A-4B7E-AABC-4D88714F1858

https://dontkillmyapp.com/xiaomi

Thank you for all your efforts,
Now miui optimization is off , also all permissions are granted ,
but i couldn't get power off alarm work

very strange that it doesn't work, try reinstalling the app. However I am convinced that it remains a miui/hyperos problem. On my xiaomi devices with custom rom I have no problems.

very strange that it doesn't work, try reinstalling the app. However I am convinced that it remains a miui/hyperos problem. On my xiaomi devices with custom rom I have no problems.

Good you have xiaomi devices , could you please test with stock rom?

very strange that it doesn't work, try reinstalling the app. However I am convinced that it remains a miui/hyperos problem. On my xiaomi devices with custom rom I have no problems.

Good you have xiaomi devices , could you please test with stock rom?

I'm very busy as soon as possible I'll do some tests with stock rom miui/hyperos

very strange that it doesn't work, try reinstalling the app. However I am convinced that it remains a miui/hyperos problem. On my xiaomi devices with custom rom I have no problems.

Good you have xiaomi devices , could you please test with stock rom?

I'm very busy as soon as possible I'll do some tests with stock rom miui/hyperos

Thank you

@islam2hamy I have done some tests with Xiaomi devices. Before Xiaomi used only Snapdragon processors and used the "Power off alarm" service. Now Xiaomi also uses Mediatek, in its proprietary "Clock" app to turn on the device it no longer uses "Power off alarm" so it actually seems not to work anymore. In recent versions of MIUI "power off alarm" is deprecated. I have come to the conclusion that the "Power off alarm" function in this app only works on Xiaomi if you use Custom Roms.

@BlackyHawky I was thinking of editing Readme: the “power off alarm” function does not work on Xiaomi and Samsung devices even if they have snapdragon processors

@qw123wh
Doesn't it work on Samsung even with a custom ROM?
Editing the readme in this way would be a bit wrong, as there are some Xiaomi where it still works. No ?

I'll close this issue at the next commit.

@qw123wh Doesn't it work on Samsung even with a custom ROM? Editing the readme in this way would be a bit wrong, as there are some Xiaomi where it still works. No ?

I'll close this issue at the next commit.

For this function to work, there must be a pre-installed system app called “com.qualcomm.qti.poweroffalarm” this app can be found under the name of “PowerOffAlarm”. This is a system app pre-installed on snapdragon devices. The curious thing is that on Samsung devices with snapdragon it is not pre-installed, even if you try to install it in the form of apk in our app the permission appears but it does not work. I do not have Samsung devices with Custom Rom so I am not sure. Instead, I have Xiaomi devices with custom rom, in old devices with old versions of MIUI if you manage to give some extra permissions (see previous screens) it still manages to work. In more recent Xiaomi devices, even if the system app “PowerOffAlarm” is actually pre-installed, there is no way to make it work in this app, nor in the lineage app, nor in other portings of proprietary clock apps that have this function. These same Xiaomi devices, if you install a custom rom, it works. I think Xiaomi in MIUI/HyperOS has neutered Snapdragon's “PowerOffAlarm” feature in favor of a universal solution in its clock app for its devices to turn on scheduled based on the set alarm.

Let's say that the most beautiful and almost impossible thing is to create a code compatible with all devices and all processors that allows you to make the alarm sound when the phone is turned off without the need for a system app.
I know that the current solution "PowerOffAlarm" is not perfect because it only works with some devices etc but it is better to keep it at least it works on almost all snapdragon except Samsung and Xiaomi