[android] Add support for Samsung DeX mode #5777

Merged
meenbeese merged 1 commit from samsung-dex into master 2023-12-15 15:49:05 +00:00
meenbeese commented 2023-08-20 23:26:09 +00:00 (Migrated from github.com)

Signed-off-by: meenbeese meenbeese@tutanota.com

Resolves organicmaps/organicmaps#2218 by adding basic but working support for DeX mode.

Signed-off-by: meenbeese [meenbeese@tutanota.com](mailto:meenbeese@tutanota.com) Resolves https://git.omaps.dev/organicmaps/organicmaps/issues/2218 by adding basic but working support for DeX mode.
rtsisyk reviewed 2023-08-20 23:26:09 +00:00
biodranik (Migrated from github.com) reviewed 2023-08-21 20:22:51 +00:00
biodranik (Migrated from github.com) commented 2023-08-21 20:20:47 +00:00

Remove only required=true?

This is an important change that may require adding support for non-touchscreen input (remote controls, joysticks, etc.).

Remove only required=true? This is an important change that may require adding support for non-touchscreen input (remote controls, joysticks, etc.).
biodranik (Migrated from github.com) commented 2023-08-21 20:21:06 +00:00

What is the impact of it for normal phones?

What is the impact of it for normal phones?
biodranik (Migrated from github.com) commented 2023-08-21 20:22:04 +00:00

Isn't it a dangerous change? All these events may not be handled in the code. Why is it needed for the SplashActivity?

Isn't it a dangerous change? All these events may not be handled in the code. Why is it needed for the SplashActivity?
biodranik (Migrated from github.com) commented 2023-08-21 20:22:47 +00:00

Are there some docs about this key? It would be great to insert a link into a comment. And maybe to add necessary comments to other changes too.

Are there some docs about this key? It would be great to insert a link into a comment. And maybe to add necessary comments to other changes too.
meenbeese (Migrated from github.com) reviewed 2023-08-21 23:37:01 +00:00
meenbeese (Migrated from github.com) commented 2023-08-21 23:37:01 +00:00

Setting this attribute to "true", allows the user to launch the activity in split-screen and free-form modes. If you set the attribute to ”false”, the app can't be tested or optimized for a multi-window environment. It shouldn't negatively affect standard full-screen usage on normal phones.

Setting this attribute to "true", allows the user to launch the activity in split-screen and free-form modes. If you set the attribute to ”false”, the app can't be tested or optimized for a multi-window environment. It shouldn't negatively affect standard full-screen usage on normal phones.
meenbeese (Migrated from github.com) reviewed 2023-08-21 23:43:19 +00:00
meenbeese (Migrated from github.com) commented 2023-08-21 23:43:19 +00:00

I can set it to android:required="false" because requiring this breaks DeX mode according to the documentation.

I do not see how this forces us to add support for external accessories explicitly as it only allows for non-touchscreen devices. We can officially only maintain touch support while deleting this for DeX mode purposes.

I can set it to `android:required="false"` because requiring this breaks DeX mode according to the documentation. I do not see how this forces us to add support for external accessories explicitly as it only allows for non-touchscreen devices. We can officially only maintain touch support while deleting this for DeX mode purposes.
meenbeese (Migrated from github.com) reviewed 2023-08-21 23:49:04 +00:00
meenbeese (Migrated from github.com) commented 2023-08-21 23:49:03 +00:00

No this is not dangerous. It just tells the system to not restart the activity, but to receive a call to the onConfigurationChanged(Configuration) method along with the new configuration. It saves us from writing a bunch of code to let the processes live when the orientation expectedly changes.

No this is not dangerous. It just tells the system to not restart the activity, but to receive a call to the `onConfigurationChanged(Configuration)` method along with the new configuration. It saves us from writing a bunch of code to let the processes live when the orientation expectedly changes.
meenbeese (Migrated from github.com) reviewed 2023-08-21 23:53:12 +00:00
meenbeese (Migrated from github.com) commented 2023-08-21 23:53:12 +00:00

I got it from the documentation here. I will now be adding all the necessary comments for the rest of the code too.

