Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit dba17a28 authored by Chiou-Hao Hsu's avatar Chiou-Hao Hsu Committed by Ricardo Cerqueira
Browse files

QuickBoot: add execption restore mechanism

There may be some exceptions like battery unplugged When device
is put into QuickBoot mode. Then device will be in airplane
mode after next boot. We don't want such kind of things happen.
So start restore task to check if need restore before main
screen shows.

Change-Id: Ie92f688d135098972624b21dc69a771fcc39b49f
Conflicts:
services/core/java/com/android/server/wm/WindowManagerService.java
parent 19dac7d6
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -52,6 +52,7 @@ import android.app.IActivityManager;
import android.app.StatusBarManager;
import android.app.admin.DevicePolicyManager;
import android.animation.ValueAnimator;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
import android.content.Context;
@@ -5737,6 +5738,10 @@ public class WindowManagerService extends IWindowManager.Stub
        } catch (RemoteException e) {
        }

        // start QuickBoot to check if need restore from exception
        if (SystemProperties.getBoolean("persist.sys.quickboot_ongoing", false))
            checkQuickBootException();

        mPolicy.enableScreenAfterBoot();

        // Make sure the last requested orientation has been applied.
@@ -5755,6 +5760,15 @@ public class WindowManagerService extends IWindowManager.Stub
        return true;
    }

    private void checkQuickBootException() {
        Intent intent = new Intent("org.codeaurora.action.QUICKBOOT");
        intent.putExtra("mode", 2);
        try {
            mContext.startActivityAsUser(intent,UserHandle.CURRENT);
        } catch (ActivityNotFoundException e) {
        }
    }

    public void showBootMessage(final CharSequence msg, final boolean always) {
        boolean first = false;
        synchronized(mWindowMap) {