rparkins999 / AndroidSecondsClock

Android clock with seconds, both widget and fullscreen
GNU General Public License v3.0
7 stars 1 forks source link

System Clock #7

Open myprivacymatters opened 2 years ago

myprivacymatters commented 2 years ago

When opening the system clock, the app opens the timer instead of the actual clock.

rparkins999 commented 2 years ago

It depends on what type of device you have. Almost all Android devices have a clock app, but it is supplied by the OEM and isn't a built-in part of Android, so there isn't a standard intent to open the clock. I open the clock app if I can find it, but some devices won't let me. Even if I can open the clock app, some clock apps will open the last page that you looked at, which might be the timer.

If your device has an intent to open its clock app, and you can tell me what that intent is, I'll add it to the list of things that I try, or you can do that yourself. The code is in goSystemClock() in MainActivity.java.

myprivacymatters commented 2 years ago

It is a Samsung. The package name is com.sec.android.app.clockpackage. Also, I never use the timer. As a matter of fact, the alarm is the only function I ever use. I might add that I installed a third party clock and disabled the stock app via ADB and it went unrecognized by Android Seconds Clock.

rparkins999 commented 1 year ago

It is a Samsung. The package name is com.sec.android.app.clockpackage. Also, I never use the timer. As a matter of fact, the alarm is the only function I ever use. I might add that I installed a third party clock and disabled the stock app via ADB and it went unrecognized by Android Seconds Clock.

Yes, that's basically the problem. Android Seconds Clock has no way of knowing what clock app you're using, and there is no standard Intent to launch the installed clock app. If you look at the code, what I do is to try and launch a couple of well-known clock applications, and if that doesn't work I try SHOW_TIMERS without a class name since there isn't an Intent just to show the clock. If you've installed a clock app which doesn't go by one of the standard names and doesn't respond to the SHOW_TIMERS Intent, Android Seconds Clock has no way of finding it.

If you have the standard Samsung clock app (com.sec.android.app.clockpackage), it requires SET_ALARM permission to SHOW_TIMERS (this is mentioned in the README). IMHO this is a bug, but I have to deal as best I can with the installed base.

rparkins999 commented 1 year ago

Another potential issue here is how you last exited the clock app. If you used the back button, then restarting the clock app will go to its top level screen, whatever that is. If you just pressed the home button, or used the recents button to select another app, the clock app is still "there" (in the back stack), and restarting it will go to the last screen (activity) that it was showing.

Android Seconds Clock itself has the same behaviour, which sometimes leads to you getting a screen that you didn't expect.