Bug 1401737 - 3. Consolidate GeckoAppShell initialization; r=me

Consolidate GeckoAppShell initialization to GeckoApplication.onCreate
instead of spreading it out over different Activities. r=me for trivial
patch.

MozReview-Commit-ID: J0iv3qePlci
This commit is contained in:
Jim Chen 2017-10-05 14:59:32 -04:00
Родитель 1e2e862aea
Коммит 7109022bac
5 изменённых файлов: 4 добавлений и 9 удалений

Просмотреть файл

@ -1058,8 +1058,6 @@ public abstract class GeckoApp extends GeckoActivity
**/
@Override
public void onCreate(Bundle savedInstanceState) {
GeckoAppShell.ensureCrashHandling();
// Enable Android Strict Mode for developers' local builds (the "default" channel).
if ("default".equals(AppConstants.MOZ_UPDATE_CHANNEL)) {
enableStrictMode();

Просмотреть файл

@ -202,6 +202,10 @@ public class GeckoApplication extends Application
Log.i(LOG_TAG, "zerdatime " + SystemClock.elapsedRealtime() +
" - application start");
final Context context = getApplicationContext();
GeckoAppShell.ensureCrashHandling();
GeckoAppShell.setApplicationContext(context);
// PRNG is a pseudorandom number generator.
// We need to apply PRNG Fixes before any use of Java Cryptography Architecture.
// We make use of various JCA methods in data providers for generating GUIDs, as part of FxA
@ -223,8 +227,6 @@ public class GeckoApplication extends Application
GeckoActivityMonitor.getInstance().initialize(this);
MemoryMonitor.getInstance().init(this);
final Context context = getApplicationContext();
GeckoAppShell.setApplicationContext(context);
GeckoAppShell.setHapticFeedbackDelegate(this);
GeckoAppShell.setGeckoInterface(new GeckoAppShell.GeckoInterface() {
@Override

Просмотреть файл

@ -101,7 +101,6 @@ public class GeckoService extends Service {
@Override // Service
public void onCreate() {
GeckoAppShell.ensureCrashHandling();
GeckoThread.onResume();
super.onCreate();

Просмотреть файл

@ -54,8 +54,6 @@ public class LauncherActivity extends Activity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
GeckoAppShell.ensureCrashHandling();
final SafeIntent safeIntent = new SafeIntent(getIntent());
// Is this deep link?

Просмотреть файл

@ -106,8 +106,6 @@ public class SearchActivity extends Locales.LocaleAwareFragmentActivity
@Override
protected void onCreate(Bundle savedInstanceState) {
GeckoAppShell.ensureCrashHandling();
super.onCreate(savedInstanceState);
setContentView(R.layout.search_activity_main);