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.managedprovisioning.preprovisioning; 18 19 import static java.util.Objects.requireNonNull; 20 21 import android.app.Activity; 22 23 import com.android.managedprovisioning.common.ThemeHelper; 24 import com.android.managedprovisioning.common.Utils; 25 import com.android.managedprovisioning.preprovisioning.consent.ConsentUiHelper; 26 import com.android.managedprovisioning.preprovisioning.consent.ConsentUiHelperCallback; 27 import com.android.managedprovisioning.preprovisioning.consent.ConsentUiHelperFactory; 28 29 /** 30 * A {@link PreProvisioningActivityBridge} implementation meant for the base {@code 31 * ManagedProvisioning}. 32 */ 33 final class PreProvisioningActivityBridgeImpl implements PreProvisioningActivityBridge { 34 private final ConsentUiHelper mConsentUiHelper; 35 PreProvisioningActivityBridgeImpl( Activity activity, Utils utils, ConsentUiHelperCallback callback, PreProvisioningActivityBridgeCallbacks bridgeCallbacks, ThemeHelper themeHelper, String setupMetricScreenName)36 PreProvisioningActivityBridgeImpl( 37 Activity activity, 38 Utils utils, 39 ConsentUiHelperCallback callback, 40 PreProvisioningActivityBridgeCallbacks bridgeCallbacks, 41 ThemeHelper themeHelper, 42 String setupMetricScreenName) { 43 mConsentUiHelper = ConsentUiHelperFactory.getInstance( 44 requireNonNull(activity), 45 requireNonNull(callback), 46 requireNonNull(utils), 47 requireNonNull(bridgeCallbacks), 48 requireNonNull(themeHelper), 49 setupMetricScreenName); 50 } 51 52 @Override initiateUi(PreProvisioningActivityController.UiParams uiParams)53 public void initiateUi(PreProvisioningActivityController.UiParams uiParams) { 54 mConsentUiHelper.initiateUi(uiParams); 55 } 56 57 @Override onStart()58 public void onStart() {} 59 60 @Override onStop()61 public void onStop() {} 62 } 63