Merge "Add wallpaper controlling system apis." into lmp-mr1-modular-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
7acd679cb3
@@ -5327,6 +5327,7 @@ package android.app {
|
|||||||
|
|
||||||
public class WallpaperManager {
|
public class WallpaperManager {
|
||||||
method public void clear() throws java.io.IOException;
|
method public void clear() throws java.io.IOException;
|
||||||
|
method public void clearWallpaper();
|
||||||
method public void clearWallpaperOffsets(android.os.IBinder);
|
method public void clearWallpaperOffsets(android.os.IBinder);
|
||||||
method public void forgetLoadedWallpaper();
|
method public void forgetLoadedWallpaper();
|
||||||
method public android.graphics.drawable.Drawable getBuiltInDrawable();
|
method public android.graphics.drawable.Drawable getBuiltInDrawable();
|
||||||
@@ -5347,6 +5348,7 @@ package android.app {
|
|||||||
method public void setDisplayPadding(android.graphics.Rect);
|
method public void setDisplayPadding(android.graphics.Rect);
|
||||||
method public void setResource(int) throws java.io.IOException;
|
method public void setResource(int) throws java.io.IOException;
|
||||||
method public void setStream(java.io.InputStream) throws java.io.IOException;
|
method public void setStream(java.io.InputStream) throws java.io.IOException;
|
||||||
|
method public boolean setWallpaperComponent(android.content.ComponentName);
|
||||||
method public void setWallpaperOffsetSteps(float, float);
|
method public void setWallpaperOffsetSteps(float, float);
|
||||||
method public void setWallpaperOffsets(android.os.IBinder, float, float);
|
method public void setWallpaperOffsets(android.os.IBinder, float, float);
|
||||||
method public void suggestDesiredDimensions(int, int);
|
method public void suggestDesiredDimensions(int, int);
|
||||||
|
|||||||
@@ -993,6 +993,47 @@ public class WallpaperManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Clear the wallpaper.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public void clearWallpaper() {
|
||||||
|
if (sGlobals.mService == null) {
|
||||||
|
Log.w(TAG, "WallpaperService not running");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
sGlobals.mService.clearWallpaper();
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the live wallpaper.
|
||||||
|
*
|
||||||
|
* This can only be called by packages with android.permission.SET_WALLPAPER_COMPONENT
|
||||||
|
* permission.
|
||||||
|
*
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@SystemApi
|
||||||
|
public boolean setWallpaperComponent(ComponentName name) {
|
||||||
|
if (sGlobals.mService == null) {
|
||||||
|
Log.w(TAG, "WallpaperService not running");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
sGlobals.mService.setWallpaperComponent(name);
|
||||||
|
return true;
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
// Ignore
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the position of the current wallpaper within any larger space, when
|
* Set the position of the current wallpaper within any larger space, when
|
||||||
* that wallpaper is visible behind the given window. The X and Y offsets
|
* that wallpaper is visible behind the given window. The X and Y offsets
|
||||||
|
|||||||
Reference in New Issue
Block a user