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

Commit 8e0f421d authored by Pawan Kumar Nimmagadda's avatar Pawan Kumar Nimmagadda Committed by Linux Build Service Account
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

Change-Id: Iff8565d0eef8e5de266353b8ba6c64207ab918ed
CRs-Fixed: 432647 454835
(cherry picked from commit f4f04707b78e3bf75ec58b39766e71014c87346b)
(cherry picked from commit 5a1547e4b160c0621916b566e106773032d5f0b0)
(cherry picked from commit 1686f8276447801e0cd87ae0bbc2b71854d0f93d)
parent d0358828
Loading
Loading
Loading
Loading
+28 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2006-2008 The Android Open Source Project
 * Copyright (c) 2010-2013, 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.
@@ -38,6 +40,7 @@ import com.android.internal.os.BackgroundThread;
import com.android.internal.os.BatteryStatsImpl;
import com.android.internal.os.ProcessCpuTracker;
import com.android.internal.os.TransferPipe;
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;
@@ -171,6 +174,8 @@ import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.WindowManager;
import android.view.WindowManagerPolicy;
import android.content.BroadcastReceiver;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
@@ -9165,6 +9170,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.
@@ -9274,6 +9281,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);
                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;