1 /* 2 * Copyright (C) 2023 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 package com.android.intentresolver.emptystate; 17 18 import android.annotation.Nullable; 19 20 import com.android.intentresolver.ResolverListAdapter; 21 22 /** 23 * Returns an empty state to show for the current profile page (tab) if necessary. 24 * This could be used e.g. to show a blocker on a tab if device management policy doesn't 25 * allow to use it or there are no apps available. 26 */ 27 public interface EmptyStateProvider { 28 /** 29 * When a non-null empty state is returned the corresponding profile page will show 30 * this empty state 31 * @param resolverListAdapter the current adapter 32 */ 33 @Nullable getEmptyState(ResolverListAdapter resolverListAdapter)34 default EmptyState getEmptyState(ResolverListAdapter resolverListAdapter) { 35 return null; 36 } 37 } 38