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

Commit aafabbab authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix sim pin settings" into nyc-dev

parents fd918873 5b39710e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -46,8 +46,8 @@
            android:layout_width="0dip"
            android:layout_height="0dip" />

        <ListView
            android:id="@android:id/list"
        <FrameLayout
            android:id="@+id/main_content"
            android:layout_width="match_parent"
            android:layout_height="0dip"
            android:layout_weight="1"
+1 −1
Original line number Diff line number Diff line
@@ -50,7 +50,7 @@ class EditPinPreference extends CustomEditTextPreference {
    protected void onBindDialogView(View view) {
        super.onBindDialogView(view);

        final EditText editText = getEditText();
        final EditText editText = (EditText) view.findViewById(android.R.id.edit);

        if (editText != null) {
            editText.setInputType(InputType.TYPE_CLASS_NUMBER |
+3 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import android.os.Handler;
import android.os.Message;
import android.support.v14.preference.SwitchPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;
import android.telephony.SubscriptionInfo;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
@@ -40,7 +39,6 @@ import android.widget.TabHost.TabContentFactory;
import android.widget.TabHost.TabSpec;
import android.widget.TabWidget;
import android.widget.Toast;

import com.android.internal.logging.MetricsProto.MetricsEvent;
import com.android.internal.telephony.Phone;
import com.android.internal.telephony.PhoneFactory;
@@ -340,6 +338,7 @@ public class IccLockSettings extends InstrumentedPreferenceActivity
        mPinDialog.setDialogMessage(message);
    }

    @Override
    public void onPinEntered(EditPinPreference preference, boolean positiveResult) {
        if (!positiveResult) {
            resetDialogState();
@@ -384,7 +383,8 @@ public class IccLockSettings extends InstrumentedPreferenceActivity
        }
    }

    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
    @Override
    public boolean onPreferenceTreeClick(Preference preference) {
        if (preference == mPinToggle) {
            // Get the new, preferred state
            mToState = mPinToggle.isChecked();
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@ public abstract class InstrumentedFragment extends PreferenceFragment {
    // Declare new temporary categories here, starting after this value.
    public static final int UNDECLARED = 100000;

    // Used by PreferenceActivity for the dummy fragment it adds, no useful data here.
    public static final int PREFERENCE_ACTIVITY_FRAGMENT = UNDECLARED + 1;

    /**
     * Declare the view of this category.
     *
+9 −2
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ package com.android.settings;

import android.annotation.Nullable;
import android.os.Bundle;
import android.support.v14.preference.PreferenceFragment;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceScreen;

@@ -57,7 +56,7 @@ public class PreferenceActivity extends SettingsActivity {
                || PreferenceActivityFragment.class.getName().equals(fragmentName);
    }

    public static class PreferenceActivityFragment extends PreferenceFragment {
    public static class PreferenceActivityFragment extends SettingsPreferenceFragment {
        @Override
        public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
            ((PreferenceActivity) getActivity()).mFragment = this;
@@ -70,6 +69,14 @@ public class PreferenceActivity extends SettingsActivity {
            }
            return super.onPreferenceTreeClick(preference);
        }

        @Override
        protected int getMetricsCategory() {
            if (getActivity() instanceof InstrumentedPreferenceActivity) {
                return ((InstrumentedPreferenceActivity) getActivity()).getMetricsCategory();
            }
            return InstrumentedFragment.PREFERENCE_ACTIVITY_FRAGMENT;
        }
    }

}