diff options
Diffstat (limited to 'telephony/java/android')
-rw-r--r-- | telephony/java/android/telephony/PhoneNumberUtils.java | 16 | ||||
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 8 |
2 files changed, 17 insertions, 7 deletions
diff --git a/telephony/java/android/telephony/PhoneNumberUtils.java b/telephony/java/android/telephony/PhoneNumberUtils.java index d18b86a..79146f3 100644 --- a/telephony/java/android/telephony/PhoneNumberUtils.java +++ b/telephony/java/android/telephony/PhoneNumberUtils.java @@ -177,15 +177,19 @@ public class PhoneNumberUtils phoneColumn = ContactsContract.CommonDataKinds.Phone.NUMBER; } - final Cursor c = context.getContentResolver().query(uri, new String[] { - phoneColumn - }, null, null, null); - if (c != null) { - try { + Cursor c = null; + try { + c = context.getContentResolver().query(uri, new String[] { phoneColumn }, + null, null, null); + if (c != null) { if (c.moveToFirst()) { number = c.getString(c.getColumnIndex(phoneColumn)); } - } finally { + } + } catch (RuntimeException e) { + Rlog.e(LOG_TAG, "Error getting phone number.", e); + } finally { + if (c != null) { c.close(); } } diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 89e9d2e..0bb04f8 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -4230,7 +4230,7 @@ public class TelephonyManager { } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#canChangeDtmfToneLength", e); } catch (SecurityException e) { - Log.w(TAG, "Permission error calling ITelephony#canChangeDtmfToneLength", e); + Log.e(TAG, "Permission error calling ITelephony#canChangeDtmfToneLength", e); } return false; } @@ -4248,6 +4248,8 @@ public class TelephonyManager { } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isWorldPhone", e); + } catch (SecurityException e) { + Log.e(TAG, "Permission error calling ITelephony#isWorldPhone", e); } return false; } @@ -4265,6 +4267,8 @@ public class TelephonyManager { } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isTtyModeSupported", e); + } catch (SecurityException e) { + Log.e(TAG, "Permission error calling ITelephony#isTtyModeSupported", e); } return false; } @@ -4283,6 +4287,8 @@ public class TelephonyManager { } } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#isHearingAidCompatibilitySupported", e); + } catch (SecurityException e) { + Log.e(TAG, "Permission error calling ITelephony#isHearingAidCompatibilitySupported", e); } return false; } |