зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1400605 - Fall back to launching Fennec if we've lost the manifest for a PWA. r=snorp
This commit is contained in:
Родитель
5738242a26
Коммит
b04896c885
|
@ -30,6 +30,7 @@ import android.widget.TextView;
|
|||
|
||||
import org.mozilla.gecko.ActivityHandlerHelper;
|
||||
import org.mozilla.gecko.AppConstants;
|
||||
import org.mozilla.gecko.BrowserApp;
|
||||
import org.mozilla.gecko.DoorHangerPopup;
|
||||
import org.mozilla.gecko.GeckoScreenOrientation;
|
||||
import org.mozilla.gecko.GeckoSharedPrefs;
|
||||
|
@ -128,6 +129,21 @@ public class WebAppActivity extends AppCompatActivity
|
|||
mManifest = WebAppManifest.fromFile(getIntent().getStringExtra(MANIFEST_URL),
|
||||
getIntent().getStringExtra(MANIFEST_PATH));
|
||||
|
||||
if (mManifest == null) {
|
||||
Log.w(LOGTAG, "Cannot retrieve manifest, launching in Firefox");
|
||||
try {
|
||||
Intent intent = new Intent(this, BrowserApp.class);
|
||||
intent.setAction(Intent.ACTION_VIEW);
|
||||
intent.setData(getIntent().getData());
|
||||
intent.setPackage(getPackageName());
|
||||
startActivity(intent);
|
||||
} catch (Exception e) {
|
||||
Log.e(LOGTAG, "Failed to fall back to launching in Firefox");
|
||||
}
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
updateFromManifest();
|
||||
|
||||
mGeckoView.loadUri(mManifest.getStartUri().toString());
|
||||
|
|
Загрузка…
Ссылка в новой задаче