summaryrefslogtreecommitdiffstats
path: root/chromecast/android
diff options
context:
space:
mode:
authorgunsch <gunsch@chromium.org>2014-10-08 21:37:06 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-09 04:37:32 +0000
commit168c44ce90012516dcfa91ac80a6d0a200513531 (patch)
tree52b91d2ca80fdd9c7e2e858928a69505d456a4e9 /chromecast/android
parentfbba679b43d6df314321543541dfce39789593b4 (diff)
downloadchromium_src-168c44ce90012516dcfa91ac80a6d0a200513531.zip
chromium_src-168c44ce90012516dcfa91ac80a6d0a200513531.tar.gz
chromium_src-168c44ce90012516dcfa91ac80a6d0a200513531.tar.bz2
Chromecast: adds crash handling for Android build.
Cast for Android TV behavior includes the following: * On crash, immediately attempt to upload crash dump + logs from current process, then delete the dump file. * On startup, attempt to upload any crash dump files that are still left on the device. R=thestig@chromium.org,byungchul@chromium.org BUG=400876 Review URL: https://codereview.chromium.org/620673003 Cr-Commit-Position: refs/heads/master@{#298767}
Diffstat (limited to 'chromecast/android')
-rw-r--r--chromecast/android/DEPS4
-rw-r--r--chromecast/android/cast_jni_registrar.cc2
-rw-r--r--chromecast/android/chromecast_config_android.h4
-rw-r--r--chromecast/android/chromecast_config_android_stub.cc15
4 files changed, 24 insertions, 1 deletions
diff --git a/chromecast/android/DEPS b/chromecast/android/DEPS
index d441934..62e5a66 100644
--- a/chromecast/android/DEPS
+++ b/chromecast/android/DEPS
@@ -1,4 +1,6 @@
include_rules = [
- # Include for JNI.
+ # Includes for JNI.
+ "+chromecast/android",
+ "+chromecast/crash/android",
"+chromecast/shell/browser/android",
]
diff --git a/chromecast/android/cast_jni_registrar.cc b/chromecast/android/cast_jni_registrar.cc
index de919c6..81735d8 100644
--- a/chromecast/android/cast_jni_registrar.cc
+++ b/chromecast/android/cast_jni_registrar.cc
@@ -6,6 +6,7 @@
#include "base/android/jni_android.h"
#include "base/android/jni_registrar.h"
+#include "chromecast/crash/android/crash_handler.h"
#include "chromecast/shell/browser/android/cast_window_android.h"
#include "chromecast/shell/browser/android/cast_window_manager.h"
#include "chromecast/shell/browser/android/external_video_surface_container_impl.h"
@@ -20,6 +21,7 @@ static base::android::RegistrationMethod kMethods[] = {
{ "CastWindowManager", shell::RegisterCastWindowManager },
{ "ExternalVideoSurfaceContainer",
shell::RegisterExternalVideoSurfaceContainer },
+ { "CrashHandler", CrashHandler::RegisterCastCrashJni },
};
} // namespace
diff --git a/chromecast/android/chromecast_config_android.h b/chromecast/android/chromecast_config_android.h
index 627259e..e09d657 100644
--- a/chromecast/android/chromecast_config_android.h
+++ b/chromecast/android/chromecast_config_android.h
@@ -18,6 +18,10 @@ class ChromecastConfigAndroid {
public:
static ChromecastConfigAndroid* GetInstance();
+ // Returns whether or not the user has allowed sending usage stats and
+ // crash reports.
+ bool CanSendUsageStats();
+
// Registers a handler to be notified when SendUsageStats is changed.
void SetSendUsageStatsChangedCallback(
const base::Callback<void(bool)>& callback);
diff --git a/chromecast/android/chromecast_config_android_stub.cc b/chromecast/android/chromecast_config_android_stub.cc
new file mode 100644
index 0000000..dc8bdca
--- /dev/null
+++ b/chromecast/android/chromecast_config_android_stub.cc
@@ -0,0 +1,15 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chromecast/android/chromecast_config_android.h"
+
+namespace chromecast {
+namespace android {
+
+bool ChromecastConfigAndroid::CanSendUsageStats() {
+ return false;
+}
+
+} // namespace android
+} // namespace chromecast