Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 787a6bb1 authored by kaiyiz's avatar kaiyiz Committed by Gerrit - the friendly Code Review server
Browse files

Gallery2: Set APN setting intent's name

The APN setting activity's name is changed, so there will be no result
after tap prefered APN.

Start intent with ACTION_APN_SETTINGS from settings.

CRs-Fixed: 777155

Change-Id: Ibb560612ad5a6748c13319ed9436ad473759e3c1
parent c300a39b
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -286,22 +286,19 @@ public class SettingsActivity extends PreferenceActivity {
    }
    
    private void setApnListener() {
        final String CLASS_NAME    = "com.android.settings.ApnSettings";
        final String SUBSCRIPTION_KEY = "subscription";

        mApn.setSummary(getDefaultApnName());
        mApn.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
            public boolean onPreferenceClick(Preference preference) {
                Intent intent = new Intent();
                intent.setClassName(PACKAGE_NAME, CLASS_NAME);

                Intent intent = new Intent(Settings.ACTION_APN_SETTINGS);
                int subscription = 0;
                try {
                    subscription = Settings.Global.getInt(SettingsActivity.this.getContentResolver(),
                            Settings.Global.MULTI_SIM_DATA_CALL_SUBSCRIPTION);
                    intent.putExtra(SUBSCRIPTION_KEY, subscription);
                } catch (Exception e) {
                    Log.d("SettingActivity", "Can't get subscription for Exception" + e);
                    Log.d("SettingActivity", "Can't get subscription for Exception: " + e);
                } finally {
                    intent.putExtra(SUBSCRIPTION_KEY, subscription);
                }
                startActivityForResult(intent, SELECT_APN);
                return true;