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

Commit 15348fc5 authored by Pawan Kumar Nimmagadda's avatar Pawan Kumar Nimmagadda Committed by Ricardo Cerqueira
Browse files

Telephony: Screen status support for USAT phase 2

This fix has change to support Idle screen status information.
broadcast CAT_IDLE_SCREEN_ACTION Intent when ICC has requested
to be notified of Idle screen status.

Add RECEIVER_FOREGROUND flag for idle screen broadcast intent.
Normal priority broadcast intents get queued up in application broadcast
queue, if BOOT_COMPLETE is not yet received by the application.
Adding FLAG_RECEIVER_FOREGROUND to the intent allows it to be delivered
to the application without waiting for BOOT_COMPLETE.
This is necessary to prevent some GCF tests from timing out due to
delayed delivery of CAT_IDLE_SCREEN_ACTION to Stk application.

CRs-Fixed: 432647 454835 635236

Change-Id: Ie42e5249940032fd1fb71b903586ac873174f3c6
Conflicts:
services/core/java/com/android/server/am/ActivityManagerService.java
parent 0578a9be
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006-2008 The Android Open Source Project
 *
 * Copyright (c) 2010-2014, The Linux Foundation. All rights reserved.
 * Not a Contribution.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
@@ -67,6 +68,7 @@ import com.android.internal.os.BatteryStatsImpl;
import com.android.internal.os.ProcessCpuTracker;
import com.android.internal.os.TransferPipe;
import com.android.internal.os.Zygote;
import com.android.internal.telephony.cat.AppInterface;
import com.android.internal.util.FastPrintWriter;
import com.android.internal.util.FastXmlSerializer;
import com.android.internal.util.MemInfoReader;
@@ -200,6 +202,7 @@ import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import dalvik.system.VMRuntime;
import android.view.WindowManagerPolicy;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -11295,6 +11298,8 @@ public final class ActivityManagerService extends ActivityManagerNative
        Slog.i(TAG, "System now ready");
        EventLog.writeEvent(EventLogTags.BOOT_PROGRESS_AMS_READY,
            SystemClock.uptimeMillis());
        IntentFilter bootFilter = new IntentFilter(AppInterface.CHECK_SCREEN_IDLE_ACTION);
        mContext.registerReceiver(new ScreenStatusReceiver(), bootFilter);
        synchronized(this) {
            // Make sure we have no pre-ready processes sitting around.
@@ -11414,6 +11419,26 @@ public final class ActivityManagerService extends ActivityManagerNative
        }
    }
    class ScreenStatusReceiver extends BroadcastReceiver {
        @Override
        public void onReceive(Context context, Intent intent) {
            if (intent == null || intent.getAction() == null) {
                return;
            }
            if (intent.getAction().equals(AppInterface.CHECK_SCREEN_IDLE_ACTION)) {
                Slog.i(TAG, "ICC has requested idle screen status");
                Intent idleScreenIntent = new Intent(AppInterface.CAT_IDLE_SCREEN_ACTION);
                idleScreenIntent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
                boolean isIdle = getFocusedStack().isHomeStack();
                idleScreenIntent.putExtra("SCREEN_IDLE", isIdle);
                Slog.i(TAG, "Broadcasting Home idle screen Intent"
                        + " SCREEN_IDLE is " + isIdle);
                mContext.sendBroadcast(idleScreenIntent);
            }
        }
    }
    private boolean makeAppCrashingLocked(ProcessRecord app,
            String shortMsg, String longMsg, String stackTrace) {
        app.crashing = true;