blob: ed8f83fab1310acdfbd294e31a4778572f9b934b [file] [log] [blame]
Jon Miranda16ea1b12017-12-12 14:52:48 -08001/*
2 * Copyright (C) 2017 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 */
16package com.android.wallpaper.module;
17
Jon Miranda16ea1b12017-12-12 14:52:48 -080018import com.android.wallpaper.model.WallpaperInfo;
19import com.android.wallpaper.module.WallpaperPreferences.PresentationMode;
20
Sunny Goyal8600a3f2018-08-15 12:48:01 -070021import androidx.annotation.Nullable;
22
Jon Miranda16ea1b12017-12-12 14:52:48 -080023/**
24 * Interface for factories which construct {@link WallpaperInfo} objects representing the device's
25 * currently set wallpapers.
26 */
27public interface CurrentWallpaperInfoFactory {
28
29 /**
30 * Constructs WallpaperInfo object(s) to represent the current home wallpaper and optionally the
31 * current lock wallpaper if device is running Android N or later and lock wallpaper is explicitly
32 * set.
33 *
34 * @param forceRefresh Whether the factory should ignore cached copies of the WallpaperInfo(s) and
35 * presentation mode that represent the currently-set wallpaper.
36 */
37 void createCurrentWallpaperInfos(WallpaperInfoCallback callback, boolean forceRefresh);
38
39 /**
40 * Interface which clients may implement to receive current wallpaper {@link WallpaperInfo}
41 * objects constructed by the factory as well as the mode which describes their current
42 * presentation (i.e., daily rotation or static).
43 */
44 interface WallpaperInfoCallback {
45 void onWallpaperInfoCreated(WallpaperInfo homeWallpaper, @Nullable WallpaperInfo lockWallpaper,
46 @PresentationMode int presentationMode);
47 }
48}