1 /* 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 */ 16 package com.android.wallpaper.module; 17 18 import android.content.res.Resources; 19 20 import androidx.annotation.Nullable; 21 22 import java.io.File; 23 24 /** 25 * Provides content from the partner customization on the device. 26 */ 27 public interface PartnerProvider { 28 29 /** 30 * Marker action used to discover partner. 31 */ 32 String ACTION_PARTNER_CUSTOMIZATION = 33 "com.android.launcher3.action.PARTNER_CUSTOMIZATION"; 34 35 /** 36 * The resource ID in the partner APK for its list of wallpapers. 37 */ 38 String WALLPAPER_RES_ID = "wallpapers"; 39 40 /** 41 * Directory for system wallpapers in legacy versions of the partner APK. 42 */ 43 String RES_LEGACY_SYSTEM_WALLPAPER_DIR = "system_wallpaper_directory"; 44 45 /** 46 * Boolean indicating the OEM does not want the picker to show the built-in Android system 47 * wallpaper because they've provided their own wallpapers instead. 48 * NOTE: The typo here "wallpapper" is intentional. The typo was made in legacy versions of the 49 * customization scheme so we can't fix it without breaking existing devices. 50 */ 51 String RES_DEFAULT_WALLPAPER_HIDDEN = "default_wallpapper_hidden"; 52 53 /** 54 * Returns the Resources object for the partner APK, or null if there is no partner APK on the 55 * device. 56 */ 57 @Nullable getResources()58 Resources getResources(); 59 60 /** 61 * Returns the directory containing wallpapers, or null if the directory is not found on the 62 * device. The directory is only present and populated in legacy versions of the partner 63 * customization scheme. 64 */ getLegacyWallpaperDirectory()65 File getLegacyWallpaperDirectory(); 66 67 /** 68 * Returns the package name of the partner APK, or null if there is no partner APK on the 69 * device. 70 */ getPackageName()71 @Nullable String getPackageName(); 72 73 /** 74 * Returns whether the OEM has specified that the built-in system default wallpaper should be 75 * hidden (because OEM has provided their own wallpaper). If no partner customization exists on 76 * the device, returns false. 77 */ shouldHideDefaultWallpaper()78 boolean shouldHideDefaultWallpaper(); 79 } 80