forked from MozillaReality/FirefoxReality
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes MozillaReality#1397: Megazord support
(currently built against local versions of a-c, since upstream work is still inflight) This PR upgrades a-c to 5.0.0, which is now using 0.35.0 appservices release that introduces a "default megazord", which is what the consuming application now uses by default. See megazord docs: https://mozilla.github.io/application-services/docs/applications/consuming-megazord-libraries.html TODO - we want to use Gecko's network stack
- Loading branch information
Grisha Kruglov
committed
Jul 18, 2019
1 parent
dd0f53c
commit 78a5f4f
Showing
4 changed files
with
57 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 0 additions & 47 deletions
47
app/src/common/shared/org/mozilla/vrbrowser/VRBrowserApplication.java
This file was deleted.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
app/src/common/shared/org/mozilla/vrbrowser/VRBrowserApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*- | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
package org.mozilla.vrbrowser | ||
|
||
import android.app.Application | ||
|
||
import org.mozilla.vrbrowser.browser.Places | ||
import org.mozilla.vrbrowser.browser.Services | ||
import org.mozilla.vrbrowser.db.AppDatabase | ||
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper | ||
|
||
import mozilla.components.lib.fetch.httpurlconnection.HttpURLConnectionClient | ||
import mozilla.components.support.base.log.Log | ||
import mozilla.components.support.base.log.sink.AndroidLogSink | ||
import mozilla.components.support.rusthttp.RustHttpConfig | ||
import mozilla.components.support.rustlog.RustLog | ||
|
||
class VRBrowserApplication : Application() { | ||
|
||
private var appExecutors: AppExecutors? = null | ||
lateinit var services: Services | ||
private set | ||
lateinit var places: Places | ||
private set | ||
|
||
private val database: AppDatabase | ||
get() = AppDatabase.getInstance(this, appExecutors) | ||
|
||
val repository: DataRepository | ||
get() = DataRepository.getInstance(database, appExecutors) | ||
|
||
override fun onCreate() { | ||
super.onCreate() | ||
|
||
// Enable android-components and application-services logging. | ||
Log.addSink(AndroidLogSink()) | ||
RustLog.enable() | ||
|
||
// Specify network stack to be used by application-services libraries. | ||
RustHttpConfig.setClient(lazy { HttpURLConnectionClient() }) | ||
|
||
appExecutors = AppExecutors() | ||
places = Places(this) | ||
services = Services(this, places) | ||
|
||
TelemetryWrapper.init(this) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters