1 /* 2 * Copyright (C) 2006 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; 18 19 /** 20 * {@hide} 21 */ 22 public interface MmiCode 23 { 24 /** 25 * {@hide} 26 */ 27 public enum State { 28 PENDING, 29 CANCELLED, 30 COMPLETE, 31 FAILED 32 } 33 34 35 /** 36 * @return Current state of MmiCode request 37 */ getState()38 public State getState(); 39 40 /** 41 * @return Localized message for UI display, valid only in COMPLETE 42 * or FAILED states. null otherwise 43 */ 44 getMessage()45 public CharSequence getMessage(); 46 47 /** 48 * @return Phone associated with the MMI/USSD message 49 */ getPhone()50 public Phone getPhone(); 51 52 /** 53 * Cancels pending MMI request. 54 * State becomes CANCELLED unless already COMPLETE or FAILED 55 */ cancel()56 public void cancel(); 57 58 /** 59 * @return true if the network response is a REQUEST for more user input. 60 */ isUssdRequest()61 public boolean isUssdRequest(); 62 63 /** 64 * @return true if an outstanding request can be canceled. 65 */ isCancelable()66 public boolean isCancelable(); 67 68 /** 69 * @return true if the Service Code is PIN/PIN2/PUK/PUK2-related 70 */ isPinPukCommand()71 public boolean isPinPukCommand(); 72 73 /** 74 * Process a MMI code or short code...anything that isn't a dialing number 75 */ processCode()76 void processCode() throws CallStateException; 77 78 } 79