OSDN Git Service

Fix the crash when editing or deleting APN.
authoryuemingw <yuemingw@google.com>
Tue, 23 Jan 2018 18:58:38 +0000 (18:58 +0000)
committeryuemingw <yuemingw@google.com>
Tue, 23 Jan 2018 20:57:08 +0000 (20:57 +0000)
commitdb9a9bb0b0438816909e002156cb7322c66a0d28
tree26524349da265a0469ffafffb7cfc81d63b0390d
parent06af7c8d4bea5c4d5606ee624cf6498e67340e14
Fix the crash when editing or deleting APN.

Previously ApnPrefence starts an intent with URI content://telephony/carrier/filtered/id,
this URI is only implemented in telephony provider for query(), but not
for delete() or update(). This caused the crash when user tries to
update or delete an APN through this URI.

We should let ApnPrefence starts an intent with URI content://telephony/carrier/id, which
is a general telephony URI and all of query() add() delete() update() are implemented for
non-DPC mode. And let ApnPrefence starts an intent with URI content://telephony/carrier/filtered/id
in DPC mode(as the general URI can't access DPC-owned APN), when only DPC-owned APNs are
presented to user. In the DPC mode, user can't update, add or delete an APN, they can
only view(query) the APN, so it won't crash with URI_FILTERED.

Bug: 72387301
Test: manual. Tried update, delete, and add action in Access Point Name page, no crash occurs. Instrumentation test will be added in b/72154761.
Change-Id: I9979cbffcc94a37b2bd96db766ececd0ac7b20e2
src/com/android/settings/ApnPreference.java
src/com/android/settings/ApnSettings.java