# HG changeset patch # User Da Risk # Date 1344570831 -7200 # Node ID 2a2d824785384171bbafcd8a6684fada8cdd6896 # Parent 46b16746d8a273700375de3a4436cbe8c0431269 Add an exception for my_avatar id in AvatarProvider. This fix a bug when the my_avatar file does not exist it is not created by openFileHelper. diff -r 46b16746d8a2 -r 2a2d82478538 AndroidManifest.xml --- a/AndroidManifest.xml Fri Aug 10 05:38:39 2012 +0200 +++ b/AndroidManifest.xml Fri Aug 10 05:53:51 2012 +0200 @@ -2,9 +2,26 @@ + + + + + + + + + + + + + + @@ -52,16 +69,5 @@ - - - - - - - - - + diff -r 46b16746d8a2 -r 2a2d82478538 src/com/beem/project/beem/providers/AvatarProvider.java --- a/src/com/beem/project/beem/providers/AvatarProvider.java Fri Aug 10 05:38:39 2012 +0200 +++ b/src/com/beem/project/beem/providers/AvatarProvider.java Fri Aug 10 05:53:51 2012 +0200 @@ -74,6 +74,11 @@ /** The MIME type of a CONTENT_URI subdirectory of a single Beem avatar. */ public static final String CONTENT_ITEM_TYPE = "vnd.android.cursor.item/vnd.com.beem.project.beem.avatar"; + /** + * Id of the user avatar. + */ + public static final String MY_AVATAR_ID = "my_avatar"; + private static final String TAG = AvatarProvider.class.getSimpleName(); private static final String AUTHORITY = "com.beem.project.beem.providers.avatarprovider"; @@ -130,7 +135,7 @@ case AVATAR_ID: String id = uri.getPathSegments().get(0); File f = new File(mDataPath, id); - if (f.exists()) + if (f.exists() || MY_AVATAR_ID.equals(f.getName())) c.newRow().add(f.getName()).add(f.getAbsolutePath()); break; default: