The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /** |
| 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 | |
| 17 | package android.app; |
| 18 | |
Dianne Hackborn | 067e5f6 | 2014-09-07 23:14:30 -0700 | [diff] [blame] | 19 | import android.graphics.Rect; |
Dianne Hackborn | 284ac93 | 2009-08-28 10:34:25 -0700 | [diff] [blame] | 20 | import android.os.Bundle; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 21 | import android.os.ParcelFileDescriptor; |
Dianne Hackborn | 8cc6a50 | 2009-08-05 21:29:42 -0700 | [diff] [blame] | 22 | import android.app.IWallpaperManagerCallback; |
Dianne Hackborn | eb03465 | 2009-09-07 00:49:58 -0700 | [diff] [blame] | 23 | import android.app.WallpaperInfo; |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 24 | import android.content.ComponentName; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 25 | |
| 26 | /** @hide */ |
Dianne Hackborn | 8cc6a50 | 2009-08-05 21:29:42 -0700 | [diff] [blame] | 27 | interface IWallpaperManager { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 28 | |
| 29 | /** |
Christopher Tate | be132e6 | 2016-02-10 12:59:49 -0800 | [diff] [blame] | 30 | * Set the wallpaper for the current user. |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 31 | * |
| 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 Tate | 1e1e2e0 | 2016-01-25 15:34:36 -0800 | [diff] [blame] | 38 | * |
| 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | */ |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 45 | ParcelFileDescriptor setWallpaper(String name, in String callingPackage, |
Christopher Tate | 1e1e2e0 | 2016-01-25 15:34:36 -0800 | [diff] [blame] | 46 | in Rect cropHint, out Bundle extras, int which, IWallpaperManagerCallback completion); |
| 47 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 48 | /** |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 49 | * Set the live wallpaper. This only affects the system wallpaper. |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 50 | */ |
Benjamin Franz | f3ece36 | 2015-02-11 10:51:10 +0000 | [diff] [blame] | 51 | void setWallpaperComponentChecked(in ComponentName name, in String callingPackage); |
| 52 | |
| 53 | /** |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 54 | * Set the live wallpaper. This only affects the system wallpaper. |
Benjamin Franz | f3ece36 | 2015-02-11 10:51:10 +0000 | [diff] [blame] | 55 | */ |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 56 | void setWallpaperComponent(in ComponentName name); |
Benjamin Franz | f3ece36 | 2015-02-11 10:51:10 +0000 | [diff] [blame] | 57 | |
Dianne Hackborn | 4c62fc0 | 2009-08-08 20:40:27 -0700 | [diff] [blame] | 58 | /** |
Christopher Tate | be132e6 | 2016-02-10 12:59:49 -0800 | [diff] [blame] | 59 | * Get the wallpaper for a given user. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | */ |
Christopher Tate | be132e6 | 2016-02-10 12:59:49 -0800 | [diff] [blame] | 61 | ParcelFileDescriptor getWallpaper(IWallpaperManagerCallback cb, int which, |
| 62 | out Bundle outParams, int userId); |
Christopher Tate | 1e1e2e0 | 2016-01-25 15:34:36 -0800 | [diff] [blame] | 63 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 64 | /** |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 65 | * 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 Hackborn | eb03465 | 2009-09-07 00:49:58 -0700 | [diff] [blame] | 68 | */ |
| 69 | WallpaperInfo getWallpaperInfo(); |
Christopher Tate | 1e1e2e0 | 2016-01-25 15:34:36 -0800 | [diff] [blame] | 70 | |
Dianne Hackborn | eb03465 | 2009-09-07 00:49:58 -0700 | [diff] [blame] | 71 | /** |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 72 | * Clear the system wallpaper. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 73 | */ |
Christopher Tate | be132e6 | 2016-02-10 12:59:49 -0800 | [diff] [blame] | 74 | void clearWallpaper(in String callingPackage, int which, int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | |
| 76 | /** |
Christopher Tate | ad3c259 | 2016-01-20 18:13:17 -0800 | [diff] [blame] | 77 | * Return whether the current system wallpaper has the given name. |
Dianne Hackborn | 5dc5a00 | 2012-09-15 19:33:48 -0700 | [diff] [blame] | 78 | */ |
| 79 | boolean hasNamedWallpaper(String name); |
| 80 | |
| 81 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 82 | * Sets the dimension hint for the wallpaper. These hints indicate the desired |
| 83 | * minimum width and height for the wallpaper. |
| 84 | */ |
Benjamin Franz | f3ece36 | 2015-02-11 10:51:10 +0000 | [diff] [blame] | 85 | void setDimensionHints(in int width, in int height, in String callingPackage); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | |
| 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 Yamasani | 30f8eb4 | 2013-11-06 14:54:50 -0800 | [diff] [blame] | 96 | |
| 97 | /** |
Dianne Hackborn | 067e5f6 | 2014-09-07 23:14:30 -0700 | [diff] [blame] | 98 | * Sets extra padding that we would like the wallpaper to have outside of the display. |
| 99 | */ |
Benjamin Franz | f3ece36 | 2015-02-11 10:51:10 +0000 | [diff] [blame] | 100 | void setDisplayPadding(in Rect padding, in String callingPackage); |
Dianne Hackborn | 067e5f6 | 2014-09-07 23:14:30 -0700 | [diff] [blame] | 101 | |
| 102 | /** |
Amith Yamasani | 30f8eb4 | 2013-11-06 14:54:50 -0800 | [diff] [blame] | 103 | * 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 Franz | f3ece36 | 2015-02-11 10:51:10 +0000 | [diff] [blame] | 111 | |
| 112 | /** |
| 113 | * Check whether wallpapers are supported for the calling user. |
| 114 | */ |
| 115 | boolean isWallpaperSupported(in String callingPackage); |
Oleksandr Peletskyi | f251981 | 2016-01-26 20:16:06 +0100 | [diff] [blame] | 116 | |
| 117 | /** |
| 118 | * Check whether setting of wallpapers are allowed for the calling user. |
| 119 | */ |
| 120 | boolean isWallpaperSettingAllowed(in String callingPackage); |
Christopher Tate | be132e6 | 2016-02-10 12:59:49 -0800 | [diff] [blame] | 121 | |
| 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 Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 127 | } |