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

Commit 0a183fd1 authored by Demon000's avatar Demon000 Committed by Luca Stefani
Browse files

ScreenshotHelper: ignore timeout when taking partial screenshots

User should have as much time to select the region as he wants.

Change-Id: Ib9b79d5127a59d3e2af278dbc8cd054221c37ca6
parent 6a738160
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
package com.android.internal.util;

import static android.view.WindowManager.TAKE_SCREENSHOT_SELECTED_REGION;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.ComponentName;
@@ -170,10 +172,12 @@ public class ScreenshotHelper {
                    Context.BIND_AUTO_CREATE | Context.BIND_FOREGROUND_SERVICE_WHILE_AWAKE,
                    UserHandle.CURRENT)) {
                mScreenshotConnection = conn;
                if (screenshotType != TAKE_SCREENSHOT_SELECTED_REGION) {
                    handler.postDelayed(mScreenshotTimeout, timeoutMs);
                }
            }
        }
    }

    /**
     * Notifies the screenshot service to show an error.