From 399b98c7516992ad1c718c0932e1608e609b8b64 Mon Sep 17 00:00:00 2001 From: dfalcantara Date: Wed, 5 Aug 2015 18:32:01 -0700 Subject: [PATCH] Restart Chrome by killing it with an out-of-process Activity. As of KK, Android's AlarmManager has a minimum of 5 seconds before an alarm may be fired, which means that restarting Chrome via an alarm takes an inordinate amount of time. Switch to using an Activity that runs in a separate process and: 1) Kills the main Chrome process 2) Fires an Intent to restart the main Chrome Activity 3) Immediately kills its own process. BUG=519519 Review URL: https://codereview.chromium.org/1276703002 Cr-Commit-Position: refs/heads/master@{#342042} --- chrome/android/java/AndroidManifest.xml | 9 +++++ .../chrome/browser/BrowserRestartActivity.java | 42 ++++++++++++++++++++++ .../chrome/browser/ChromeLifetimeController.java | 37 ++++++++----------- 3 files changed, 66 insertions(+), 22 deletions(-) create mode 100644 chrome/android/java/src/org/chromium/chrome/browser/BrowserRestartActivity.java diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml index 41e60c9d6fc8..27a657bd4ee9 100644 --- a/chrome/android/java/AndroidManifest.xml +++ b/chrome/android/java/AndroidManifest.xml @@ -389,6 +389,15 @@ by a child template that "extends" this file. android:hardwareAccelerated="false"> + + + +