File tree 2 files changed +14
-6
lines changed
testapps/on_device_unit_tests/test_app 2 files changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,7 @@ def loadUrl():
110
110
print ('asked to open url' , args ['url' ])
111
111
activity = get_android_python_activity ()
112
112
activity .loadUrl (args ['url' ])
113
+ return ('' , 204 )
113
114
114
115
115
116
@app .route ('/vibrate' )
@@ -122,7 +123,8 @@ def vibrate():
122
123
if 'time' not in args :
123
124
print ('ERROR: asked to vibrate but without time argument' )
124
125
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 )
126
128
127
129
128
130
@app .route ('/orientation' )
@@ -135,4 +137,5 @@ def orientation():
135
137
print ('ERROR: asked to orient but no dir specified' )
136
138
return 'No direction specified '
137
139
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 85
85
app_flask .TESTS_TO_PERFORM = tests_to_perform
86
86
87
87
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 )
92
97
else :
93
98
# we don't have kivy or flask in our
94
99
# requirements, so we run unittests in terminal
You can’t perform that action at this time.
0 commit comments