More fixes from crash reported by Google Play Store
This commit is contained in:
parent
26b276d62c
commit
f88c3e3159
4 changed files with 33 additions and 15 deletions
|
@ -367,12 +367,16 @@ public class ContactDetailsFragment extends Fragment implements ContactsUpdatedL
|
||||||
if (core == null) return;
|
if (core == null) return;
|
||||||
|
|
||||||
Address participant = Factory.instance().createAddress(tag);
|
Address participant = Factory.instance().createAddress(tag);
|
||||||
|
if (participant == null) {
|
||||||
|
Log.e("[Contact Detail] Couldn't parse ", tag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
|
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
|
||||||
|
|
||||||
if (defaultProxyConfig != null) {
|
if (defaultProxyConfig != null) {
|
||||||
ChatRoom room =
|
ChatRoom room =
|
||||||
core.findOneToOneChatRoom(
|
core.findOneToOneChatRoom(
|
||||||
defaultProxyConfig.getContact(), participant, isSecured);
|
defaultProxyConfig.getIdentityAddress(), participant, isSecured);
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
((ContactsActivity) getActivity())
|
((ContactsActivity) getActivity())
|
||||||
.showChatRoom(room.getLocalAddress(), room.getPeerAddress());
|
.showChatRoom(room.getLocalAddress(), room.getPeerAddress());
|
||||||
|
|
|
@ -531,7 +531,9 @@ public class LinphoneContact extends AndroidContact
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void syncValuesFromAndroidContact(Context context) {
|
private synchronized void syncValuesFromAndroidContact(Context context) {
|
||||||
Cursor c =
|
Cursor c = null;
|
||||||
|
try {
|
||||||
|
c =
|
||||||
context.getContentResolver()
|
context.getContentResolver()
|
||||||
.query(
|
.query(
|
||||||
ContactsContract.Data.CONTENT_URI,
|
ContactsContract.Data.CONTENT_URI,
|
||||||
|
@ -543,6 +545,10 @@ public class LinphoneContact extends AndroidContact
|
||||||
+ mAndroidId,
|
+ mAndroidId,
|
||||||
null,
|
null,
|
||||||
null);
|
null);
|
||||||
|
} catch (SecurityException se) {
|
||||||
|
Log.e("[Contact] Security exception: ", se);
|
||||||
|
}
|
||||||
|
|
||||||
if (c != null) {
|
if (c != null) {
|
||||||
mAddresses = new ArrayList<>();
|
mAddresses = new ArrayList<>();
|
||||||
while (c.moveToNext()) {
|
while (c.moveToNext()) {
|
||||||
|
|
|
@ -260,12 +260,16 @@ public class HistoryDetailFragment extends Fragment {
|
||||||
if (core == null) return;
|
if (core == null) return;
|
||||||
|
|
||||||
Address participant = Factory.instance().createAddress(mSipUri);
|
Address participant = Factory.instance().createAddress(mSipUri);
|
||||||
|
if (participant == null) {
|
||||||
|
Log.e("[History Detail] Couldn't parse ", mSipUri);
|
||||||
|
return;
|
||||||
|
}
|
||||||
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
|
ProxyConfig defaultProxyConfig = core.getDefaultProxyConfig();
|
||||||
|
|
||||||
if (defaultProxyConfig != null) {
|
if (defaultProxyConfig != null) {
|
||||||
ChatRoom room =
|
ChatRoom room =
|
||||||
core.findOneToOneChatRoom(
|
core.findOneToOneChatRoom(
|
||||||
defaultProxyConfig.getContact(), participant, isSecured);
|
defaultProxyConfig.getIdentityAddress(), participant, isSecured);
|
||||||
if (room != null) {
|
if (room != null) {
|
||||||
((HistoryActivity) getActivity())
|
((HistoryActivity) getActivity())
|
||||||
.showChatRoom(room.getLocalAddress(), room.getPeerAddress());
|
.showChatRoom(room.getLocalAddress(), room.getPeerAddress());
|
||||||
|
|
|
@ -198,7 +198,11 @@ public class NetworkSettingsFragment extends SettingsFragment {
|
||||||
mPrefs.powerSaverDialogPrompted(true);
|
mPrefs.powerSaverDialogPrompted(true);
|
||||||
Intent intent = DeviceUtils.getDevicePowerManagerIntent(getActivity());
|
Intent intent = DeviceUtils.getDevicePowerManagerIntent(getActivity());
|
||||||
if (intent != null) {
|
if (intent != null) {
|
||||||
|
try {
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
} catch (SecurityException se) {
|
||||||
|
Log.e("[Network Settings] Security exception: ", se);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue