summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMangesh Ghiware <mghiware@google.com>2013-03-07 08:55:18 -0800
committerMangesh Ghiware <mghiware@google.com>2013-03-07 09:15:26 -0800
commit5e46468ff8bce4c2912b9f5fb64df68f24f281cc (patch)
tree152b81df3955390a59bb371e48b36fa0d9ed586b
parent2678d9626f3efc6b0728de52c193598ecef02a8a (diff)
downloadandroid_packages_apps_Snap-5e46468ff8bce4c2912b9f5fb64df68f24f281cc.zip
android_packages_apps_Snap-5e46468ff8bce4c2912b9f5fb64df68f24f281cc.tar.gz
android_packages_apps_Snap-5e46468ff8bce4c2912b9f5fb64df68f24f281cc.tar.bz2
Remove redundant Album NAME (replaced by TITLE)
Change-Id: I0482f8b4bd85e07aefe4af02b1e8dab4702eb9f6
-rw-r--r--src/com/android/photos/data/PhotoDatabase.java5
-rw-r--r--src/com/android/photos/data/PhotoProvider.java2
-rw-r--r--tests/src/com/android/photos/data/PhotoDatabaseUtils.java5
-rw-r--r--tests/src/com/android/photos/data/PhotoProviderTest.java15
4 files changed, 11 insertions, 16 deletions
diff --git a/src/com/android/photos/data/PhotoDatabase.java b/src/com/android/photos/data/PhotoDatabase.java
index 8585edc..a87f00b 100644
--- a/src/com/android/photos/data/PhotoDatabase.java
+++ b/src/com/android/photos/data/PhotoDatabase.java
@@ -59,14 +59,13 @@ public class PhotoDatabase extends SQLiteOpenHelper {
{ Albums.ACCOUNT_ID, "INTEGER NOT NULL" },
// Albums.PARENT_ID is a foreign key to Albums._ID
{ Albums.PARENT_ID, "INTEGER" },
- { Albums.NAME, "Text NOT NULL" },
{ Albums.VISIBILITY, "INTEGER NOT NULL" },
{ Albums.LOCATION_STRING, "TEXT" },
- { Albums.TITLE, "TEXT" },
+ { Albums.TITLE, "TEXT NOT NULL" },
{ Albums.SUMMARY, "TEXT" },
{ Albums.DATE_PUBLISHED, "INTEGER" },
{ Albums.DATE_MODIFIED, "INTEGER" },
- createUniqueConstraint(Albums.PARENT_ID, Albums.NAME),
+ createUniqueConstraint(Albums.PARENT_ID, Albums.TITLE),
};
private static final String[][] CREATE_METADATA = {
diff --git a/src/com/android/photos/data/PhotoProvider.java b/src/com/android/photos/data/PhotoProvider.java
index a4fe8fd..7d751bf 100644
--- a/src/com/android/photos/data/PhotoProvider.java
+++ b/src/com/android/photos/data/PhotoProvider.java
@@ -131,8 +131,6 @@ public class PhotoProvider extends ContentProvider {
public static final String ACCOUNT_ID = "account_id";
/** Parent directory or null if this is in the root. */
public static final String PARENT_ID = "parent_id";
- /** Column name for the name of the album. String value. */
- public static final String NAME = "name";
/**
* Column name for the visibility level of the album. Can be any of the
* VISIBILITY_* values.
diff --git a/tests/src/com/android/photos/data/PhotoDatabaseUtils.java b/tests/src/com/android/photos/data/PhotoDatabaseUtils.java
index 1840eb1..97db8bf 100644
--- a/tests/src/com/android/photos/data/PhotoDatabaseUtils.java
+++ b/tests/src/com/android/photos/data/PhotoDatabaseUtils.java
@@ -31,7 +31,6 @@ public class PhotoDatabaseUtils {
Albums._ID,
Albums.ACCOUNT_ID,
Albums.PARENT_ID,
- Albums.NAME,
Albums.VISIBILITY,
Albums.LOCATION_STRING,
Albums.TITLE,
@@ -105,11 +104,11 @@ public class PhotoDatabaseUtils {
return db.insert(Photos.TABLE, null, values) != -1;
}
- public static boolean insertAlbum(SQLiteDatabase db, Long parentId, String name,
+ public static boolean insertAlbum(SQLiteDatabase db, Long parentId, String title,
Integer privacy, Long accountId) {
ContentValues values = new ContentValues();
values.put(Albums.PARENT_ID, parentId);
- values.put(Albums.NAME, name);
+ values.put(Albums.TITLE, title);
values.put(Albums.VISIBILITY, privacy);
values.put(Albums.ACCOUNT_ID, accountId);
return db.insert(Albums.TABLE, null, values) != -1;
diff --git a/tests/src/com/android/photos/data/PhotoProviderTest.java b/tests/src/com/android/photos/data/PhotoProviderTest.java
index 927a9d0..47c6e86 100644
--- a/tests/src/com/android/photos/data/PhotoProviderTest.java
+++ b/tests/src/com/android/photos/data/PhotoProviderTest.java
@@ -34,7 +34,7 @@ public class PhotoProviderTest extends ProviderTestCase2<PhotoProvider> {
private static final String TAG = PhotoProviderTest.class.getSimpleName();
private static final String MIME_TYPE = "test/test";
- private static final String ALBUM_NAME = "My Album";
+ private static final String ALBUM_TITLE = "My Album";
private static final long ALBUM_PARENT_ID = 100;
private static final String META_KEY = "mykey";
private static final String META_VALUE = "myvalue";
@@ -69,7 +69,7 @@ public class PhotoProviderTest extends ProviderTestCase2<PhotoProvider> {
SQLiteDatabase db = mDBHelper.getWritableDatabase();
db.beginTransaction();
try {
- PhotoDatabaseUtils.insertAlbum(db, ALBUM_PARENT_ID, ALBUM_NAME,
+ PhotoDatabaseUtils.insertAlbum(db, ALBUM_PARENT_ID, ALBUM_TITLE,
Albums.VISIBILITY_PRIVATE, 100L);
mAlbumId = PhotoDatabaseUtils.queryAlbumIdFromParentId(db, ALBUM_PARENT_ID);
PhotoDatabaseUtils.insertPhoto(db, 100, 100, System.currentTimeMillis(), mAlbumId,
@@ -188,16 +188,15 @@ public class PhotoProviderTest extends ProviderTestCase2<PhotoProvider> {
public void testInsert() {
ContentValues values = new ContentValues();
- values.put(Albums.NAME, "add me");
+ values.put(Albums.TITLE, "add me");
values.put(Albums.VISIBILITY, Albums.VISIBILITY_PRIVATE);
values.put(Albums.ACCOUNT_ID, 100L);
values.put(Albums.DATE_MODIFIED, 100L);
values.put(Albums.DATE_PUBLISHED, 100L);
values.put(Albums.LOCATION_STRING, "Home");
- values.put(Albums.NAME, "hello world");
+ values.put(Albums.TITLE, "hello world");
values.putNull(Albums.PARENT_ID);
values.put(Albums.SUMMARY, "Nothing much to say about this");
- values.put(Albums.TITLE, "Title");
Uri insertedUri = mResolver.insert(Albums.CONTENT_URI, values);
assertNotNull(insertedUri);
Cursor cursor = mResolver.query(insertedUri, PhotoDatabaseUtils.PROJECTION_ALBUMS, null,
@@ -210,11 +209,11 @@ public class PhotoProviderTest extends ProviderTestCase2<PhotoProvider> {
public void testUpdate() {
ContentValues values = new ContentValues();
// Normal update -- use an album.
- values.put(Albums.NAME, "foo");
+ values.put(Albums.TITLE, "foo");
Uri albumUri = ContentUris.withAppendedId(Albums.CONTENT_URI, mAlbumId);
assertEquals(1, mResolver.update(albumUri, values, null, null));
String[] projection = {
- Albums.NAME,
+ Albums.TITLE,
};
Cursor cursor = mResolver.query(albumUri, projection, null, null, null);
assertEquals(1, cursor.getCount());
@@ -224,7 +223,7 @@ public class PhotoProviderTest extends ProviderTestCase2<PhotoProvider> {
// Update a row that doesn't exist.
Uri noAlbumUri = ContentUris.withAppendedId(Albums.CONTENT_URI, mAlbumId + 1);
- values.put(Albums.NAME, "bar");
+ values.put(Albums.TITLE, "bar");
assertEquals(0, mResolver.update(noAlbumUri, values, null, null));
// Update a metadata value that exists.