File tree Expand file tree Collapse file tree 2 files changed +14
-6
lines changed
testapps/on_device_unit_tests/test_app Expand file tree Collapse file tree 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ def loadUrl():
110110 print ('asked to open url' , args ['url' ])
111111 activity = get_android_python_activity ()
112112 activity .loadUrl (args ['url' ])
113+ return ('' , 204 )
113114
114115
115116@app .route ('/vibrate' )
@@ -122,7 +123,8 @@ def vibrate():
122123 if 'time' not in args :
123124 print ('ERROR: asked to vibrate but without time argument' )
124125 print ('asked to vibrate' , args ['time' ])
125- return vibrate_with_pyjnius (int (float (args ['time' ]) * 1000 ))
126+ vibrate_with_pyjnius (int (float (args ['time' ]) * 1000 ))
127+ return ('' , 204 )
126128
127129
128130@app .route ('/orientation' )
@@ -135,4 +137,5 @@ def orientation():
135137 print ('ERROR: asked to orient but no dir specified' )
136138 return 'No direction specified '
137139 direction = args ['dir' ]
138- return set_device_orientation (direction )
140+ set_device_orientation (direction )
141+ return ('' , 204 )
Original file line number Diff line number Diff line change 8585 app_flask .TESTS_TO_PERFORM = tests_to_perform
8686
8787 print ('Current directory is ' , realpath (curdir ))
88- if realpath (curdir ).startswith ('/data' ):
89- app_flask .app .run (debug = False )
90- else :
91- app_flask .app .run (debug = True )
88+ flask_debug = not realpath (curdir ).startswith ('/data' )
89+
90+ # Flask is run non-threaded since it tries to resolve app classes
91+ # through pyjnius from request handlers. That doesn't work since the
92+ # JNI ends up using the Java system class loader in new native
93+ # threads.
94+ #
95+ # https://github.com/kivy/python-for-android/issues/2533
96+ app_flask .app .run (threaded = False , debug = flask_debug )
9297else :
9398 # we don't have kivy or flask in our
9499 # requirements, so we run unittests in terminal
You can’t perform that action at this time.
0 commit comments