grote / Transportr

Free Public Transport Assistant without Ads or Tracking
https://transportr.app
GNU General Public License v3.0
1.05k stars 188 forks source link

Connection search forgets input of "From" field #706

Closed AltNico closed 3 years ago

AltNico commented 4 years ago

To Reproduce

Expected behavior

Actual behavior

Versions

Logcat output

Here's the output of adb logcat:

$ adb logcat | grep -F "`adb shell ps | grep de.grobox.  | tr -s [:space:] ' ' | cut -d' ' -f2`"
09-09 18:06:28.261  1435  1435 D Zygote  : Forked child process 1827
09-09 18:06:28.266  1461  1721 I ActivityManager: Start proc 1827:de.grobox.liberario/u0a133 for pre-top-activity {de.grobox.liberario/de.grobox.transportr.map.MapActivity}
09-09 18:06:28.357  1827  1827 V AndroidLocationEngine: Initializing.
09-09 18:06:28.358  1827  1827 V MapboxTelemetry: Initializing telemetry.
09-09 18:06:28.364  1827  1827 D NetworkSecurityConfig: Using Network Security Config from resource network_security_config debugBuild: false
09-09 18:06:28.386  1827  1827 V MapboxTelemetry: Disabling telemetry.
09-09 18:06:28.386  1827  1827 D MapboxTelemetry: Shutting down telemetry service.
09-09 18:06:28.393  1827  1827 I robox.liberari: Thread[1,tid=1827,Native,Thread*=0xb3100e00,peer=0x723211f0,"main"] recursive attempt to load library "/data/app/de.grobox.liberario-KBS5ZhV_anmfK-co2N5C-Q==/lib/arm/libmapbox-gl.so"
09-09 18:06:28.397  1827  1827 I chatty  : uid=10133(de.grobox.liberario) identical 1 line
09-09 18:06:28.397  1827  1827 I robox.liberari: Thread[1,tid=1827,Native,Thread*=0xb3100e00,peer=0x723211f0,"main"] recursive attempt to load library "/data/app/de.grobox.liberario-KBS5ZhV_anmfK-co2N5C-Q==/lib/arm/libmapbox-gl.so"
09-09 18:06:28.398  1827  1827 V MapboxTelemetry: Telemetry was already initialized on that state (enabled: false).
09-09 18:06:28.473  1827  1827 E ConstraintLayout: layout_constraintWidth_default="wrap" is deprecated.
09-09 18:06:28.473  1827  1827 E ConstraintLayout: Use layout_width="WRAP_CONTENT" and layout_constrainedWidth="true" instead.
09-09 18:06:28.614  1827  1856 I Adreno-EGL: <qeglDrvAPI_eglInitialize:379>: EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8974_LA.BF.1.1.3_RB1__release_AU (I741a3d36ca)
09-09 18:06:28.614  1827  1856 I Adreno-EGL: OpenGL ES Shader Compiler Version: E031.29.00.00
09-09 18:06:28.614  1827  1856 I Adreno-EGL: Build Date: 04/04/16 Mon
09-09 18:06:28.614  1827  1856 I Adreno-EGL: Local Branch: mybranch19053788
09-09 18:06:28.614  1827  1856 I Adreno-EGL: Remote Branch: quic/LA.BF.1.1.3_rb1.12
09-09 18:06:28.614  1827  1856 I Adreno-EGL: Local Patches: NONE
09-09 18:06:28.614  1827  1856 I Adreno-EGL: Reconstruct Branch: NOTHING
09-09 18:06:28.630  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:28.642  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:28.681  1827  1856 W Gralloc3: mapper 3.x is not supported
09-09 18:06:28.734  1827  1874 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:28.748  1827  1874 I mbgl    : {GLThread 497}[General]: GPU Identifier: Adreno (TM) 330
09-09 18:06:28.748  1827  1874 W mbgl    : {GLThread 497}[OpenGL]: Not using Vertex Array Objects
09-09 18:06:28.766  1827  1827 W robox.liberari: Core platform API violation: Ljava/nio/Buffer;->address:J from Landroid/graphics/Bitmap; using JNI
09-09 18:06:28.767  1827  1827 W robox.liberari: Core platform API violation: Ljava/nio/NIOAccess;->getBaseArrayOffset(Ljava/nio/Buffer;)I from Landroid/graphics/Bitmap; using JNI
09-09 18:06:28.767  1827  1827 W robox.liberari: Core platform API violation: Ljava/nio/NIOAccess;->getBaseArray(Ljava/nio/Buffer;)Ljava/lang/Object; from Landroid/graphics/Bitmap; using JNI
09-09 18:06:30.479  1827  1840 I robox.liberari: Background young concurrent copying GC freed 28651(7963KB) AllocSpace objects, 16(900KB) LOS objects, 89% free, 2983KB/26MB, paused 291us total 205.221ms
09-09 18:06:31.161  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:31.440  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:37.752  1827  1856 D OpenGLRenderer: endAllActiveAnimators on 0x82261f00 (DropDownListView) with handle 0xb31599f0
09-09 18:06:37.832  1827  1827 W IInputConnectionWrapper: getSelectedText on inactive InputConnection
09-09 18:06:37.922  1827  1827 W IInputConnectionWrapper: requestCursorAnchorInfo on inactive InputConnection
09-09 18:06:37.930  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:37.934  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:38.097  1827  2061 W System.err: SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
09-09 18:06:38.097  1827  2061 W System.err: SLF4J: Defaulting to no-operation (NOP) logger implementation
09-09 18:06:38.097  1827  2061 W System.err: SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
09-09 18:06:38.171  1827  2061 D de.grobox.transportr.departures.DeparturesLoader: Departures (12): 3000010
09-09 18:06:38.184  1827  2061 D de.grobox.transportr.departures.DeparturesLoader: Date: Wed Sep 09 18:06:37 GMT+02:00 2020
09-09 18:06:38.642  1827  1827 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@f51db36
09-09 18:06:38.766  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:40.682  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:40.920  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:41.934  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:42.739  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:43.484  1827  1856 D OpenGLRenderer: endAllActiveAnimators on 0x824c8980 (DropDownListView) with handle 0x822ca1b0
09-09 18:06:43.532  1827  1827 I TripsRepository: From: Location{STATION, 3006904, 50.0014360/8.2584440, place=Mainz, name=Hauptbahnhof, products=[HIGH_SPEED_TRAIN, REGIONAL_TRAIN, SUBURBAN_TRAIN, TRAM, BUS]}
09-09 18:06:43.532  1827  1827 I TripsRepository: Via: null
09-09 18:06:43.532  1827  1827 I TripsRepository: To: Location{STATION, 3000010, 50.1068080/8.6626530, place=Frankfurt (Main), name=Hauptbahnhof, products=[HIGH_SPEED_TRAIN, REGIONAL_TRAIN, SUBURBAN_TRAIN, SUBWAY, TRAM, BUS]}
09-09 18:06:43.532  1827  1827 I TripsRepository: Date: Wed Sep 09 18:06:43 GMT+02:00 2020
09-09 18:06:43.532  1827  1827 I TripsRepository: Departure: true
09-09 18:06:43.532  1827  1827 I TripsRepository: Products: [HIGH_SPEED_TRAIN, REGIONAL_TRAIN, SUBURBAN_TRAIN, SUBWAY, TRAM, BUS, FERRY, CABLECAR, ON_DEMAND]
09-09 18:06:43.533  1827  1827 I TripsRepository: Optimize for: LEAST_DURATION
09-09 18:06:43.533  1827  1827 I TripsRepository: Walk Speed: FAST
09-09 18:06:43.552  1827  1827 W IInputConnectionWrapper: getSelectedText on inactive InputConnection
09-09 18:06:43.574  1827  1827 W IInputConnectionWrapper: requestCursorAnchorInfo on inactive InputConnection
09-09 18:06:43.580  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:43.590  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:43.598  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:43.599  1827  1827 W IInputConnectionWrapper: getSelectedText on inactive InputConnection
09-09 18:06:43.599  1827  1827 W IInputConnectionWrapper: requestCursorAnchorInfo on inactive InputConnection
09-09 18:06:43.600  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:43.603  1827  1827 W IInputConnectionWrapper: getTextBeforeCursor on inactive InputConnection
09-09 18:06:46.042  1827  1827 W ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@30b8bb5
09-09 18:06:46.076  1827  1827 E ConstraintLayout: layout_constraintWidth_default="wrap" is deprecated.
09-09 18:06:46.076  1827  1827 E ConstraintLayout: Use layout_width="WRAP_CONTENT" and layout_constrainedWidth="true" instead.
09-09 18:06:46.117  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:46.210  1827  2283 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:46.222  1827  2283 W mbgl    : {GLThread 610}[OpenGL]: Not using Vertex Array Objects
09-09 18:06:47.828  1827  1856 W Adreno-EGL: <qeglDrvAPI_eglGetConfigAttrib:607>: EGL_BAD_ATTRIBUTE
09-09 18:06:48.045  1827  1840 I robox.liberari: NativeAlloc concurrent copying GC freed 218485(11MB) AllocSpace objects, 281(7040KB) LOS objects, 58% free, 4404KB/10MB, paused 167us total 228.014ms

