1 /* 2 * Copyright (C) 2011 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 com.android.internal.telephony.cat; 18 19 import android.compat.annotation.UnsupportedAppUsage; 20 import android.os.Build; 21 22 /** 23 * Enumeration for representing the tag value of COMPREHENSION-TLV objects. If 24 * you want to get the actual value, call {@link #value() value} method. 25 * 26 * {@hide} 27 */ 28 public enum ComprehensionTlvTag { 29 @UnsupportedAppUsage 30 COMMAND_DETAILS(0x01), 31 @UnsupportedAppUsage 32 DEVICE_IDENTITIES(0x02), 33 @UnsupportedAppUsage 34 RESULT(0x03), 35 DURATION(0x04), 36 @UnsupportedAppUsage 37 ALPHA_ID(0x05), 38 @UnsupportedAppUsage 39 ADDRESS(0x06), 40 @UnsupportedAppUsage 41 USSD_STRING(0x0a), 42 @UnsupportedAppUsage 43 SMS_TPDU(0x0b), 44 @UnsupportedAppUsage 45 TEXT_STRING(0x0d), 46 TONE(0x0e), 47 ITEM(0x0f), 48 ITEM_ID(0x10), 49 RESPONSE_LENGTH(0x11), 50 FILE_LIST(0x12), 51 HELP_REQUEST(0x15), 52 DEFAULT_TEXT(0x17), 53 EVENT_LIST(0x19), 54 @UnsupportedAppUsage 55 ICON_ID(0x1e), 56 ITEM_ICON_ID_LIST(0x1f), 57 IMMEDIATE_RESPONSE(0x2b), 58 LANGUAGE(0x2d), 59 URL(0x31), 60 BROWSER_TERMINATION_CAUSE(0x34), 61 @UnsupportedAppUsage 62 TEXT_ATTRIBUTE(0x50); 63 64 private int mValue; 65 ComprehensionTlvTag(int value)66 ComprehensionTlvTag(int value) { 67 mValue = value; 68 } 69 70 /** 71 * Returns the actual value of this COMPREHENSION-TLV object. 72 * 73 * @return Actual tag value of this object 74 */ 75 @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) value()76 public int value() { 77 return mValue; 78 } 79 fromInt(int value)80 public static ComprehensionTlvTag fromInt(int value) { 81 for (ComprehensionTlvTag e : ComprehensionTlvTag.values()) { 82 if (e.mValue == value) { 83 return e; 84 } 85 } 86 return null; 87 } 88 } 89