Do not log Contextual card display when card is dismissed

If the db change comes from dismiss card uri. We don't
need to log card display again.

Fixes: 121196921
Test: Robolectric
Change-Id: I4e222187fafa8325e803fa6ee17ebb0b51fb8cb2
This commit is contained in:
Raff Tsai
2019-02-17 01:22:39 +08:00
parent d5a04e1912
commit 3881e2986c
6 changed files with 53 additions and 13 deletions

View File

@@ -208,7 +208,7 @@ public class CardDatabaseHelper extends SQLiteOpenHelper {
* Mark a specific ContextualCard with dismissal flag in the database to indicate that the
* card has been dismissed.
*
* @param context Context
* @param context Context
* @param cardName The card name of the ContextualCard which is dismissed by user.
* @return The number of rows updated
*/
@@ -220,7 +220,7 @@ public class CardDatabaseHelper extends SQLiteOpenHelper {
final String[] selectionArgs = {cardName};
final int rowsUpdated = database.update(CARD_TABLE, values, selection, selectionArgs);
database.close();
context.getContentResolver().notifyChange(CardContentProvider.URI, null);
context.getContentResolver().notifyChange(CardContentProvider.DELETE_CARD_URI, null);
return rowsUpdated;
}
}