diff options
Diffstat (limited to 'core/java/android')
-rw-r--r-- | core/java/android/app/ApplicationContext.java | 11 | ||||
-rw-r--r-- | core/java/android/app/IWallpaperService.aidl | 2 | ||||
-rw-r--r-- | core/java/android/backup/BackupDataInput.java | 7 | ||||
-rw-r--r-- | core/java/android/os/FileObserver.java | 39 |
4 files changed, 35 insertions, 24 deletions
diff --git a/core/java/android/app/ApplicationContext.java b/core/java/android/app/ApplicationContext.java index 1e4ab68..b095e30 100644 --- a/core/java/android/app/ApplicationContext.java +++ b/core/java/android/app/ApplicationContext.java @@ -578,7 +578,7 @@ class ApplicationContext extends Context { @Override public void setWallpaper(Bitmap bitmap) throws IOException { try { - ParcelFileDescriptor fd = getWallpaperService().setWallpaper(); + ParcelFileDescriptor fd = getWallpaperService().setWallpaper(null); if (fd == null) { return; } @@ -598,7 +598,7 @@ class ApplicationContext extends Context { @Override public void setWallpaper(InputStream data) throws IOException { try { - ParcelFileDescriptor fd = getWallpaperService().setWallpaper(); + ParcelFileDescriptor fd = getWallpaperService().setWallpaper(null); if (fd == null) { return; } @@ -627,13 +627,16 @@ class ApplicationContext extends Context { @Override public void clearWallpaper() throws IOException { try { + Resources resources = getResources(); /* Set the wallpaper to the default values */ - ParcelFileDescriptor fd = getWallpaperService().setWallpaper(); + ParcelFileDescriptor fd = getWallpaperService().setWallpaper( + "res:" + resources.getResourceName( + com.android.internal.R.drawable.default_wallpaper)); if (fd != null) { FileOutputStream fos = null; try { fos = new ParcelFileDescriptor.AutoCloseOutputStream(fd); - setWallpaper(getResources().openRawResource( + setWallpaper(resources.openRawResource( com.android.internal.R.drawable.default_wallpaper), fos); } finally { diff --git a/core/java/android/app/IWallpaperService.aidl b/core/java/android/app/IWallpaperService.aidl index a332b1a..281a060 100644 --- a/core/java/android/app/IWallpaperService.aidl +++ b/core/java/android/app/IWallpaperService.aidl @@ -25,7 +25,7 @@ interface IWallpaperService { /** * Set the wallpaper. */ - ParcelFileDescriptor setWallpaper(); + ParcelFileDescriptor setWallpaper(String name); /** * Get the wallpaper. diff --git a/core/java/android/backup/BackupDataInput.java b/core/java/android/backup/BackupDataInput.java index 69c206c..e67b0be 100644 --- a/core/java/android/backup/BackupDataInput.java +++ b/core/java/android/backup/BackupDataInput.java @@ -97,12 +97,7 @@ public class BackupDataInput { public void skipEntityData() throws IOException { if (mHeaderReady) { - int result = skipEntityData_native(mBackupReader); - if (result >= 0) { - return; - } else { - throw new IOException("result=0x" + Integer.toHexString(result)); - } + skipEntityData_native(mBackupReader); } else { throw new IllegalStateException("mHeaderReady=false"); } diff --git a/core/java/android/os/FileObserver.java b/core/java/android/os/FileObserver.java index d9804ea..38d252e 100644 --- a/core/java/android/os/FileObserver.java +++ b/core/java/android/os/FileObserver.java @@ -25,22 +25,35 @@ import java.util.ArrayList; import java.util.HashMap; public abstract class FileObserver { - public static final int ACCESS = 0x00000001; /* File was accessed */ - public static final int MODIFY = 0x00000002; /* File was modified */ - public static final int ATTRIB = 0x00000004; /* Metadata changed */ - public static final int CLOSE_WRITE = 0x00000008; /* Writtable file was closed */ - public static final int CLOSE_NOWRITE = 0x00000010; /* Unwrittable file closed */ - public static final int OPEN = 0x00000020; /* File was opened */ - public static final int MOVED_FROM = 0x00000040; /* File was moved from X */ - public static final int MOVED_TO = 0x00000080; /* File was moved to Y */ - public static final int CREATE = 0x00000100; /* Subfile was created */ - public static final int DELETE = 0x00000200; /* Subfile was deleted */ - public static final int DELETE_SELF = 0x00000400; /* Self was deleted */ - public static final int MOVE_SELF = 0x00000800; /* Self was moved */ + /** File was accessed */ + public static final int ACCESS = 0x00000001; + /** File was modified */ + public static final int MODIFY = 0x00000002; + /** Metadata changed */ + public static final int ATTRIB = 0x00000004; + /** Writable file was closed */ + public static final int CLOSE_WRITE = 0x00000008; + /** Unwrittable file closed */ + public static final int CLOSE_NOWRITE = 0x00000010; + /** File was opened */ + public static final int OPEN = 0x00000020; + /** File was moved from X */ + public static final int MOVED_FROM = 0x00000040; + /** File was moved to Y */ + public static final int MOVED_TO = 0x00000080; + /** Subfile was created */ + public static final int CREATE = 0x00000100; + /** Subfile was deleted */ + public static final int DELETE = 0x00000200; + /** Self was deleted */ + public static final int DELETE_SELF = 0x00000400; + /** Self was moved */ + public static final int MOVE_SELF = 0x00000800; + public static final int ALL_EVENTS = ACCESS | MODIFY | ATTRIB | CLOSE_WRITE | CLOSE_NOWRITE | OPEN | MOVED_FROM | MOVED_TO | DELETE | CREATE | DELETE_SELF | MOVE_SELF; - + private static final String LOG_TAG = "FileObserver"; private static class ObserverThread extends Thread { |