1 /* 2 * Copyright (C) 2020 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 17 package android.car.user; 18 19 import static com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport.BOILERPLATE_CODE; 20 21 22 import com.android.car.internal.ExcludeFromCodeCoverageGeneratedReport; 23 24 /** 25 * Defines status for common result objects. 26 */ 27 final class CommonResults { 28 29 /** 30 * Operation was is successful for both HAL and Android. 31 */ 32 public static final int STATUS_SUCCESSFUL = 1; 33 34 /** 35 * Operation failed on Android. 36 */ 37 public static final int STATUS_ANDROID_FAILURE = 2; 38 39 /** 40 * Operation failed on HAL. 41 */ 42 public static final int STATUS_HAL_FAILURE = 3; 43 44 /** 45 * Operation failed due to an error communication with HAL (like timeout). 46 */ 47 public static final int STATUS_HAL_INTERNAL_FAILURE = 4; 48 49 /** 50 * Operation failed due to invalid request. 51 */ 52 public static final int STATUS_INVALID_REQUEST = 5; 53 54 /** 55 * Operation failed because of driving safety UX restrictions. 56 */ 57 public static final int STATUS_UX_RESTRICTION_FAILURE = 6; 58 59 /** 60 * Operation failed because of old platform that does not support the specified action. 61 */ 62 public static final int STATUS_UNSUPPORTED_PLATFORM_FAILURE = 7; 63 64 /** 65 * Reference for common status - anything higher than this can be used for custom status 66 */ 67 static final int LAST_COMMON_STATUS = 100; 68 69 @ExcludeFromCodeCoverageGeneratedReport(reason = BOILERPLATE_CODE) CommonResults()70 private CommonResults() { 71 throw new UnsupportedOperationException(); 72 } 73 } 74