I got it from the documentation [here](https://developer.samsung.com/samsung-dex/modify-optimizing.html). I will now be adding all the necessary comments for the rest of the code too.
biodranik (Migrated from github.com) reviewed 2023-08-23 05:06:48 +00:00
biodranik (Migrated from github.com) commented 2023-08-23 05:06:47 +00:00

Are there any additional effects from enabling it? How OpenGL/Vulkan windows behave after it is enabled? Are there any additional callbacks or other changes in the system behavior?

Are there any additional effects from enabling it? How OpenGL/Vulkan windows behave after it is enabled? Are there any additional callbacks or other changes in the system behavior?
biodranik (Migrated from github.com) reviewed 2023-08-23 05:07:52 +00:00
biodranik (Migrated from github.com) commented 2023-08-23 05:07:52 +00:00

Why is it needed in the first place in the SplashActivity? This activity's role is to properly pass data to other activities and to finish the startup ASAP.

Why is it needed in the first place in the SplashActivity? This activity's role is to properly pass data to other activities and to finish the startup ASAP.
meenbeese (Migrated from github.com) reviewed 2023-08-23 18:46:37 +00:00
meenbeese (Migrated from github.com) commented 2023-08-23 18:46:37 +00:00

The official documentation suggests adding this to the main activity of the application. I assumed that the SplashActivity is the correct one for OM, but I can correct this if I am wrong here.

We are just trying to guarantee that unexpected configuration changes don't crash the app.

The official documentation suggests adding this to the main activity of the application. I assumed that the SplashActivity is the correct one for OM, but I can correct this if I am wrong here. We are just trying to guarantee that unexpected configuration changes don't crash the app.
meenbeese (Migrated from github.com) reviewed 2023-08-23 18:56:00 +00:00
meenbeese (Migrated from github.com) commented 2023-08-23 18:55:59 +00:00

I couldn't find any additional side effects from enabling it. Everything should behave as the same given that this only allows optional resizing and does not change anything else. Theoretically, it could cause the startup time to be higher if launched on two, three, four etc. displays on the same time but the user must explicitly trigger this.

There are the new methods created (optional to use):

isInMultiWindowMode()
Indicates whether the activity is in multi-window mode.
isInPictureInPictureMode()
Indicates whether the activity is in picture-in-picture mode.
onMultiWindowModeChanged()
The system calls this method whenever the activity goes into or out of multi-window mode. The system passes the method a value of true if the activity is entering multi-window mode or false if the activity is leaving multi-window mode.
onPictureInPictureModeChanged()
The system calls this method whenever the activity goes into or out of picture-in-picture mode. The system passes the method a value of true if the activity is entering picture-in-picture mode or false if the activity is leaving picture-in-picture mode.

I couldn't find any additional side effects from enabling it. Everything should behave as the same given that this only allows optional resizing and does not change anything else. Theoretically, it could cause the startup time to be higher if launched on two, three, four etc. displays on the same time but the user must explicitly trigger this. There are the new methods created (optional to use): > [isInMultiWindowMode()](https://developer.android.com/reference/android/app/Activity#isInMultiWindowMode()) Indicates whether the activity is in multi-window mode. > [isInPictureInPictureMode()](https://developer.android.com/reference/android/app/Activity#isInPictureInPictureMode()) Indicates whether the activity is in picture-in-picture mode. > [onMultiWindowModeChanged()](https://developer.android.com/reference/android/app/Activity#onMultiWindowModeChanged(boolean)) The system calls this method whenever the activity goes into or out of multi-window mode. The system passes the method a value of true if the activity is entering multi-window mode or false if the activity is leaving multi-window mode. > [onPictureInPictureModeChanged()](https://developer.android.com/reference/android/app/Activity#onPictureInPictureModeChanged(boolean)) The system calls this method whenever the activity goes into or out of picture-in-picture mode. The system passes the method a value of true if the activity is entering picture-in-picture mode or false if the activity is leaving picture-in-picture mode.
Jean-BaptisteC (Migrated from github.com) approved these changes 2023-10-07 18:05:24 +00:00
Jean-BaptisteC (Migrated from github.com) left a comment

Samsung Galaxy Tab S6 Lite - Android 13 (Mode Dex)
Pixel 6 - Android 14

✅ Samsung Galaxy Tab S6 Lite - Android 13 (Mode Dex) ✅ Pixel 6 - Android 14
biodranik (Migrated from github.com) reviewed 2023-10-08 06:48:47 +00:00
biodranik (Migrated from github.com) commented 2023-10-08 06:48:47 +00:00

Now OM claims that the touch input is required to use the app. Removing that claim allows users to install OM on non-touch devices. Where users can not use OM, because there is no touch support.

Now OM claims that the touch input is required to use the app. Removing that claim allows users to install OM on non-touch devices. Where users can not use OM, because there is no touch support.
biodranik (Migrated from github.com) reviewed 2023-10-08 06:49:39 +00:00
biodranik (Migrated from github.com) commented 2023-10-08 06:49:39 +00:00

Did you test this resizing on real devices?

Did you test this resizing on real devices?
biodranik (Migrated from github.com) reviewed 2023-10-08 06:51:05 +00:00
biodranik (Migrated from github.com) commented 2023-10-08 06:51:05 +00:00
  1. Why does the official documentation suggest adding it? What exactly will work/won't work with/without this change?
  2. Is this line change really required in our case?
  3. Did you test it on real devices?
1. Why does the official documentation suggest adding it? What exactly will work/won't work with/without this change? 2. Is this line change really required in our case? 3. Did you test it on real devices?
biodranik (Migrated from github.com) reviewed 2023-10-08 06:54:14 +00:00
biodranik (Migrated from github.com) left a comment

Note that your changes are related to every OM user, not just a few DeX users. That's why it is critically important to test it properly with and without DeX mode.

Note that your changes are related to every OM user, not just a few DeX users. That's why it is _critically important_ to test it properly with and without DeX mode.
This repo is archived. You cannot comment on pull requests.
No labels
Accessibility
Accessibility
Address
Address
Android
Android
Android Auto
Android Auto
Android Automotive (AAOS)
Android Automotive (AAOS)
API
API
AppGallery
AppGallery
AppStore
AppStore
Battery and Performance
Battery and Performance
Blocker
Blocker
Bookmarks and Tracks
Bookmarks and Tracks
Borders
Borders
Bug
Bug
Build
Build
CarPlay
CarPlay
Classificator
Classificator
Community
Community
Core
Core
CrashReports
CrashReports
Cycling
Cycling
Desktop
Desktop
DevEx
DevEx
DevOps
DevOps
dev_sandbox
dev_sandbox
Directions
Directions
Documentation
Documentation
Downloader
Downloader
Drape
Drape
Driving
Driving
Duplicate
Duplicate
Editor
Editor
Elevation
Elevation
Enhancement
Enhancement
Epic
Epic
External Map Datasets
External Map Datasets
F-Droid
F-Droid
Fonts
Fonts
Frequently User Reported
Frequently User Reported
Fund
Fund
Generator
Generator
Good first issue
Good first issue
Google Play
Google Play
GPS
GPS
GSoC
GSoC
iCloud
iCloud
Icons
Icons
iOS
iOS
Legal
Legal
Linux Desktop
Linux Desktop
Linux packaging
Linux packaging
Linux Phone
Linux Phone
Mac OS
Mac OS
Map Data
Map Data
Metro
Metro
Navigation
Navigation
Need Feedback
Need Feedback
Night Mode
Night Mode
NLnet 2024-06-281
NLnet 2024-06-281
No Feature Parity
No Feature Parity
Opening Hours
Opening Hours
Outdoors
Outdoors
POI Info
POI Info
Privacy
Privacy
Public Transport
Public Transport
Raw Idea
Raw Idea
Refactoring
Refactoring
Regional
Regional
Regression
Regression
Releases
Releases
RoboTest
RoboTest
Route Planning
Route Planning
Routing
Routing
Ruler
Ruler
Search
Search
Security
Security
Styles
Styles
Tests
Tests
Track Recording
Track Recording
Translations
Translations
TTS
TTS
UI
UI
UX
UX
Walk Navigation
Walk Navigation
Watches
Watches
Web
Web
Wikipedia
Wikipedia
Windows
Windows
Won't fix
Won't fix
World Map
World Map
No milestone
No project
No assignees
2 participants
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: organicmaps/organicmaps-tmp#5777
No description provided.