Updated procedure for change package name + fixed crash when contacts sync account creation failed

This commit is contained in:
Sylvain Berfini 2016-01-29 10:58:29 +01:00
parent 6ee24d9804
commit 9204c83c0b
8 changed files with 10 additions and 6 deletions

View file

@ -73,7 +73,7 @@
</intent-filter> </intent-filter>
<intent-filter> <intent-filter>
<data android:mimeType="vnd.android.cursor.item/org.linphone.profile" /> <data android:mimeType="vnd.android.cursor.item/org.linphone.profile" /> <!-- Change package ! -->
<action android:name="android.intent.action.VIEW" /> <action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" /> <category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />

1
README
View file

@ -43,6 +43,7 @@ You need to edit the custom_rules.xml file:
1) look for the property named "linphone.package.name" and change it value accordingly 1) look for the property named "linphone.package.name" and change it value accordingly
2) also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears 2) also update the values in the AndroidManifest file where the comment <!-- Change package ! --> appears
3) update the path to the sounds in the linphonerc-factory files in the res folders and optionally change default sip account on linphonerc-default 3) update the path to the sounds in the linphonerc-factory files in the res folders and optionally change default sip account on linphonerc-default
4) change the package name also in the files: res/xml/syncadapter.xml, res/xml/contacts.xml and res/xml/non_localizable_custom where <!-- Change package ! --> appears
4) run again the Makefile script by calling "make" 4) run again the Makefile script by calling "make"
To run the liblinphone test suite on android To run the liblinphone test suite on android

View file

@ -4,6 +4,8 @@
<string name="default_domain">sip.linphone.org</string> <string name="default_domain">sip.linphone.org</string>
<string name="default_stun">stun.linphone.org</string> <string name="default_stun">stun.linphone.org</string>
<string name="sync_account_type">org.linphone</string> <!-- Change package ! -->
<string name="sync_mimetype">vnd.android.cursor.item/org.linphone.profile</string> <!-- Change package, leave .profile at the end ! -->
<bool name="assistant_use_linphone_login_as_first_fragment">false</bool> <bool name="assistant_use_linphone_login_as_first_fragment">false</bool>
<bool name="hide_in_call_stats">false</bool> <bool name="hide_in_call_stats">false</bool>

View file

@ -12,9 +12,7 @@
<string name="about_text">Linphone %s SIP (RFC 3261) compatible phone under GNU Public License V2</string> <string name="about_text">Linphone %s SIP (RFC 3261) compatible phone under GNU Public License V2</string>
<string name="about_link">http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2016 Belledonne Communications</string> <string name="about_link">http://www.linphone.org\n\nInstructions\nhttp://www.linphone.org/user-guide.html\n\n© 2016 Belledonne Communications</string>
<string name="sync_account_type">org.linphone</string>
<string name="sync_account_name">linphone contacts</string> <string name="sync_account_name">linphone contacts</string>
<string name="sync_mimetype">vnd.android.cursor.item/org.linphone.profile</string>
<string name="history_date_format">EEE, d MMM</string> <string name="history_date_format">EEE, d MMM</string>
<string name="history_detail_date_format">yyyy/MM/dd - HH:mm - </string> <string name="history_detail_date_format">yyyy/MM/dd - HH:mm - </string>

View file

@ -3,6 +3,7 @@
<ContactsSource <ContactsSource
xmlns:android="http://schemas.android.com/apk/res/android"> xmlns:android="http://schemas.android.com/apk/res/android">
<!-- Change package ! -->
<ContactsDataKind <ContactsDataKind
android:mimeType="vnd.android.cursor.item/org.linphone.profile" android:mimeType="vnd.android.cursor.item/org.linphone.profile"
android:icon="@drawable/linphone_logo" android:icon="@drawable/linphone_logo"
@ -10,4 +11,4 @@
android:detailColumn="data3" android:detailColumn="data3"
android:detailSocialSummary="true"/> android:detailSocialSummary="true"/>
</ContactsSource> </ContactsSource>

View file

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!-- Change package ! -->
<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
android:contentAuthority="com.android.contacts" android:contentAuthority="com.android.contacts"
android:accountType="org.linphone" android:accountType="org.linphone"

View file

@ -380,7 +380,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
if (sipContactsCursor != null && sipContactsCursor.getCount() == 0) { if (sipContactsCursor != null && sipContactsCursor.getCount() == 0) {
noSipContact.setVisibility(View.VISIBLE); noSipContact.setVisibility(View.VISIBLE);
contactsList.setVisibility(View.GONE); contactsList.setVisibility(View.GONE);
} else { } else if (sipContactsCursor != null) {
indexer = new AlphabetIndexer(sipContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(sipContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ"); indexer = new AlphabetIndexer(sipContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(sipContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getSIPContacts(), sipContactsCursor)); contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getSIPContacts(), sipContactsCursor));
@ -389,7 +389,7 @@ public class ContactsListFragment extends Fragment implements OnClickListener, O
if (allContactsCursor != null && allContactsCursor.getCount() == 0) { if (allContactsCursor != null && allContactsCursor.getCount() == 0) {
noContact.setVisibility(View.VISIBLE); noContact.setVisibility(View.VISIBLE);
contactsList.setVisibility(View.GONE); contactsList.setVisibility(View.GONE);
} else { } else if (allContactsCursor != null) {
indexer = new AlphabetIndexer(allContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(allContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ"); indexer = new AlphabetIndexer(allContactsCursor, Compatibility.getCursorDisplayNameColumnIndex(allContactsCursor), " ABCDEFGHIJKLMNOPQRSTUVWXYZ");
contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE); contactsList.setChoiceMode(AbsListView.CHOICE_MODE_MULTIPLE);
contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor)); contactsList.setAdapter(new ContactsListAdapter(ContactsManager.getInstance().getAllContacts(), allContactsCursor));

View file

@ -103,6 +103,7 @@ public class ContactsManager {
accountManager.addAccountExplicitly(newAccount, null, null); accountManager.addAccountExplicitly(newAccount, null, null);
mAccount = newAccount; mAccount = newAccount;
} catch (Exception e) { } catch (Exception e) {
Log.e(e);
mAccount = null; mAccount = null;
} }
} else { } else {