Command as per this Stackoverflow answer.

ialokim commented 4 years ago

Same happens after swapping the from and to location twice on my phone after upgrading to Android 10, crDroid/LineageOS.

Unfortunately, I was unable to reproduce both issues on an emulator with stock Android 10 though.

Strangly enough, I know this had happened before on a Samsung device with Android 7.1.1, but today this is not reproducible anymore either.

@grote Do you have any ideas on where to look for the problem here?

Edit: In my case, this location swapping issue only happens seldomly with some stops and with others not...

Transportr

ialokim commented 4 years ago

I was able to tackle down the swap problem to this line: https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/locations/LocationView.kt#L128

Therefore it does happen consistently on all devices, but only with stations where the name's lengths differ in one. I'll push a fix in some minutes.

The initially reported problem seems to be a different one though, as "Hauptbahnhof, Frankfurt (Main)" and "Hauptbahnhof, Mainz" do not differ by one. I'm still unable to reproduce this issue with different emulators or real devices.

ialokim commented 4 years ago

I suspect the problem to be linked to viewState saving and reloading, perhaps in LocationView https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/locations/LocationView.kt#L146-L175 or in DirectionsFragment https://github.com/grote/Transportr/blob/7b1866e15ae3cb26a31bb69195bc80dcf51c30c1/app/src/main/java/de/grobox/transportr/trips/search/DirectionsFragment.kt#L151-L169

Perhaps also a problem with Proguard and serializing WrapLocations?

@AltNico Does this only happen with the "From" field, or also sometimes with the "To" field?

Edit: Indeed I was now able to reproduce the empty "From" field in the situation described above on a release build (but still not with debug).