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;
|
||||
|
||||
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());
|
||||
|
|
|
@ -531,18 +531,24 @@ public class LinphoneContact extends AndroidContact
|
|||
}
|
||||
|
||||
private synchronized void syncValuesFromAndroidContact(Context context) {
|
||||
Cursor c =
|
||||
context.getContentResolver()
|
||||
.query(
|
||||
ContactsContract.Data.CONTENT_URI,
|
||||
AsyncContactsLoader.PROJECTION,
|
||||
ContactsContract.Data.IN_DEFAULT_DIRECTORY
|
||||
+ " == 1 AND "
|
||||
+ ContactsContract.Data.CONTACT_ID
|
||||
+ " == "
|
||||
+ mAndroidId,
|
||||
null,
|
||||
null);
|
||||
Cursor c = null;
|
||||
try {
|
||||
c =
|
||||
context.getContentResolver()
|
||||
.query(
|
||||
ContactsContract.Data.CONTENT_URI,
|
||||
AsyncContactsLoader.PROJECTION,
|
||||
ContactsContract.Data.IN_DEFAULT_DIRECTORY
|
||||
+ " == 1 AND "
|
||||
+ ContactsContract.Data.CONTACT_ID
|
||||
+ " == "
|
||||
+ mAndroidId,
|
||||
null,
|
||||
null);
|
||||
} catch (SecurityException se) {
|
||||
Log.e("[Contact] Security exception: ", se);
|
||||
}
|
||||
|
||||
if (c != null) {
|
||||
mAddresses = new ArrayList<>();
|
||||
while (c.moveToNext()) {
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -198,7 +198,11 @@ public class NetworkSettingsFragment extends SettingsFragment {
|
|||
mPrefs.powerSaverDialogPrompted(true);
|
||||
Intent intent = DeviceUtils.getDevicePowerManagerIntent(getActivity());
|
||||
if (intent != null) {
|
||||
startActivity(intent);
|
||||
try {
|
||||
startActivity(intent);
|
||||
} catch (SecurityException se) {
|
||||
Log.e("[Network Settings] Security exception: ", se);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue