1 /* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.os.ext.testing; 17 18 import java.util.Set; 19 20 /** 21 * This class is intended to serve as a single place to define the current SDK extension 22 * versions to expect / allow in tests. 23 */ 24 public class CurrentVersion { 25 26 /** The latest train's version */ 27 public static final int CURRENT_TRAIN_VERSION = 5; 28 29 /** The version R shipped with (0) */ 30 public static final int R_BASE_VERSION = 0; 31 32 /** The version S shipped with (1) */ 33 public static final int S_BASE_VERSION = 1; 34 35 /** The version T shipped with (3) */ 36 public static final int T_BASE_VERSION = 3; 37 38 /** The current platform's version */ 39 public static final int CURRENT_BASE_VERSION = T_BASE_VERSION; 40 41 /** 42 * The current SDK Extension versions to expect / allow in CTS. 43 * 44 * Note: This construct exists because CTS is currently versioned together with the dessert 45 * versions, and not with the module itself. For example, Android R shipped with extension 46 * version 0, but it is allowed to preload new mainline trains with a higher extension version. 47 * When a new extension version is defined, this Set must therefore be extended to include the 48 * new version. 49 */ 50 public static final Set<Integer> ALLOWED_VERSIONS_CTS = 51 CURRENT_BASE_VERSION == CURRENT_TRAIN_VERSION ? Set.of(CURRENT_BASE_VERSION) 52 : Set.of(CURRENT_BASE_VERSION, 4, CURRENT_TRAIN_VERSION); 53 54 } 55