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