question: public ArrayList < Phone > addAliasByName ( String aliasName , String name ) { if ( aliasName . contains ( "'" ) ) return null ; ArrayList < Phone > res ; res = ContactsManager . getMobilePhones ( ctx , name ) ; if ( res . size ( ) == 1 ) { Phone p = res . get ( 0 ) ; addOrUpdate ( aliasName , p . getCleanNumber ( ) , p . getContactName ( ) ) ; } return res ; }
target:  Tries to add or update a alias Returns null if the aliasName contains invalid characters Returns an ArrayList of Phones with matching names If the list has a size of 1 the name was distinct enough to and the alias was added. Otherwise the user should specify more details with help from the list