Commit 96237457 authored by Evan W. Patton's avatar Evan W. Patton Committed by Jeffrey Schiller

Handle compiled app installation via browser

Change-Id: Ia72226088534933b61021100a990fc74979c1d5e
parent 20ac639f
......@@ -55,6 +55,16 @@ public class BuildOutputServlet extends OdeServlet {
// Set a default http header to avoid security vulnerabilities.
CACHE_HEADERS.setNotCacheable(resp);
resp.setContentType(CONTENT_TYPE);
if ("store=1".equals(req.getQueryString())) { // Play Store companion adds this for Chrome to
// do the right thing w.r.t. the download
String body = "<!DOCTYPE html><html><head><meta http-equiv=\"refresh\" content=\"0; url=" +
req.getRequestURI() + "\" /></head><body></body></html>";
resp.setContentLength(body.length());
ServletOutputStream os = resp.getOutputStream();
os.write(body.getBytes());
os.close();
return;
}
RawFile downloadableFile;
......
......@@ -249,7 +249,7 @@ public class PhoneStatus extends AndroidNonvisibleComponent implements Component
m.invoke(o, url);
} catch (Exception e) {
// Fall back to using the browser
Uri uri = Uri.parse(url);
Uri uri = Uri.parse(url + "?store=1");
Intent intent = new Intent(Intent.ACTION_VIEW).setData(uri);
form.startActivity(intent);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment