From d6bf7ffea788f5753be48a487a2a3b34951dfcb8 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Fri, 30 Mar 2018 13:08:26 +0900 Subject: [PATCH] Relax APF version check in ApfGenerator Instead of requiring an *exact* version, we now require a minimum version. This is necessary if we wish to upgrade the APF interpreter in vendor firmware independently of the framework code. Adding new opcodes without changing the semantics of the old ones is always possible and usually easy, so we can at least have a backwards-compatibility horizon wider than a single version. Change-Id: I4f1ed661afb2ede193188eb8086fbf2a8b45b33d Test: Change extracted from aosp/647079 and tested there --- services/net/java/android/net/apf/ApfGenerator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/net/java/android/net/apf/ApfGenerator.java b/services/net/java/android/net/apf/ApfGenerator.java index d41fbce1f2066..ca8f72760457d 100644 --- a/services/net/java/android/net/apf/ApfGenerator.java +++ b/services/net/java/android/net/apf/ApfGenerator.java @@ -367,7 +367,7 @@ public class ApfGenerator { */ public boolean setApfVersion(int version) { // This version number syncs up with APF_VERSION in hardware/google/apf/apf_interpreter.h - return version == 2; + return version >= 2; } private void addInstruction(Instruction instruction) {