diff options
Diffstat (limited to 'tests/src/com/android/photos/data/PhotoDatabaseUtils.java')
-rw-r--r-- | tests/src/com/android/photos/data/PhotoDatabaseUtils.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/src/com/android/photos/data/PhotoDatabaseUtils.java b/tests/src/com/android/photos/data/PhotoDatabaseUtils.java index 97db8bf7d..f7a46d419 100644 --- a/tests/src/com/android/photos/data/PhotoDatabaseUtils.java +++ b/tests/src/com/android/photos/data/PhotoDatabaseUtils.java @@ -65,6 +65,7 @@ public class PhotoDatabaseUtils { private static String SELECTION_ALBUM_PARENT_ID = Albums.PARENT_ID + " = ?"; private static String SELECTION_PHOTO_ALBUM_ID = Photos.ALBUM_ID + " = ?"; + private static String SELECTION_ACCOUNT_ID = Accounts.ACCOUNT_NAME + " = ?"; public static long queryAlbumIdFromParentId(SQLiteDatabase db, long parentId) { return queryId(db, Albums.TABLE, PROJECTION_ALBUMS, SELECTION_ALBUM_PARENT_ID, parentId); @@ -74,6 +75,10 @@ public class PhotoDatabaseUtils { return queryId(db, Photos.TABLE, PROJECTION_PHOTOS, SELECTION_PHOTO_ALBUM_ID, albumId); } + public static long queryAccountIdFromName(SQLiteDatabase db, String accountName) { + return queryId(db, Accounts.TABLE, PROJECTION_ACCOUNTS, SELECTION_ACCOUNT_ID, accountName); + } + public static long queryId(SQLiteDatabase db, String table, String[] projection, String selection, Object parameter) { String paramString = parameter == null ? null : parameter.toString(); |