2 * Copyright (C) 2016 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.settings.overlay;
19 import android.accounts.Account;
20 import android.annotation.IntDef;
21 import android.annotation.StringRes;
22 import android.app.Activity;
23 import android.content.Context;
24 import android.content.Intent;
26 import com.android.settings.support.SupportPhone;
28 import java.lang.annotation.Retention;
29 import java.lang.annotation.RetentionPolicy;
30 import java.util.List;
33 * Feature provider for support tab.
35 public interface SupportFeatureProvider {
37 @IntDef({SupportType.EMAIL, SupportType.PHONE, SupportType.CHAT})
38 @Retention(RetentionPolicy.SOURCE)
39 @interface SupportType {
46 * Returns a intent that will open help & feedback.
48 Intent getHelpIntent(Context context);
51 * Whether or not a support type is enabled.
53 boolean isSupportTypeEnabled(Context context, @SupportType int type);
56 * Refreshes all operation rules.
58 void refreshOperationRules();
61 * Whether or not a support type is in operation 24/7. If country is null, use
64 boolean isAlwaysOperating(@SupportType int type, String countryCode);
67 * Whether or not a support type is operating now.
69 boolean isOperatingNow(@SupportType int type);
72 * Returns the current country code if it has a operation config, otherwise returns null.
74 String getCurrentCountryCodeIfHasConfig(@SupportType int type);
77 * Returns localized string for operation hours in specified country. If country is null, use
78 * current country to figure out operation hours.
80 CharSequence getOperationHours(Context context, @SupportType int type, String countryCode,
84 * Returns a localized string indicating estimated wait time for a support time.
86 String getEstimatedWaitTime(Context context, @SupportType int type);
89 * Returns a list of country codes that have phone support.
91 List<String> getPhoneSupportCountryCodes();
94 * Returns a list of countries that have phone support.
96 List<String> getPhoneSupportCountries();
99 * Returns a support phone for specified country.
101 SupportPhone getSupportPhones(String countryCode, boolean isTollfree);
104 * Whether or not a disclaimer dialog should be displayed.
106 boolean shouldShowDisclaimerDialog(Context context);
109 * Sets whether or not a disclaimer dialog should be displayed.
111 void setShouldShowDisclaimerDialog(Context context, boolean shouldShow);
114 * Returns an {@link Account} that's eligible for support options.
116 Account getSupportEligibleAccount(Context context);
119 * Starts support activity of specified type
121 * @param activity Calling activity
122 * @param account A account returned by {@link #getSupportEligibleAccount}
123 * @param type The type of support account needs.
125 void startSupport(Activity activity, Account account, @SupportType int type);
128 * Returns an {@link Intent} that opens help and allow user get help on sign in.
130 Intent getSignInHelpIntent(Context context);
133 * Returns an intent that will start the add account UI.
135 Intent getAccountLoginIntent();
138 * Returns an intent that will launch the tips and tricks UI.
140 Intent getTipsAndTricksIntent(Context context);
143 * Returns the string for the disclaimer in the Support dialog
146 int getDisclaimerStringResId();