Metadata URI does not need additionalId.

Bug 20701628.

Change-Id: Ifba1e7dd7f9934c8c13279dfb95bf02c0e30e650
This commit is contained in:
Dan Zivkovic 2015-05-06 09:30:47 -07:00
parent 58bc0e057e
commit bdc55e77f7
2 changed files with 6 additions and 10 deletions

View File

@ -19,16 +19,11 @@ package com.android.inputmethod.dictionarypack;
import android.content.Context;
/**
* Helper to get the metadata URI from its base URI and the additional ID, if any.
* Helper to get the metadata URI from its base URI.
*/
@SuppressWarnings("unused")
public class MetadataUriGetter {
private MetadataUriGetter() {
// This helper class is not instantiable.
}
public static String getUri(final Context context, final String baseUri,
final String additionalId) {
public static String getUri(final Context context, final String baseUri) {
return baseUri;
}
}

View File

@ -345,6 +345,8 @@ public class MetadataDbHelper extends SQLiteOpenHelper {
return null != getMetadataUriAsString(context, clientId);
}
private static final MetadataUriGetter sMetadataUriGetter = new MetadataUriGetter();
/**
* Returns the metadata URI as a string.
*
@ -358,13 +360,12 @@ public class MetadataDbHelper extends SQLiteOpenHelper {
public static String getMetadataUriAsString(final Context context, final String clientId) {
SQLiteDatabase defaultDb = MetadataDbHelper.getDb(context, null);
final Cursor cursor = defaultDb.query(MetadataDbHelper.CLIENT_TABLE_NAME,
new String[] { MetadataDbHelper.CLIENT_METADATA_URI_COLUMN,
MetadataDbHelper.CLIENT_METADATA_ADDITIONAL_ID_COLUMN },
new String[] { MetadataDbHelper.CLIENT_METADATA_URI_COLUMN },
MetadataDbHelper.CLIENT_CLIENT_ID_COLUMN + " = ?", new String[] { clientId },
null, null, null, null);
try {
if (!cursor.moveToFirst()) return null;
return MetadataUriGetter.getUri(context, cursor.getString(0), cursor.getString(1));
return sMetadataUriGetter.getUri(context, cursor.getString(0));
} finally {
cursor.close();
}