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

Widget does not get created in work profile. #121

Open
Artem-B opened this issue May 7, 2023 · 7 comments
Open

Widget does not get created in work profile. #121

Artem-B opened this issue May 7, 2023 · 7 comments
Labels
HowTos HowTos, Questions and Answers

Comments

@Artem-B
Copy link

Artem-B commented May 7, 2023

When I click on "Go To Home Screen" button on the "please add a widget" page for todo agenda running in the work profile, it brings me to the home page, but instead of showing the widget selection, I get an error popup saying "You're using this app outside of the work profile" and the widget does not get created. I can only see the widget for the default profile.

This happens on Android 13, running on Samsung Galaxy S23.

@yvolk
Copy link
Member

yvolk commented May 12, 2023

Looks like "Work profile" is present in Android for a long time (I see https://support.google.com/work/android/answer/6191949 ), but nobody mentioned this for years.
And the problem that you encountered is quite generic, see https://www.google.com/search?q=%22You%27re+using+this+app+outside+of+your+work+profile%22

@Artem-B Putting this error message aside, can you simply create a widget (from proper "home screen" maybe...)? Just like you added (did you?) any other widgets in the work profile.

@Artem-B
Copy link
Author

Artem-B commented May 12, 2023

There's no "work" home screen. The screen is common for all profiles.

The way it seems to work for other apps is that when that app is installed in the work profile, it appears as a separate app in the app drawer (same icon, but with an added badge). Each app instance provides its own set of widgets, so, let's say, for a calendar widget, there's a normal widget, and there's the same widget with the "work" badge.
For a calendar having two widgets is a pain. Android allows "linking" app data and allow work profile to see default profile data, but it only works one way. Default profile can not see work data. In order to have one widget with work and private calendars, the widget must be provided by the work profile.

In case of todoagenda, the instance in the work profile for some reason does not provide that widget, so there's nothing I can add to the home screen.

todoagenda seems to be somewhat unusual compared to other widget-providing apps. There's no widget after the app is installed and it needs an extra step to create it and it's the step that appears to fail. AFAICT all other apps somehow provide their widgets by default right after they have been installed and that may be one way for the widget to appear in the work profile. I have no clue how Android implements it, so I'm just guessing based on observed behavior.

@yvolk
Copy link
Member

yvolk commented May 12, 2023

@Artem-B Thank you for observations.
I need to investigate this. Suspect that some configuration change in Android "manifest" will be enough :-)
Will return to this as soon as I have time...

Do you know any Open Source widget that works in the "Work profile"?

@Artem-B
Copy link
Author

Artem-B commented May 12, 2023

Currently I have only two apps in the work profile that sort of have source code available.
That's Chrome and Calendar. I assume that open-source chromium would behave similarly to chrome in the widgets department. The stock android calendar seems to have source code available, too and it does indeed mention widgets in the manifest:
https://android.googlesource.com/platform/packages/apps/Calendar.git/+/refs/heads/master/AndroidManifest.xml#187

@KenMacD
Copy link

KenMacD commented Jul 10, 2023

I don't know if it's possible, but it'd be really nice if one widget could show items from both profiles.

@Artem-B
Copy link
Author

Artem-B commented Jul 10, 2023

It should be possible.
Work profile has an option in the settings allowing it to access private data (but you apparently can not access work data from the private app) and I'm currently use a google calendar widget from the work profile to show me both bork and private calendars.

I suspect that once agenda widget can be created in the work profile, it should be able to have access to private and work calendars, too.

@KenMacD
Copy link

KenMacD commented Jul 12, 2023

@Artem-B I guess this would work for most. For me, I wouldn't want my work profile to have access to my personal calendar, so maybe I'll be stuck with two widgets. I wish work-profiles had the option to go the other way with calendar access.

@yvolk yvolk added the HowTos HowTos, Questions and Answers label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HowTos HowTos, Questions and Answers
Projects
None yet
Development

No branches or pull requests

3 participants