Loading src/com/android/contacts/ContactsListActivity.java +0 −1 Original line number Diff line number Diff line Loading @@ -2267,7 +2267,6 @@ public final class ContactsListActivity extends ListActivity do { getContentResolver().update(ContentUris.withAppendedId(People.CONTENT_URI, c.getLong(0)), values, null, null); Log.d("HERE", "WE GO"); } while(c.moveToNext()); } } Loading src/com/android/contacts/EditContactActivity.java +21 −14 Original line number Diff line number Diff line Loading @@ -2513,6 +2513,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL CharSequence[] groupsCharSeq = null; boolean[] checkedValues = null; // If selected groups already has something inside, we use it if (selectedGroups.size() > 0) { groupsCharSeq = groups.toArray( Loading Loading @@ -2550,6 +2551,8 @@ public final class EditContactActivity extends Activity implements View.OnClickL } groupsCharSeq = groups.toArray(new CharSequence[groups.size()]); if (!(mState == STATE_INSERT)) { long personId = ContentUris.parseId(mUri); Cursor groupCursor = mResolver.query(GroupMembership.CONTENT_URI, Loading Loading @@ -2580,6 +2583,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL cur.close(); groupCursor.close(); } } checkedValues = new boolean[groups.size()]; Loading @@ -2587,6 +2591,8 @@ public final class EditContactActivity extends Activity implements View.OnClickL b = false; } if (!(mState == STATE_INSERT)) { for (int i = 0; i < currentMembership.size(); i++) { int j = groups.indexOf(currentMembership.get(i)); Loading @@ -2595,6 +2601,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL selectedGroups.add(groups.get(j)); } } } } finally { cursor.close(); } Loading Loading @@ -2630,26 +2637,26 @@ public final class EditContactActivity extends Activity implements View.OnClickL }; private void saveGroups() { long personId = ContentUris.parseId(mUri); //Wysie_Soh: Remove all group memberships Cursor c = getContentResolver().query(GroupMembership.CONTENT_URI, //Wysie_Soh: Remove all group memberships (not working) Cursor c = mResolver.query(GroupMembership.CONTENT_URI, GROUP_MEMBERSHIP_PROJECTION, GroupMembership.PERSON_ID + "='" + personId + "'", null, null); if (c.moveToFirst()) { do { /*int i = mResolver.delete( ContentUris.withAppendedId(GroupMembership.CONTENT_URI, c.getLong(0)), null, null);*/ } while (c.moveToNext()); while (c.moveToNext()) { int i = mResolver.delete(ContentUris.withAppendedId( GroupMembership.CONTENT_URI, c.getLong(0)), GroupMembership.PERSON_ID + "='" + personId + "'", null); Log.d("ROWS DEL", "" + i); } c.close(); } //Wysie_Soh: Added all selectedGroups //Wysie_Soh: Added all selectedGroups (working) for (int i = 0; i < selectedGroups.size(); i++) { Cursor cursor = mResolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION, Loading src/com/android/contacts/ViewContactActivity.java +10 −1 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.HashSet; import java.util.List; /** Bluetooth Transfer related import */ Loading Loading @@ -1112,6 +1113,7 @@ public class ViewContactActivity extends ListActivity } cur.close(); groupCursor.close(); removeDuplicates(groupNamesArray); java.util.Collections.sort(groupNamesArray); StringBuilder groups = new StringBuilder(); Loading @@ -1133,6 +1135,13 @@ public class ViewContactActivity extends ListActivity } } private void removeDuplicates(ArrayList al) { HashSet h = new HashSet(al); al.clear(); al.addAll(h); } String buildActionString(int actionResId, CharSequence type, boolean lowerCase) { // If there is no type just display an empty string if (type == null) { Loading Loading
src/com/android/contacts/ContactsListActivity.java +0 −1 Original line number Diff line number Diff line Loading @@ -2267,7 +2267,6 @@ public final class ContactsListActivity extends ListActivity do { getContentResolver().update(ContentUris.withAppendedId(People.CONTENT_URI, c.getLong(0)), values, null, null); Log.d("HERE", "WE GO"); } while(c.moveToNext()); } } Loading
src/com/android/contacts/EditContactActivity.java +21 −14 Original line number Diff line number Diff line Loading @@ -2513,6 +2513,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL CharSequence[] groupsCharSeq = null; boolean[] checkedValues = null; // If selected groups already has something inside, we use it if (selectedGroups.size() > 0) { groupsCharSeq = groups.toArray( Loading Loading @@ -2550,6 +2551,8 @@ public final class EditContactActivity extends Activity implements View.OnClickL } groupsCharSeq = groups.toArray(new CharSequence[groups.size()]); if (!(mState == STATE_INSERT)) { long personId = ContentUris.parseId(mUri); Cursor groupCursor = mResolver.query(GroupMembership.CONTENT_URI, Loading Loading @@ -2580,6 +2583,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL cur.close(); groupCursor.close(); } } checkedValues = new boolean[groups.size()]; Loading @@ -2587,6 +2591,8 @@ public final class EditContactActivity extends Activity implements View.OnClickL b = false; } if (!(mState == STATE_INSERT)) { for (int i = 0; i < currentMembership.size(); i++) { int j = groups.indexOf(currentMembership.get(i)); Loading @@ -2595,6 +2601,7 @@ public final class EditContactActivity extends Activity implements View.OnClickL selectedGroups.add(groups.get(j)); } } } } finally { cursor.close(); } Loading Loading @@ -2630,26 +2637,26 @@ public final class EditContactActivity extends Activity implements View.OnClickL }; private void saveGroups() { long personId = ContentUris.parseId(mUri); //Wysie_Soh: Remove all group memberships Cursor c = getContentResolver().query(GroupMembership.CONTENT_URI, //Wysie_Soh: Remove all group memberships (not working) Cursor c = mResolver.query(GroupMembership.CONTENT_URI, GROUP_MEMBERSHIP_PROJECTION, GroupMembership.PERSON_ID + "='" + personId + "'", null, null); if (c.moveToFirst()) { do { /*int i = mResolver.delete( ContentUris.withAppendedId(GroupMembership.CONTENT_URI, c.getLong(0)), null, null);*/ } while (c.moveToNext()); while (c.moveToNext()) { int i = mResolver.delete(ContentUris.withAppendedId( GroupMembership.CONTENT_URI, c.getLong(0)), GroupMembership.PERSON_ID + "='" + personId + "'", null); Log.d("ROWS DEL", "" + i); } c.close(); } //Wysie_Soh: Added all selectedGroups //Wysie_Soh: Added all selectedGroups (working) for (int i = 0; i < selectedGroups.size(); i++) { Cursor cursor = mResolver.query(Groups.CONTENT_URI, GROUPS_PROJECTION, Loading
src/com/android/contacts/ViewContactActivity.java +10 −1 Original line number Diff line number Diff line Loading @@ -99,6 +99,7 @@ import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import java.util.HashSet; import java.util.List; /** Bluetooth Transfer related import */ Loading Loading @@ -1112,6 +1113,7 @@ public class ViewContactActivity extends ListActivity } cur.close(); groupCursor.close(); removeDuplicates(groupNamesArray); java.util.Collections.sort(groupNamesArray); StringBuilder groups = new StringBuilder(); Loading @@ -1133,6 +1135,13 @@ public class ViewContactActivity extends ListActivity } } private void removeDuplicates(ArrayList al) { HashSet h = new HashSet(al); al.clear(); al.addAll(h); } String buildActionString(int actionResId, CharSequence type, boolean lowerCase) { // If there is no type just display an empty string if (type == null) { Loading