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

Commit fdb3d315 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Add timeout to StrictMode flash." into oc-dev

parents f3471306 65ac7619
Loading
Loading
Loading
Loading
+11 −2
Original line number Original line Diff line number Diff line
@@ -158,6 +158,7 @@ import android.os.Trace;
import android.os.UserHandle;
import android.os.UserHandle;
import android.os.WorkSource;
import android.os.WorkSource;
import android.provider.Settings;
import android.provider.Settings;
import android.text.format.DateUtils;
import android.util.ArraySet;
import android.util.ArraySet;
import android.util.DisplayMetrics;
import android.util.DisplayMetrics;
import android.util.EventLog;
import android.util.EventLog;
@@ -3600,8 +3601,16 @@ public class WindowManagerService extends IWindowManager.Stub
    // only allow disables from pids which have count on, etc.
    // only allow disables from pids which have count on, etc.
    @Override
    @Override
    public void showStrictModeViolation(boolean on) {
    public void showStrictModeViolation(boolean on) {
        int pid = Binder.getCallingPid();
        final int pid = Binder.getCallingPid();
        mH.sendMessage(mH.obtainMessage(H.SHOW_STRICT_MODE_VIOLATION, on ? 1 : 0, pid));
        if (on) {
            // Show the visualization, and enqueue a second message to tear it
            // down if we don't hear back from the app.
            mH.sendMessage(mH.obtainMessage(H.SHOW_STRICT_MODE_VIOLATION, 1, pid));
            mH.sendMessageDelayed(mH.obtainMessage(H.SHOW_STRICT_MODE_VIOLATION, 0, pid),
                    DateUtils.SECOND_IN_MILLIS);
        } else {
            mH.sendMessage(mH.obtainMessage(H.SHOW_STRICT_MODE_VIOLATION, 0, pid));
        }
    }
    }


    private void showStrictModeViolation(int arg, int pid) {
    private void showStrictModeViolation(int arg, int pid) {