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
This commit is contained in:
Prashanth Swaminathan
2023-06-18 17:23:11 -07:00
parent f4c1b063bf
commit 873747c962

View File

@@ -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();