1 /* 2 * Copyright (C) 2020 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.google.android.setupcompat.portal; 18 19 import android.os.Bundle; 20 import com.google.android.setupcompat.portal.IPortalProgressCallback; 21 22 /** 23 * Interface of progress service, all servics needs to run during onboarding, and would like 24 * to consolidate notifications with SetupNotificationService, should implement this interface. 25 * So that SetupNotificationService can bind the progress service and run below 26 * SetupNotificationService. 27 */ 28 interface IPortalProgressService { 29 /** 30 * Called when the Portal notification is started. 31 */ onPortalSessionStart()32 oneway void onPortalSessionStart() = 0; 33 34 /** 35 * Provides a non-null callback after service connected. 36 */ 37 oneway void onSetCallback(IPortalProgressCallback callback) = 1; 38 39 /** 40 * Called when progress timed out. 41 */ onSuspend()42 oneway void onSuspend() = 2; 43 44 /** 45 * User clicks "User mobile data" on portal activity. 46 * All running progress should agree to use mobile data. 47 */ onAllowMobileData(boolean allowed)48 oneway void onAllowMobileData(boolean allowed) = 3; 49 50 /** 51 * Portal service calls to get remaining downloading size(MB) from progress service. 52 */ 53 @nullable onGetRemainingValues()54 Bundle onGetRemainingValues() = 4; 55 }