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

Feature Request - Make ScreensaverActivity Public #175

Closed
rac146 opened this issue Jan 27, 2025 · 15 comments
Closed

Feature Request - Make ScreensaverActivity Public #175

rac146 opened this issue Jan 27, 2025 · 15 comments
Labels
enhancement New feature or request

Comments

@rac146
Copy link

rac146 commented Jan 27, 2025

Is your feature request related to a problem? Please describe.
Yes - I am running a tablet with Fully Kiosk and would like to launch a customized screensaver with this clock. In order to do so, the ScreenSaverActivity needs to be public.

Describe the solution you'd like
Make "ScreensaverActivity" exportable=true

Use case
By making this public, users can launch the Clock Screensaver Activity directly (Android 13+ no longer lets you launch the current Daydream Screensaver so this is a workaround for that limitation)

Would there be any issues with making the ScreensaverActivity public?

@rac146 rac146 added the enhancement New feature or request label Jan 27, 2025
@BlackyHawky
Copy link
Owner

@rac146
I don't see any problem with doing this ( by the way, I may have unintentionally modified this value).

Can you test the apk below and tell me if it's OK for you (I've only modified the manifest)?

Clock_2.12_beta-debug.zip

@rac146
Copy link
Author

rac146 commented Jan 28, 2025

Yes, it works great!

@rac146
Copy link
Author

rac146 commented Feb 24, 2025

Hey @BlackyHawky - I tried to install the latest 2.12.1 via Obtanium and it's still showing the ScreensaverActivity marked to private. Any ideas? I previously compiled the code manually (with the same changes you pushed) and it switched the activity to public.

@BlackyHawky
Copy link
Owner

@rac146
Hi,
This may be linked to the change made in the commit fc5d4d6.

Can you please test the attached apk and keep me informed?

Clock_2.12.2-beta-debug.zip

@rac146
Copy link
Author

rac146 commented Feb 25, 2025

I installed your 2.12.2, but Activity Launcher still lists ScreensaverActivity as private..

@BlackyHawky
Copy link
Owner

@rac146
That's what I thought.

It's strange because in the apk I provided you with the other day I didn't add the "exported=true" attribute for the "ScreensaverActivity" activity.

Indeed, the "ScreensaverActivity" activity only serves to preview the screensaver.

In any case, I'll provide you with another apk later.

@BlackyHawky
Copy link
Owner

@rac146
Can you please test this new apk?

Clock_2.12.2-beta-debug.zip

@rac146
Copy link
Author

rac146 commented Feb 26, 2025

Confirmed, that works! Thanks for working through that with me, really appreciate it!

@rac146
Copy link
Author

rac146 commented Feb 26, 2025

For anyone interested, if using Fully Kiosk or another app and want to directly launch the screensaver, it will look something like this:

Debug:
intent:#Intent;component=com.best.deskclock.debug/com.best.deskclock.screensaver.ScreensaverActivity;end

Release:
intent:#Intent;component=com.best.deskclock/com.best.deskclock.screensaver.ScreensaverActivity;end

@BlackyHawky
Copy link
Owner

@rac146
Great news !

Before merging my change into the main branch, I want to clarify one thing with you.

You said in your original post:
"By making this public, users can directly launch the clock screensaver activity (Android 13+ no longer allows you to launch the current Daydream screensaver, so this is a workaround for that limitation)"

What do you mean exactly?
Indeed, the current Daydream screensaver only launches if the device is charging and if the screen turns off by itself.
And it works great on my tablet with Android 14.

@rac146
Copy link
Author

rac146 commented Feb 26, 2025

It's a niche use-case where you can launch the current Daydream screensaver manually instead of waiting for the screen to timeout. Before Android 13 you were basically able to launch the DaydreamActivity directly (which would turn on the current screensaver); after the update to Android 13 or later this is now restricted.

By making your ScreensaverActivity public, it's useful for Kiosk-like applications where you might want to override the default Daydream screensaver behavior and launch a custom activity as a screensaver.

@BlackyHawky
Copy link
Owner

@rac146

It's a niche use-case where you can launch the current Daydream screensaver manually instead of waiting for the screen to timeout.

It's already possible to launch the screensaver manually by long-pressing the application icon and clicking on the "Screensaver" shortcut.

So why are your manipulations necessary?
Sorry, but I don't quite see the point yet (maybe because I don't have and don't know applications like Kiosk) 😅

@rac146
Copy link
Author

rac146 commented Feb 26, 2025

It's alright - a Kiosk app such as Fully Kiosk would present a dashboard/webpage with an always-on screen (in my case it's Home Assistant). It may turn the screen on and off or be triggered on and off by motion or a webhook. Since applications like this take over screen behavior, Daydream screensaver settings built into Android are unreliable and don't always work correctly.

To work around the unreliability, most Kiosk apps give you the ability to custom launch activities as screensavers and bypass the Daydream settings all-together. So for example, you can set up a custom 30 second timeout that will custom launch your ScreensaverActivity after 30 seconds of inactivity. In order for this to work, the custom activity needs to be exported as public.

Before Android 13, Fully Kiosk had an option just to launch the DaydreamActivity directly (like a screensaver override), but like I mentioned Android locked that down after 13 so you can no longer do that. Hope that helps make more sense.

@BlackyHawky
Copy link
Owner

@rac146
Thank you very much for your explanations.
I understand better now. 👍
So you're lucky that this application has a screensaver preview activity. 😉

FYI: I'll publish a new version in a few hours with this change.
By the way, in the new version you'll be able to choose the Material analog clock for the screensaver.

@rac146
Copy link
Author

rac146 commented Feb 26, 2025

No prob, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants