Add feature versions for devices and apps.
We're starting to see more instances of device features that will increment separately from the SDK API level, such as camera HAL, GPU capabilities, Bluetooth, and other hardware standards. This change adds the ability for device features to specify a version, which is defined to be backwards compatible. That is, apps requesting an older version of a feature must continue working on devices with a newer version of that same feature. When a version is undefined, we assume the default version "0". Bug: 27162500 Change-Id: If890bf3f3dbb715e8feb80e7059a0d65618482ea
This commit is contained in:
@@ -414,7 +414,7 @@ public final class NfcAdapter {
|
||||
return false;
|
||||
}
|
||||
try {
|
||||
return pm.hasSystemFeature(PackageManager.FEATURE_NFC);
|
||||
return pm.hasSystemFeature(PackageManager.FEATURE_NFC, 0);
|
||||
} catch (RemoteException e) {
|
||||
Log.e(TAG, "Package manager query failed, assuming no NFC feature", e);
|
||||
return false;
|
||||
|
||||
@@ -156,7 +156,7 @@ public final class CardEmulation {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
try {
|
||||
if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION)) {
|
||||
if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION, 0)) {
|
||||
Log.e(TAG, "This device does not support card emulation");
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public final class NfcFCardEmulation {
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
try {
|
||||
if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION_NFCF)) {
|
||||
if (!pm.hasSystemFeature(PackageManager.FEATURE_NFC_HOST_CARD_EMULATION_NFCF, 0)) {
|
||||
Log.e(TAG, "This device does not support NFC-F card emulation");
|
||||
throw new UnsupportedOperationException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user