Always use the server based provider if HAL isn't installed

If the device doesn't have the reboot escorw HAL, default the provider
to server-based. It helps OEM testing before our P/H flag rollout;
because most OEM devices don't install the HAL.

Test: unittests
Change-Id: Ia43ab0abb769bbf8e11e61841f4a647ae2acc6be
This commit is contained in:
Tianjie
2021-04-28 15:24:47 -07:00
parent 1cfb57c023
commit adc5a1d764

View File

@@ -31,6 +31,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.UserIdInt;
import android.content.Context;
import android.content.pm.PackageManager;
import android.content.pm.UserInfo;
import android.os.Handler;
import android.os.SystemClock;
@@ -224,6 +225,12 @@ class RebootEscrowManager {
}
public boolean serverBasedResumeOnReboot() {
// Always use the server based RoR if the HAL isn't installed on device.
if (!mContext.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_REBOOT_ESCROW)) {
return true;
}
return DeviceConfig.getBoolean(DeviceConfig.NAMESPACE_OTA,
"server_based_ror_enabled", false);
}