boolean addPersona ( SPFPersona persona ) { SQLiteDatabase db = getWritableDatabase ( ) ; String table = Contract . TABLE_PERSONAS ; String nullColumnHack = null ; ContentValues values = new ContentValues ( ) ; values . put ( Contract . COLUMN_PERSONA , persona . getIdentifier ( ) ) ; if ( db . insert ( table , nullColumnHack , values ) > 0 ) { // copy the unique identifier ProfileFieldContainer pfc = getProfileFieldBulk ( SPFPersona . getDefault ( ) , ProfileField . IDENTIFIER ) ; String id = pfc . getFieldValue ( ProfileField . IDENTIFIER ) ; if ( setValue ( ProfileField . IDENTIFIER . getIdentifier ( ) , id , persona . getIdentifier ( ) ) ) { addCircleToFieldsInternal ( DefaultCircles . PUBLIC , ProfileField . IDENTIFIER , persona , db ) ; addCircleToFieldsInternal ( DefaultCircles . PUBLIC , ProfileField . DISPLAY_NAME , persona , db ) ; return true ; } else { removePersona ( persona ) ; return false ; } } return false ; }
Creates a new SPFPersona .