JUMP TO SOLUTION Solved

Original topic:

Galaxy fold/flip crash UnsupportedOperationException

(Topic created: 06-07-2024 04:18 PM)
1251 Views
saichoko
Constellation
Options
Fold & Flip Phones

I'm android developer, we detect galaxy fold/flip will crash in large numbers.

I posted in android issue tracker.

https://issuetracker.google.com/issues/344735119

similar

https://issuetracker.google.com/issues/344912774

We're now pretty sure it's a system problem, because sometimes the crash code happens directly in the activity's super.onCreate, not the app specific code, not a specific screen, but every screen has a crash record.

 

java.lang.UnsupportedOperationException: Tried to obtain display from a Context not associated with one. Only visual Contexts (such as Activity or one created with Context#createWindowContext) or ones created with Context#createDisplayContext are associated with displays. Other types of Contexts are typically related to background entities and may return an arbitrary display.
	at android.app.ContextImpl.getDisplay(ContextImpl.java:3166)
	at android.content.ContextWrapper.getDisplay(ContextWrapper.java:1209)
	at android.content.ContextWrapper.getDisplay(ContextWrapper.java:1209)
	at android.content.ContextWrapper.getDisplay(ContextWrapper.java:1209)
	at androidx.window.extensions.layout.WindowLayoutComponentImpl.shouldReportDisplayFeatures(WindowLayoutComponentImpl.java:355)
	at androidx.window.extensions.layout.WindowLayoutComponentImpl.getDisplayFeatures(WindowLayoutComponentImpl.java:313)
	at androidx.window.extensions.layout.WindowLayoutComponentImpl.getWindowLayoutInfo(WindowLayoutComponentImpl.java:265)
	at androidx.window.extensions.layout.WindowLayoutComponentImpl.onDisplayFeaturesChanged(WindowLayoutComponentImpl.java:250)
	at androidx.window.extensions.layout.WindowLayoutComponentImpl.$r8$lambda$CcdqSJgN0v7j8yjFplaR5_gC_ag(Unknown Source:0)
	at androidx.window.extensions.layout.WindowLayoutComponentImpl$$ExternalSyntheticLambda0.accept(Unknown Source:4)
	at androidx.window.util.BaseDataProducer.notifyDataChanged(BaseDataProducer.java:101)
	at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.notifyFoldingFeatureChange(DeviceStateManagerFoldingFeatureProducer.java:212)
	at androidx.window.common.DeviceStateManagerFoldingFeatureProducer.-$$Nest$mnotifyFoldingFeatureChange(Unknown Source:0)
	at androidx.window.common.DeviceStateManagerFoldingFeatureProducer$1.$r8$lambda$Cq8m54r9pahGe0xgKiimh_L76YM(Unknown Source:0)
	at androidx.window.common.DeviceStateManagerFoldingFeatureProducer$1$$ExternalSyntheticLambda0.accept(Unknown Source:4)
	at androidx.window.common.RawFoldingFeatureProducer.getData(RawFoldingFeatureProducer.java:71)
	at androidx.window.common.DeviceStateManagerFoldingFeatureProducer$1.onStateChanged(DeviceStateManagerFoldingFeatureProducer.java:87)
	at android.hardware.devicestate.DeviceStateManagerGlobal$DeviceStateCallbackWrapper.lambda$notifyStateChanged$2(DeviceStateManagerGlobal.java:428)
	at android.hardware.devicestate.DeviceStateManagerGlobal$DeviceStateCallbackWrapper.$r8$lambda$FiFeo7UDl_Jzgv3ijVmtwGDn8K0(Unknown Source:0)
	at android.hardware.devicestate.DeviceStateManagerGlobal$DeviceStateCallbackWrapper$$ExternalSyntheticLambda0.run(Unknown Source:4)
	at android.os.Handler.handleCallback(Handler.java:958)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:230)
	at android.os.Looper.loop(Looper.java:319)
	at android.app.ActivityThread.main(ActivityThread.java:8919)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)

 

1 Solution


Accepted Solutions
Solution
saichoko
Constellation
Options
Fold & Flip Phones

Our new app version has completely eliminated this problem.
which was solved by calling Webview.destroy().

https://issues.chromium.org/issues/351582214
https://chromium-review.googlesource.com/c/chromium/src/+/5548161

Others can also solve this problem by waiting for the new webview to be released (late july).

View solution in context

0 Likes
Reply
3 Replies
Solution
saichoko
Constellation
Options
Fold & Flip Phones

Our new app version has completely eliminated this problem.
which was solved by calling Webview.destroy().

https://issues.chromium.org/issues/351582214
https://chromium-review.googlesource.com/c/chromium/src/+/5548161

Others can also solve this problem by waiting for the new webview to be released (late july).

0 Likes
Reply
Rocknus_13
Constellation
Options
Fold & Flip Phones
Thank you all for all the info
0 Likes
Reply
userUVTEsrmOUe
Constellation
Options
Fold & Flip Phones
What issue exactly with the flip? My flip 6 main screen stopped working and had to replaced. Only 1 month old
0 Likes
Reply