2010-06-04 05:16:20 +04:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
2012-05-21 15:12:37 +04:00
|
|
|
* 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/. */
|
2010-06-04 05:16:20 +04:00
|
|
|
|
|
|
|
#include <android/log.h>
|
|
|
|
|
|
|
|
#include <jni.h>
|
|
|
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <pthread.h>
|
|
|
|
|
2015-08-13 07:53:40 +03:00
|
|
|
#include "mozilla/jni/Utils.h"
|
2010-06-04 05:16:20 +04:00
|
|
|
#include "nsTArray.h"
|
|
|
|
#include "nsString.h"
|
2012-06-06 06:08:30 +04:00
|
|
|
#include "nsIFile.h"
|
2010-06-04 05:16:20 +04:00
|
|
|
#include "nsAppRunner.h"
|
2010-10-21 04:44:03 +04:00
|
|
|
#include "APKOpen.h"
|
|
|
|
#include "nsExceptionHandler.h"
|
2010-06-04 05:16:20 +04:00
|
|
|
|
|
|
|
#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, MOZ_APP_NAME, args)
|
|
|
|
|
2012-02-22 11:12:15 +04:00
|
|
|
extern "C" NS_EXPORT void
|
2016-12-13 00:10:17 +03:00
|
|
|
GeckoStart(JNIEnv* env, char** argv, int argc, const nsXREAppData* appData)
|
2010-06-04 05:16:20 +04:00
|
|
|
{
|
2015-08-13 07:53:40 +03:00
|
|
|
mozilla::jni::SetGeckoThreadEnv(env);
|
|
|
|
|
2010-10-21 04:44:03 +04:00
|
|
|
#ifdef MOZ_CRASHREPORTER
|
2010-10-29 23:22:28 +04:00
|
|
|
const struct mapping_info *info = getLibraryMapping();
|
2010-10-21 04:44:03 +04:00
|
|
|
while (info->name) {
|
2013-04-09 16:04:53 +04:00
|
|
|
CrashReporter::AddLibraryMapping(info->name, info->base,
|
2010-10-21 04:44:03 +04:00
|
|
|
info->len, info->offset);
|
|
|
|
info++;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2016-10-06 02:46:53 +03:00
|
|
|
if (!argv) {
|
2010-06-04 05:16:20 +04:00
|
|
|
LOG("Failed to get arguments for GeckoStart\n");
|
2012-02-22 11:12:15 +04:00
|
|
|
return;
|
2010-06-04 05:16:20 +04:00
|
|
|
}
|
|
|
|
|
2016-10-06 02:46:53 +03:00
|
|
|
int result = XRE_main(argc, argv, appData, 0);
|
2010-06-04 05:16:20 +04:00
|
|
|
|
|
|
|
if (result)
|
|
|
|
LOG("XRE_main returned %d", result);
|
|
|
|
}
|