Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

FxA #1973

Merged
merged 21 commits into from
Oct 25, 2019
Merged

FxA #1973

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -443,9 +443,15 @@ dependencies {
implementation deps.android_components.browser_search
implementation deps.android_components.browser_storage
implementation deps.android_components.browser_domains
implementation deps.android_components.service_accounts
implementation deps.android_components.ui_autocomplete
implementation deps.android_components.concept_fetch
implementation deps.android_components.lib_fetch
implementation deps.android_components.support_rustlog
implementation deps.android_components.support_rusthttp

// TODO this should not be necessary at all, see Services.kt
implementation deps.work.runtime

// Kotlin dependency
implementation deps.kotlin.stdlib
Expand Down
18 changes: 15 additions & 3 deletions app/src/common/shared/org/mozilla/vrbrowser/VRBrowserActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@
import org.mozilla.vrbrowser.crashreporting.CrashReporterService;
import org.mozilla.vrbrowser.crashreporting.GlobalExceptionHandler;
import org.mozilla.vrbrowser.geolocation.GeolocationWrapper;
import org.mozilla.vrbrowser.ui.widgets.prompts.ConfirmPromptWidget;
import org.mozilla.vrbrowser.utils.DeviceType;
import org.mozilla.vrbrowser.input.MotionEventGenerator;
import org.mozilla.vrbrowser.search.SearchEngineWrapper;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
Expand All @@ -67,7 +65,9 @@
import org.mozilla.vrbrowser.ui.widgets.WindowWidget;
import org.mozilla.vrbrowser.ui.widgets.Windows;
import org.mozilla.vrbrowser.ui.widgets.dialogs.CrashDialogWidget;
import org.mozilla.vrbrowser.ui.widgets.prompts.ConfirmPromptWidget;
import org.mozilla.vrbrowser.utils.ConnectivityReceiver;
import org.mozilla.vrbrowser.utils.DeviceType;
import org.mozilla.vrbrowser.utils.LocaleUtils;
import org.mozilla.vrbrowser.utils.ServoUtils;
import org.mozilla.vrbrowser.utils.SystemUtils;
Expand Down Expand Up @@ -212,6 +212,7 @@ protected void onCreate(Bundle savedInstanceState) {

Bundle extras = getIntent() != null ? getIntent().getExtras() : null;
SessionStore.get().setContext(this, extras);
SessionStore.get().initializeServices();
SessionStore.get().initializeStores(this);

// Create broadcast receiver for getting crash messages from crash process
Expand Down Expand Up @@ -387,7 +388,13 @@ protected void onResume() {
widget.onResume();
}
handleConnectivityChange();
mConnectivityReceiver.register(this, () -> runOnUiThread(() -> handleConnectivityChange()));
mConnectivityReceiver.register(this, () -> runOnUiThread(this::handleConnectivityChange));

// If we're signed-in, poll for any new device events (e.g. received tabs) on activity resume.
// There's no push support right now, so this helps with the perception of speedy tab delivery.
((VRBrowserApplication)getApplicationContext()).getAccounts().refreshDevicesAsync();
((VRBrowserApplication)getApplicationContext()).getAccounts().pollForEventsAsync();

super.onResume();
}

Expand Down Expand Up @@ -1403,6 +1410,11 @@ public WindowWidget getFocusedWindow() {
return mWindows.getFocusedWindow();
}

@Override
public TrayWidget getTray() {
return mTray;
}

private native void addWidgetNative(int aHandle, WidgetPlacement aPlacement);
private native void updateWidgetNative(int aHandle, WidgetPlacement aPlacement);
private native void updateVisibleWidgetsNative();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import android.content.Context;
import android.content.res.Configuration;

import org.mozilla.vrbrowser.browser.Accounts;
import org.mozilla.vrbrowser.browser.Places;
import org.mozilla.vrbrowser.browser.Services;
import org.mozilla.vrbrowser.db.AppDatabase;
import org.mozilla.vrbrowser.db.DataRepository;
import org.mozilla.vrbrowser.telemetry.TelemetryWrapper;
Expand All @@ -20,7 +22,9 @@ public class VRBrowserApplication extends Application {

private AppExecutors mAppExecutors;
private BitmapCache mBitmapCache;
private Services mServices;
private Places mPlaces;
private Accounts mAccounts;

@Override
public void onCreate() {
Expand All @@ -29,6 +33,8 @@ public void onCreate() {
mAppExecutors = new AppExecutors();
mPlaces = new Places(this);
mBitmapCache = new BitmapCache(this, mAppExecutors.diskIO(), mAppExecutors.mainThread());
mServices = new Services(this, mPlaces);
mAccounts = new Accounts(this);

TelemetryWrapper.init(this);
}
Expand All @@ -45,6 +51,10 @@ public void onConfigurationChanged(Configuration newConfig) {
LocaleUtils.setLocale(this);
}

public Services getServices() {
return mServices;
}

public Places getPlaces() {
return mPlaces;
}
Expand All @@ -64,4 +74,8 @@ public DataRepository getRepository() {
public BitmapCache getBitmapCache() {
return mBitmapCache;
}

public Accounts getAccounts() {
return mAccounts;
}
}
Loading