OSDN Git Service

Modify the deprecation of PhoneNumberUtil isEmergencyNumber
authorsqian <shuoq@google.com>
Tue, 2 Apr 2019 02:26:18 +0000 (19:26 -0700)
committersqian <shuoq@google.com>
Wed, 3 Apr 2019 19:55:18 +0000 (12:55 -0700)
commitc6d55453ee9a4c352be873eb73c4ec433be11faf
tree25acb5e16e1aa1a1791844762e07a2d8709e0010
parentd6ecaf064c70ae0c687251cbf52dfea4437b4011
Modify the deprecation of PhoneNumberUtil isEmergencyNumber

1) Telephony API is still called by a bunch of Util methods in Android that
don't have context, therefore the service can be null. Throwing an
 exception can cause crash.
2) Fix the usage of isEmergencyNumber and isPotentialEmergencyNumber.

Test: Manual
Fixes: 129721537
Change-Id: If82bfc5102a9ac1d7e07ff744c0775a1dc95ba2c
telephony/java/android/telephony/PhoneNumberUtils.java