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

Commit 873747c9 authored by Prashanth Swaminathan's avatar Prashanth Swaminathan
Browse files

Respect timeout multiplier in PermissionControllerManager

Adjust timeouts by hardware multiplier, to account for slower CPUs. This
resolves issues observed on certain hosts where completing default
permission grants at boot takes upwards of 160 seconds.

Bug: 281589918
Test: Ran RISCV64 target boot test on ARM servers (x4).
Change-Id: I47e416b13898c8b34e7bf3cf409d49d85fb559e6
parent f4c1b063
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@ import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.Binder;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.Process;
@@ -81,8 +82,8 @@ import java.util.function.IntConsumer;
public final class PermissionControllerManager {
    private static final String TAG = PermissionControllerManager.class.getSimpleName();

    private static final long REQUEST_TIMEOUT_MILLIS = 60000;
    private static final long UNBIND_TIMEOUT_MILLIS = 10000;
    private static final long REQUEST_TIMEOUT_MILLIS = 60000L * Build.HW_TIMEOUT_MULTIPLIER;
    private static final long UNBIND_TIMEOUT_MILLIS = 10000L * Build.HW_TIMEOUT_MULTIPLIER;
    private static final int CHUNK_SIZE = 4 * 1024;

    private static final Object sLock = new Object();