1 /* 2 * Copyright (C) 2016 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.incallui.incall.protocol; 18 19 /** Utility class for {@link InCallButtonIds}. */ 20 public class InCallButtonIdsExtension { 21 22 /** 23 * Converts the given {@link InCallButtonIds} to a human readable string. 24 * 25 * @param id the id to convert. 26 * @return the human readable string. 27 */ toString(@nCallButtonIds int id)28 public static String toString(@InCallButtonIds int id) { 29 if (id == InCallButtonIds.BUTTON_AUDIO) { 30 return "AUDIO"; 31 } else if (id == InCallButtonIds.BUTTON_MUTE) { 32 return "MUTE"; 33 } else if (id == InCallButtonIds.BUTTON_DIALPAD) { 34 return "DIALPAD"; 35 } else if (id == InCallButtonIds.BUTTON_HOLD) { 36 return "HOLD"; 37 } else if (id == InCallButtonIds.BUTTON_SWAP) { 38 return "SWAP"; 39 } else if (id == InCallButtonIds.BUTTON_UPGRADE_TO_VIDEO) { 40 return "UPGRADE_TO_VIDEO"; 41 } else if (id == InCallButtonIds.BUTTON_DOWNGRADE_TO_AUDIO) { 42 return "DOWNGRADE_TO_AUDIO"; 43 } else if (id == InCallButtonIds.BUTTON_SWITCH_CAMERA) { 44 return "SWITCH_CAMERA"; 45 } else if (id == InCallButtonIds.BUTTON_ADD_CALL) { 46 return "ADD_CALL"; 47 } else if (id == InCallButtonIds.BUTTON_MERGE) { 48 return "MERGE"; 49 } else if (id == InCallButtonIds.BUTTON_PAUSE_VIDEO) { 50 return "PAUSE_VIDEO"; 51 } else if (id == InCallButtonIds.BUTTON_MANAGE_VIDEO_CONFERENCE) { 52 return "MANAGE_VIDEO_CONFERENCE"; 53 } else if (id == InCallButtonIds.BUTTON_MANAGE_VOICE_CONFERENCE) { 54 return "MANAGE_VOICE_CONFERENCE"; 55 } else if (id == InCallButtonIds.BUTTON_SWITCH_TO_SECONDARY) { 56 return "SWITCH_TO_SECONDARY"; 57 } else if (id == InCallButtonIds.BUTTON_SWAP_SIM) { 58 return "SWAP_SIM"; 59 } else if (id == InCallButtonIds.BUTTON_UPGRADE_TO_RTT) { 60 return "UPGRADE_TO_RTT"; 61 } else { 62 return "INVALID_BUTTON: " + id; 63 } 64 } 65 } 66