Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Power off alarm #88

Closed
islam2hamy opened this issue Aug 17, 2024 · 14 comments
Closed

Power off alarm #88

islam2hamy opened this issue Aug 17, 2024 · 14 comments
Labels
bug Something isn't working specific device Not all devices are affected by the issue

Comments

@islam2hamy
Copy link

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

@islam2hamy islam2hamy added the bug Something isn't working label Aug 17, 2024
@qw123wh
Copy link
Collaborator

qw123wh commented Aug 17, 2024

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

@islam2hamy
Copy link
Author

islam2hamy commented Aug 17, 2024

@islam2hamy
Copy link
Author

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

@qw123wh
Copy link
Collaborator

qw123wh commented Aug 17, 2024

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"

https://dontkillmyapp.com/xiaomi

@qw123wh
Copy link
Collaborator

qw123wh commented Aug 17, 2024

With this guide it should work.

https://dontkillmyapp.com/xiaomi

https://play.google.com/store/apps/details?id=com.urbandroid.dontkillmyapp&pcampaignid=pcampaignidMKT-Other-global-all-co-prtnr-py-PartBadge-Mar2515-1

also try to follow this tutorial on youtube, after the "enable system optimization" option reappears, disable it

https://www.youtube.com/watch?v=sULAJS8eWBU

@islam2hamy
Copy link
Author

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

@qw123wh
Copy link
Collaborator

qw123wh commented Aug 17, 2024

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.

@islam2hamy
Copy link
Author

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?

@qw123wh
Copy link
Collaborator

qw123wh commented Aug 25, 2024

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

@islam2hamy
Copy link
Author

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

@BlackyHawky BlackyHawky added the specific device Not all devices are affected by the issue label Sep 20, 2024
@qw123wh
Copy link
Collaborator

qw123wh commented Oct 13, 2024

@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 qw123wh closed this as completed Oct 13, 2024
@BlackyHawky
Copy link
Owner

BlackyHawky commented Oct 13, 2024

@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.

@BlackyHawky BlackyHawky reopened this Oct 13, 2024
@qw123wh
Copy link
Collaborator

qw123wh commented Oct 13, 2024

@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.

@qw123wh
Copy link
Collaborator

qw123wh commented Oct 13, 2024

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

BlackyHawky added a commit that referenced this issue Oct 27, 2024
- Clarify that the "Power off" feature unfortunately does not work on all devices;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working specific device Not all devices are affected by the issue
Projects
None yet
Development

No branches or pull requests

3 participants