Fix crash when starring the user's profile
Bug: 10897667
Change-Id: I61b11ff7aea0fa7b1b76bdf7c1780a2189070570
diff --git a/src/com/android/contacts/ContactSaveService.java b/src/com/android/contacts/ContactSaveService.java
index 8a3ef32..9f916fb 100644
--- a/src/com/android/contacts/ContactSaveService.java
+++ b/src/com/android/contacts/ContactSaveService.java
@@ -819,9 +819,13 @@
try {
if (c.moveToFirst()) {
final long id = c.getLong(0);
- values.clear();
- values.put(String.valueOf(id), PinnedPositions.UNDEMOTE);
- getContentResolver().update(PinnedPositions.UPDATE_URI, values, null, null);
+
+ // Don't bother undemoting if this contact is the user's profile.
+ if (id < Profile.MIN_ID) {
+ values.clear();
+ values.put(String.valueOf(id), PinnedPositions.UNDEMOTE);
+ getContentResolver().update(PinnedPositions.UPDATE_URI, values, null, null);
+ }
}
} finally {
c.close();