isReservedSupported=true when running as container

Test: Remove first_sdk_check from StorageHostTest#testVerify, log
Build.IS_CONTAINER inside isReservedSupported function, run on sailfish.
It shows that Build.IS_CONTAINER=false and the test still passes (i.e.,
isReservedSupported is correctly true).
Also checked that Build.IS_CONTAINER in isReservedSupported is true in
ARC++.
Bug: 111287848

Change-Id: I9af1f6cce5bab75ef941989bf279cf40c52e62b0
This commit is contained in:
Risan
2018-10-29 20:43:43 -06:00
parent e42fbe4606
commit 12adf3a985

View File

@@ -33,6 +33,7 @@ import android.content.pm.PackageStats;
import android.content.pm.UserInfo;
import android.net.Uri;
import android.os.Binder;
import android.os.Build;
import android.os.Environment;
import android.os.FileUtils;
import android.os.Handler;
@@ -169,7 +170,8 @@ public class StorageStatsService extends IStorageStatsManager.Stub {
enforcePermission(Binder.getCallingUid(), callingPackage);
if (volumeUuid == StorageManager.UUID_PRIVATE_INTERNAL) {
return SystemProperties.getBoolean(StorageManager.PROP_HAS_RESERVED, false);
return SystemProperties.getBoolean(StorageManager.PROP_HAS_RESERVED, false)
|| Build.IS_CONTAINER;
} else {
return false;
}