• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2021 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.tv.settings.service;
18 
19 public final class ServiceUtil {
20     public static final int STATE_NETWORK_MAIN = 0;
21     public static final int STATE_WIFI_DETAILS = 1;
22 
23     public static final String INFO_INTENT = "intent";
24     public static final String INFO_NEXT_STATE = "next_state";
25     public static final String INFO_WIFI_SIGNAL_LEVEL = "wifi_signal_level";
26     public static final String INFO_COLLAPSE = "collapse";
27 
ServiceUtil()28     private ServiceUtil() {}
29 
getChecked(boolean checked)30     static byte getChecked(boolean checked) {
31         return checked ? (byte) 2 : (byte) 1;
32     }
33 
getVisible(boolean visible)34     static byte getVisible(boolean visible) {
35         return visible ? (byte) 2 : (byte) 1;
36     }
37 
isChecked(PreferenceParcelable pref)38     static boolean isChecked(PreferenceParcelable pref) {
39         return pref.getChecked() == 2 ? true : false;
40     }
41 
isVisible(PreferenceParcelable pref)42     static boolean isVisible(PreferenceParcelable pref) {
43         return pref.getVisible() == 2 ? true : false;
44     }
45 }
46