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.imsserviceentitlement; 18 19 import android.app.Activity; 20 21 import androidx.annotation.StringRes; 22 23 /** The interface for UI manipulation. */ 24 public interface WfcActivationUi { 25 /** Custom result code, indicating activation flow failed. */ 26 int RESULT_FAILURE = Activity.RESULT_FIRST_USER; 27 28 /** Shows the basic SuW style UI and returns {@code true} on success */ showActivationUi( @tringRes int title, @StringRes int text, boolean isInProgress, @StringRes int primaryButtonText, int primaryButtonResult, @StringRes int secondaryButtonText)29 boolean showActivationUi( 30 @StringRes int title, 31 @StringRes int text, 32 boolean isInProgress, 33 @StringRes int primaryButtonText, 34 int primaryButtonResult, 35 @StringRes int secondaryButtonText); 36 37 /** Shows the full screen webview */ showWebview(String url, String postData)38 boolean showWebview(String url, String postData); 39 40 /** 41 * Finishes the activity with {@code result}: 42 * 43 * <ul> 44 * <li>{@link Activity#RESULT_OK}: WFC should be turned on. 45 * <li>{@link Activity#RESULT_CANCELED}: WFC should be OFF because user cancelled. 46 * <li>{@link #RESULT_FAILURE}: WFC can be OFF because of failure. 47 * </ul> 48 */ setResultAndFinish(int result)49 void setResultAndFinish(int result); 50 51 /** Returns the WfcActivationController associated with the UI. */ getController()52 WfcActivationController getController(); 53 } 54