Skip to content

Commit

Permalink
some minute work on the service provider
Browse files Browse the repository at this point in the history
  • Loading branch information
JeroenDeDauw committed Nov 27, 2010
1 parent 01f4f53 commit eeecfac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 16 deletions.
Binary file modified bin/Pamela-for-Android.apk
Binary file not shown.
Binary file modified bin/classes.dex
Binary file not shown.
9 changes: 7 additions & 2 deletions src/pamela/client/PamelaColumns.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@ public final class PamelaColumns implements BaseColumns {
public static final Uri CONTENT_URI = Uri.parse("content://" + AUTHORITY + "/notes");

/**
* The MIME type of {@link #CONTENT_URI} providing a directory of notes.
* The MIME type of {@link #CONTENT_URI} providing a directory of services.
*/
public static final String CONTENT_TYPE = "pamela.client";
public static final String CONTENT_TYPE = "pamela.client.dit";

/**
* The MIME type of {@link #CONTENT_URI} providing a single service.
*/
public static final String CONTENT_ITEM_TYPE = "pamela.client.item";

/**
* The timestamp for when the note was created
Expand Down
16 changes: 2 additions & 14 deletions src/pamela/client/PamelaServiceProvider.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,31 +79,19 @@ public Cursor query(Uri uri, String[] projection, String selection, String[] sel
qb.setTables(DEVICES_TABLE_NAME);

switch (uriMatcher.match(uri)) {
case NOTES:
case SERVICES:
qb.setProjectionMap(sNotesProjectionMap);
break;

case NOTE_ID:
case SERVICE_ID:
qb.setProjectionMap(sNotesProjectionMap);
qb.appendWhere(NoteColumns._ID + "=" + uri.getPathSegments().get(1));
break;

case LIVE_FOLDER_NOTES:
qb.setProjectionMap(sLiveFolderProjectionMap);
break;

default:
throw new IllegalArgumentException("Unknown URI " + uri);
}

// If no sort order is specified use the default
String orderBy;
if (TextUtils.isEmpty(sortOrder)) {
orderBy = NoteColumns.DEFAULT_SORT_ORDER;
} else {
orderBy = sortOrder;
}

// Get the database and run the query
SQLiteDatabase db = mOpenHelper.getReadableDatabase();
Cursor c = qb.query(db, projection, selection, selectionArgs, null, null, orderBy);
Expand Down

0 comments on commit eeecfac

Please sign in to comment.