Home | History | Annotate | Download | only in telecom
      1 /*
      2  * Copyright (C) 2017 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.server.telecom;
     18 
     19 /**
     20  * Defines handover state constants for calls undergoing handover.
     21  */
     22 public class HandoverState {
     23     private HandoverState() {
     24         // Can't instantiate.
     25     }
     26 
     27     public static final int HANDOVER_NONE = 1;
     28     public static final int HANDOVER_TO_STARTED = 2;
     29     public static final int HANDOVER_FROM_STARTED = 3;
     30     public static final int HANDOVER_ACCEPTED = 4;
     31     public static final int HANDOVER_COMPLETE = 5;
     32     public static final int HANDOVER_FAILED = 6;
     33 
     34     private static final String HANDOVER_NONE_STR = "NONE";
     35     private static final String HANDOVER_TO_STARTED_STR = "HANDOVER_TO_STARTED";
     36     private static final String HANDOVER_FROM_STARTED_STR = "HANDOVER_FROM_STARTED";
     37     private static final String HANDOVER_ACCEPTED_STR = "HANDOVER_ACCEPTED";
     38     private static final String HANDOVER_COMPLETE_STR = "HANDOVER_COMPLETE";
     39     private static final String HANDOVER_FAILED_STR = "HANDOVER_FAILED";
     40 
     41     public static String stateToString(int state) {
     42         switch (state) {
     43             case HANDOVER_NONE:
     44                 return HANDOVER_NONE_STR;
     45             case HANDOVER_TO_STARTED:
     46                 return HANDOVER_TO_STARTED_STR;
     47             case HANDOVER_FROM_STARTED:
     48                 return HANDOVER_FROM_STARTED_STR;
     49             case HANDOVER_ACCEPTED:
     50                 return HANDOVER_ACCEPTED_STR;
     51             case HANDOVER_COMPLETE:
     52                 return HANDOVER_COMPLETE_STR;
     53             case HANDOVER_FAILED:
     54                 return HANDOVER_FAILED_STR;
     55         }
     56         return "";
     57     }
     58 }
     59