resolve merge conflicts of 5213f71 to nyc-dev-plus-aosp am: d2477357e8

am: 198b92d037

* commit '198b92d0374982030d694ee1f941a3ee98714606':
  Fix APN cannot save after ApnEditor is paused.

Change-Id: I34f602abab2f3e2e63124e642ee65675de061a4d
This commit is contained in:
Amit Mahajan
2016-04-19 23:28:47 +00:00
committed by android-build-merger

View File

@@ -262,6 +262,21 @@ public class ApnEditor extends InstrumentedPreferenceActivity
@Override
public void onResume() {
super.onResume();
if (mUri == null && mNewApn) {
// The URI could have been deleted when activity is paused,
// therefore, it needs to be restored.
mUri = getContentResolver().insert(getIntent().getData(), new ContentValues());
if (mUri == null) {
Log.w(TAG, "Failed to insert new telephony provider into "
+ getIntent().getData());
finish();
return;
}
mCursor = managedQuery(mUri, sProjection, null, null);
mCursor.moveToFirst();
}
}
@Override
@@ -608,6 +623,7 @@ public class ApnEditor extends InstrumentedPreferenceActivity
// If it's a new APN and a name or apn haven't been entered, then erase the entry
if (force && mNewApn && name.length() < 1 && apn.length() < 1) {
getContentResolver().delete(mUri, null, null);
mUri = null;
return false;
}