1 /*
2  * Copyright (C) 2015 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 package common.src.android.voicesettings.common;
17 
18 import android.os.Bundle;
19 
20 public class Utils {
21     public enum TestcaseType {
22         ZEN_MODE_ON,
23         ZEN_MODE_OFF,
24         AIRPLANE_MODE_ON,
25         AIRPLANE_MODE_OFF,
26         BATTERYSAVER_MODE_ON,
27         BATTERYSAVER_MODE_OFF,
28     }
29     public static final String TESTCASE_TYPE = "Testcase_type";
30     public static final String BROADCAST_INTENT =
31             "android.intent.action.FROM_VOICESETTINGS_CTS_TEST_";
32     public static final int NUM_MINUTES_FOR_ZENMODE = 10;
33 
toBundleString(Bundle bundle)34     public static final String toBundleString(Bundle bundle) {
35         if (bundle == null) {
36             return "*** Bundle is null ****";
37         }
38         StringBuilder buf = new StringBuilder();
39         if (bundle != null) {
40             buf.append("extras: ");
41             for (String s : bundle.keySet()) {
42                 buf.append("(" + s + " = " + bundle.get(s) + "), ");
43             }
44         }
45         return buf.toString();
46     }
47 }
48