Code example for FileObserver

Methods: startWatching

0
        final long ident = Binder.clearCallingIdentity();
        try { 
            bindWallpaperComponentLocked(null); 
        } catch (IllegalArgumentException e) {
            // This can happen if the default wallpaper component doesn't 
            // exist.  This should be a system configuration problem, but 
            // let's not let it crash the system and just live with no 
            // wallpaper. 
            Slog.e(TAG, "Default wallpaper component not found!", e);
        } finally { 
            Binder.restoreCallingIdentity(ident);
        } 
    } 
 
    public void setDimensionHints(int width, int height) throws RemoteException {
        checkPermission(android.Manifest.permission.SET_WALLPAPER_HINTS);
 
        if (width <= 0 || height <= 0) {
            throw new IllegalArgumentException("width and height must be > 0");
        }