More fixes from crash reported by Google Play Store

This commit is contained in:
Sylvain Berfini 2019-12-11 10:08:42 +01:00
parent 26b276d62c
commit f88c3e3159
4 changed files with 33 additions and 15 deletions

View file

@ -367,12 +367,16 @@ public class ContactDetailsFragment extends Fragment implements ContactsUpdatedL
if (core == null) return;
Address participant = Factory.instance().createAddress(tag);
if (participant == null) {
Log.e("[Contact Detail] Couldn't parse ", tag);
return;
}
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
if (defaultProxyConfig != null) {
ChatRoom room =
core.findOneToOneChatRoom(
defaultProxyConfig.getContact(), participant, isSecured);
defaultProxyConfig.getIdentityAddress(), participant, isSecured);
if (room != null) {
((ContactsActivity) getActivity())
.showChatRoom(room.getLocalAddress(), room.getPeerAddress());

View file

@ -531,7 +531,9 @@ public class LinphoneContact extends AndroidContact
}
private synchronized void syncValuesFromAndroidContact(Context context) {
Cursor c =
Cursor c = null;
try {
c =
context.getContentResolver()
.query(
ContactsContract.Data.CONTENT_URI,
@ -543,6 +545,10 @@ public class LinphoneContact extends AndroidContact
+ mAndroidId,
null,
null);
} catch (SecurityException se) {
Log.e("[Contact] Security exception: ", se);
}
if (c != null) {
mAddresses = new ArrayList<>();
while (c.moveToNext()) {

View file

@ -260,12 +260,16 @@ public class HistoryDetailFragment extends Fragment {
if (core == null) return;
Address participant = Factory.instance().createAddress(mSipUri);
if (participant == null) {
Log.e("[History Detail] Couldn't parse ", mSipUri);
return;
}
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
if (defaultProxyConfig != null) {
ChatRoom room =
core.findOneToOneChatRoom(
defaultProxyConfig.getContact(), participant, isSecured);
defaultProxyConfig.getIdentityAddress(), participant, isSecured);
if (room != null) {
((HistoryActivity) getActivity())
.showChatRoom(room.getLocalAddress(), room.getPeerAddress());

View file

@ -198,7 +198,11 @@ public class NetworkSettingsFragment extends SettingsFragment {
mPrefs.powerSaverDialogPrompted(true);
Intent intent = DeviceUtils.getDevicePowerManagerIntent(getActivity());
if (intent != null) {
try {
startActivity(intent);
} catch (SecurityException se) {
Log.e("[Network Settings] Security exception: ", se);
}
}
}
});