2 * Copyright (c) 2008, The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 import android.graphics.Rect;
20 import android.os.Bundle;
21 import android.os.ParcelFileDescriptor;
22 import android.app.IWallpaperManagerCallback;
23 import android.app.WallpaperInfo;
24 import android.content.ComponentName;
27 interface IWallpaperManager {
30 * Set the wallpaper for the current user.
32 * If 'extras' is non-null, on successful return it will contain:
33 * EXTRA_SET_WALLPAPER_ID : integer ID that the new wallpaper will have
35 * 'which' is some combination of:
39 * A 'null' cropHint rectangle is explicitly permitted as a sentinel for "whatever
40 * the source image's bounding rect is."
42 * The completion callback's "onWallpaperChanged()" method is invoked when the
43 * new wallpaper content is ready to display.
45 ParcelFileDescriptor setWallpaper(String name, in String callingPackage,
46 in Rect cropHint, boolean allowBackup, out Bundle extras, int which,
47 IWallpaperManagerCallback completion, int userId);
50 * Set the live wallpaper. This only affects the system wallpaper.
52 void setWallpaperComponentChecked(in ComponentName name, in String callingPackage, int userId);
55 * Set the live wallpaper. This only affects the system wallpaper.
57 void setWallpaperComponent(in ComponentName name);
60 * Get the wallpaper for a given user.
62 ParcelFileDescriptor getWallpaper(IWallpaperManagerCallback cb, int which,
63 out Bundle outParams, int userId);
66 * Retrieve the given user's current wallpaper ID of the given kind.
68 int getWallpaperIdForUser(int which, int userId);
71 * If the current system wallpaper is a live wallpaper component, return the
72 * information about that wallpaper. Otherwise, if it is a static image,
75 WallpaperInfo getWallpaperInfo(int userId);
78 * Clear the system wallpaper.
80 void clearWallpaper(in String callingPackage, int which, int userId);
83 * Return whether the current system wallpaper has the given name.
85 boolean hasNamedWallpaper(String name);
88 * Sets the dimension hint for the wallpaper. These hints indicate the desired
89 * minimum width and height for the wallpaper.
91 void setDimensionHints(in int width, in int height, in String callingPackage);
94 * Returns the desired minimum width for the wallpaper.
99 * Returns the desired minimum height for the wallpaper.
104 * Sets extra padding that we would like the wallpaper to have outside of the display.
106 void setDisplayPadding(in Rect padding, in String callingPackage);
109 * Returns the name of the wallpaper. Private API.
114 * Informs the service that wallpaper settings have been restored. Private API.
116 void settingsRestored();
119 * Check whether wallpapers are supported for the calling user.
121 boolean isWallpaperSupported(in String callingPackage);
124 * Check whether setting of wallpapers are allowed for the calling user.
126 boolean isSetWallpaperAllowed(in String callingPackage);
129 * Backup: is the current system wallpaper image eligible for off-device backup?
131 boolean isWallpaperBackupEligible(int which, int userId);
134 * Keyguard: register a callback for being notified that lock-state relevant
135 * wallpaper content has changed.
137 boolean setLockWallpaperCallback(IWallpaperManagerCallback cb);