blob: 1143c6aec7a6bfa6f24853c7701adfc65d2ada30 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/**
2 * Copyright (c) 2008, 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
17package android.app;
18
Dianne Hackborn067e5f62014-09-07 23:14:30 -070019import android.graphics.Rect;
Dianne Hackborn284ac932009-08-28 10:34:25 -070020import android.os.Bundle;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080021import android.os.ParcelFileDescriptor;
Dianne Hackborn8cc6a502009-08-05 21:29:42 -070022import android.app.IWallpaperManagerCallback;
Dianne Hackborneb034652009-09-07 00:49:58 -070023import android.app.WallpaperInfo;
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070024import android.content.ComponentName;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025
26/** @hide */
Dianne Hackborn8cc6a502009-08-05 21:29:42 -070027interface IWallpaperManager {
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080028
29 /**
Christopher Tatebe132e62016-02-10 12:59:49 -080030 * Set the wallpaper for the current user.
Christopher Tatead3c2592016-01-20 18:13:17 -080031 *
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
34 *
35 * 'which' is some combination of:
36 * FLAG_SET_SYSTEM
37 * FLAG_SET_LOCK
Christopher Tate1e1e2e02016-01-25 15:34:36 -080038 *
39 * A 'null' cropHint rectangle is explicitly permitted as a sentinel for "whatever
40 * the source image's bounding rect is."
41 *
42 * The completion callback's "onWallpaperChanged()" method is invoked when the
43 * new wallpaper content is ready to display.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080044 */
Christopher Tatead3c2592016-01-20 18:13:17 -080045 ParcelFileDescriptor setWallpaper(String name, in String callingPackage,
Christopher Tate1e1e2e02016-01-25 15:34:36 -080046 in Rect cropHint, out Bundle extras, int which, IWallpaperManagerCallback completion);
47
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080048 /**
Christopher Tatead3c2592016-01-20 18:13:17 -080049 * Set the live wallpaper. This only affects the system wallpaper.
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070050 */
Benjamin Franzf3ece362015-02-11 10:51:10 +000051 void setWallpaperComponentChecked(in ComponentName name, in String callingPackage);
52
53 /**
Christopher Tatead3c2592016-01-20 18:13:17 -080054 * Set the live wallpaper. This only affects the system wallpaper.
Benjamin Franzf3ece362015-02-11 10:51:10 +000055 */
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070056 void setWallpaperComponent(in ComponentName name);
Benjamin Franzf3ece362015-02-11 10:51:10 +000057
Dianne Hackborn4c62fc02009-08-08 20:40:27 -070058 /**
Christopher Tatebe132e62016-02-10 12:59:49 -080059 * Get the wallpaper for a given user.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080060 */
Christopher Tatebe132e62016-02-10 12:59:49 -080061 ParcelFileDescriptor getWallpaper(IWallpaperManagerCallback cb, int which,
62 out Bundle outParams, int userId);
Christopher Tate1e1e2e02016-01-25 15:34:36 -080063
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080064 /**
Christopher Tatead3c2592016-01-20 18:13:17 -080065 * If the current system wallpaper is a live wallpaper component, return the
66 * information about that wallpaper. Otherwise, if it is a static image,
67 * simply return null.
Dianne Hackborneb034652009-09-07 00:49:58 -070068 */
69 WallpaperInfo getWallpaperInfo();
Christopher Tate1e1e2e02016-01-25 15:34:36 -080070
Dianne Hackborneb034652009-09-07 00:49:58 -070071 /**
Christopher Tatead3c2592016-01-20 18:13:17 -080072 * Clear the system wallpaper.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080073 */
Christopher Tatebe132e62016-02-10 12:59:49 -080074 void clearWallpaper(in String callingPackage, int which, int userId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080075
76 /**
Christopher Tatead3c2592016-01-20 18:13:17 -080077 * Return whether the current system wallpaper has the given name.
Dianne Hackborn5dc5a002012-09-15 19:33:48 -070078 */
79 boolean hasNamedWallpaper(String name);
80
81 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080082 * Sets the dimension hint for the wallpaper. These hints indicate the desired
83 * minimum width and height for the wallpaper.
84 */
Benjamin Franzf3ece362015-02-11 10:51:10 +000085 void setDimensionHints(in int width, in int height, in String callingPackage);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080086
87 /**
88 * Returns the desired minimum width for the wallpaper.
89 */
90 int getWidthHint();
91
92 /**
93 * Returns the desired minimum height for the wallpaper.
94 */
95 int getHeightHint();
Amith Yamasani30f8eb42013-11-06 14:54:50 -080096
97 /**
Dianne Hackborn067e5f62014-09-07 23:14:30 -070098 * Sets extra padding that we would like the wallpaper to have outside of the display.
99 */
Benjamin Franzf3ece362015-02-11 10:51:10 +0000100 void setDisplayPadding(in Rect padding, in String callingPackage);
Dianne Hackborn067e5f62014-09-07 23:14:30 -0700101
102 /**
Amith Yamasani30f8eb42013-11-06 14:54:50 -0800103 * Returns the name of the wallpaper. Private API.
104 */
105 String getName();
106
107 /**
108 * Informs the service that wallpaper settings have been restored. Private API.
109 */
110 void settingsRestored();
Benjamin Franzf3ece362015-02-11 10:51:10 +0000111
112 /**
113 * Check whether wallpapers are supported for the calling user.
114 */
115 boolean isWallpaperSupported(in String callingPackage);
Oleksandr Peletskyif2519812016-01-26 20:16:06 +0100116
117 /**
118 * Check whether setting of wallpapers are allowed for the calling user.
119 */
120 boolean isWallpaperSettingAllowed(in String callingPackage);
Christopher Tatebe132e62016-02-10 12:59:49 -0800121
122 /*
123 * Keyguard: register a callback for being notified that lock-state relevant
124 * wallpaper content has changed.
125 */
126 boolean setLockWallpaperCallback(IWallpaperManagerCallback cb);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800127}