Home | History | Annotate | Download | only in overlay
      1 /*
      2  * Copyright (C) 2016 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.settings.overlay;
     18 
     19 import android.accounts.Account;
     20 import android.annotation.IntDef;
     21 import android.annotation.NonNull;
     22 import android.annotation.StringRes;
     23 import android.app.Activity;
     24 import android.app.FragmentManager;
     25 import android.content.Context;
     26 import android.content.Intent;
     27 import android.os.Bundle;
     28 
     29 import com.android.settings.support.SupportPhone;
     30 
     31 import java.lang.annotation.Retention;
     32 import java.lang.annotation.RetentionPolicy;
     33 import java.util.List;
     34 
     35 /**
     36  * Feature provider for support tab.
     37  */
     38 public interface SupportFeatureProvider {
     39 
     40     @IntDef({SupportType.EMAIL, SupportType.PHONE, SupportType.CHAT})
     41     @Retention(RetentionPolicy.SOURCE)
     42     @interface SupportType {
     43         int EMAIL = 1;
     44         int PHONE = 2;
     45         int CHAT = 3;
     46     }
     47 
     48     /**
     49      * Refreshes all operation rules.
     50      */
     51     void refreshOperationRules();
     52 
     53     /**
     54      * Returns the current country code if it has a operation config, otherwise returns null.
     55      */
     56     String getCurrentCountryCodeIfHasConfig(@SupportType int type);
     57 
     58     /**
     59      * Returns a support phone for specified country.
     60      */
     61     SupportPhone getSupportPhones(String countryCode, boolean isTollfree);
     62 
     63     /**
     64      * Returns array of {@link Account} that's eligible for support options.
     65      */
     66     @NonNull
     67     Account[] getSupportEligibleAccounts(Context context);
     68 
     69     /**
     70      * Starts support v2, invokes the support home page. Will no-op if support v2 is not enabled.
     71      *
     72      * @param activity Calling activity.
     73      */
     74     void startSupportV2(Activity activity);
     75 
     76     /**
     77      * Returns a url with information to introduce user to new device.
     78      */
     79     String getNewDeviceIntroUrl(Context context);
     80 }
     81