[DS] Correct the access method for telephony system property
Bug: 18675498 Review: https://partner-android-review.git.corp.google.com/#/c/198822 Change-Id: I7d6eab7d8f513de20bd8995b999a124097f725e7
This commit is contained in:
@@ -40,6 +40,7 @@ import android.preference.PreferenceGroup;
|
||||
import android.preference.PreferenceScreen;
|
||||
import android.provider.Telephony;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.Menu;
|
||||
@@ -132,7 +133,8 @@ public class ApnSettings extends SettingsPreferenceFragment implements
|
||||
public void onCreate(Bundle icicle) {
|
||||
super.onCreate(icicle);
|
||||
final Activity activity = getActivity();
|
||||
final int subId = activity.getIntent().getIntExtra("sub_id", -1);
|
||||
final int subId = activity.getIntent().getIntExtra("sub_id",
|
||||
SubscriptionManager.INVALID_SUBSCRIPTION_ID);
|
||||
|
||||
mUm = (UserManager) getSystemService(Context.USER_SERVICE);
|
||||
|
||||
@@ -287,7 +289,11 @@ public class ApnSettings extends SettingsPreferenceFragment implements
|
||||
}
|
||||
|
||||
private void addNewApn() {
|
||||
startActivity(new Intent(Intent.ACTION_INSERT, Telephony.Carriers.CONTENT_URI));
|
||||
Intent intent = new Intent(Intent.ACTION_INSERT, Telephony.Carriers.CONTENT_URI);
|
||||
int subId = mSubscriptionInfo != null ? mSubscriptionInfo.getSubscriptionId()
|
||||
: SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||
intent.putExtra("sub_id", subId);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user