@@ -136,7 +136,8 @@ public void putRecoveryAction(int action) {
136136 private static final String INTENT_DATA_STALL_ALARM =
137137 "com.android.internal.telephony.gprs-data-stall" ;
138138
139- static final Uri PREFERAPN_URI = Uri .parse ("content://telephony/carriers/preferapn" );
139+ static final Uri PREFERAPN_NO_UPDATE_URI =
140+ Uri .parse ("content://telephony/carriers/preferapn_no_update" );
140141 static final String APN_ID = "apn_id" ;
141142 private boolean canSetPreferApn = false ;
142143
@@ -2357,26 +2358,30 @@ private void startDelayedRetry(GsmDataConnection.FailCause cause,
23572358
23582359 private void setPreferredApn (int pos ) {
23592360 if (!canSetPreferApn ) {
2361+ log ("setPreferredApn: X !canSEtPreferApn" );
23602362 return ;
23612363 }
23622364
2365+ log ("setPreferredApn: delete" );
23632366 ContentResolver resolver = mPhone .getContext ().getContentResolver ();
2364- resolver .delete (PREFERAPN_URI , null , null );
2367+ resolver .delete (PREFERAPN_NO_UPDATE_URI , null , null );
23652368
23662369 if (pos >= 0 ) {
2370+ log ("setPreferredApn: insert" );
23672371 ContentValues values = new ContentValues ();
23682372 values .put (APN_ID , pos );
2369- resolver .insert (PREFERAPN_URI , values );
2373+ resolver .insert (PREFERAPN_NO_UPDATE_URI , values );
23702374 }
23712375 }
23722376
23732377 private ApnSetting getPreferredApn () {
23742378 if (mAllApns .isEmpty ()) {
2379+ log ("getPreferredApn: X not found mAllApns.isEmpty" );
23752380 return null ;
23762381 }
23772382
23782383 Cursor cursor = mPhone .getContext ().getContentResolver ().query (
2379- PREFERAPN_URI , new String [] { "_id" , "name" , "apn" },
2384+ PREFERAPN_NO_UPDATE_URI , new String [] { "_id" , "name" , "apn" },
23802385 null , null , Telephony .Carriers .DEFAULT_SORT_ORDER );
23812386
23822387 if (cursor != null ) {
@@ -2391,6 +2396,7 @@ private ApnSetting getPreferredApn() {
23912396 pos = cursor .getInt (cursor .getColumnIndexOrThrow (Telephony .Carriers ._ID ));
23922397 for (ApnSetting p :mAllApns ) {
23932398 if (p .id == pos && p .canHandleType (mRequestedApnType )) {
2399+ log ("getPreferredApn: X found apnSetting" + p );
23942400 cursor .close ();
23952401 return p ;
23962402 }
@@ -2401,6 +2407,7 @@ private ApnSetting getPreferredApn() {
24012407 cursor .close ();
24022408 }
24032409
2410+ log ("getPreferredApn: X not found" );
24042411 return null ;
24052412 }
24062413
0 commit comments