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