Merge "API feedback: getVersion instead of isV2." into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
02492968c6
@@ -3601,7 +3601,7 @@ public abstract class PackageManager {
|
||||
* 1 - IncFs v1, core features, no PerUid support. Optional in R.
|
||||
* 2 - IncFs v2, PerUid support, fs-verity support. Required in S.
|
||||
*
|
||||
* @see IncrementalManager#isFeatureEnabled and IncrementalManager#isV2()
|
||||
* @see IncrementalManager#getVersion()
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
|
||||
@@ -241,10 +241,12 @@ public final class IncrementalManager {
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if device supports V2 calls (e.g. PerUid).
|
||||
* 0 - IncFs is disabled.
|
||||
* 1 - IncFs v1, core features, no PerUid support. Optional in R.
|
||||
* 2 - IncFs v2, PerUid support, fs-verity support. Required in S.
|
||||
*/
|
||||
public static boolean isV2Available() {
|
||||
return nativeIsV2Available();
|
||||
public static int getVersion() {
|
||||
return nativeIsEnabled() ? nativeIsV2Available() ? 2 : 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1234,10 +1234,10 @@ public class SystemConfig {
|
||||
addFeature(PackageManager.FEATURE_RAM_NORMAL, 0);
|
||||
}
|
||||
|
||||
if (IncrementalManager.isFeatureEnabled()) {
|
||||
final int incrementalVersion = IncrementalManager.getVersion();
|
||||
if (incrementalVersion > 0) {
|
||||
addFeature(PackageManager.FEATURE_INCREMENTAL_DELIVERY, 0);
|
||||
addFeature(PackageManager.FEATURE_INCREMENTAL_DELIVERY_VERSION,
|
||||
IncrementalManager.isV2Available() ? 2 : 1);
|
||||
addFeature(PackageManager.FEATURE_INCREMENTAL_DELIVERY_VERSION, incrementalVersion);
|
||||
}
|
||||
|
||||
if (PackageManager.APP_ENUMERATION_ENABLED_BY_DEFAULT) {
|
||||
|
||||
Reference in New Issue
Block a user