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