Merge "Repoint ACTION_SECRET_CODE + ACTION_SIM_STATE_CHANGED"
This commit is contained in:
committed by
Android (Google) Code Review
commit
4d6527e063
@@ -51,7 +51,6 @@ import android.widget.Toast;
|
|||||||
import androidx.preference.Preference;
|
import androidx.preference.Preference;
|
||||||
import androidx.preference.SwitchPreference;
|
import androidx.preference.SwitchPreference;
|
||||||
|
|
||||||
import com.android.internal.telephony.TelephonyIntents;
|
|
||||||
import com.android.settings.network.ProxySubscriptionManager;
|
import com.android.settings.network.ProxySubscriptionManager;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -143,7 +142,7 @@ public class IccLockSettings extends SettingsPreferenceFragment
|
|||||||
private final BroadcastReceiver mSimStateReceiver = new BroadcastReceiver() {
|
private final BroadcastReceiver mSimStateReceiver = new BroadcastReceiver() {
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
final String action = intent.getAction();
|
final String action = intent.getAction();
|
||||||
if (TelephonyIntents.ACTION_SIM_STATE_CHANGED.equals(action)) {
|
if (Intent.ACTION_SIM_STATE_CHANGED.equals(action)) {
|
||||||
mHandler.sendMessage(mHandler.obtainMessage(MSG_SIM_STATE_CHANGED));
|
mHandler.sendMessage(mHandler.obtainMessage(MSG_SIM_STATE_CHANGED));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,7 +292,7 @@ public class IccLockSettings extends SettingsPreferenceFragment
|
|||||||
|
|
||||||
// ACTION_SIM_STATE_CHANGED is sticky, so we'll receive current state after this call,
|
// ACTION_SIM_STATE_CHANGED is sticky, so we'll receive current state after this call,
|
||||||
// which will call updatePreferences().
|
// which will call updatePreferences().
|
||||||
final IntentFilter filter = new IntentFilter(TelephonyIntents.ACTION_SIM_STATE_CHANGED);
|
final IntentFilter filter = new IntentFilter(Intent.ACTION_SIM_STATE_CHANGED);
|
||||||
getContext().registerReceiver(mSimStateReceiver, filter);
|
getContext().registerReceiver(mSimStateReceiver, filter);
|
||||||
|
|
||||||
if (mDialogState != OFF_MODE) {
|
if (mDialogState != OFF_MODE) {
|
||||||
|
@@ -1,22 +1,21 @@
|
|||||||
package com.android.settings;
|
package com.android.settings;
|
||||||
|
|
||||||
import static com.android.internal.telephony.TelephonyIntents.SECRET_CODE_ACTION;
|
|
||||||
|
|
||||||
import android.content.BroadcastReceiver;
|
import android.content.BroadcastReceiver;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
|
|
||||||
import com.android.settings.Settings.TestingSettingsActivity;
|
import com.android.settings.Settings.TestingSettingsActivity;
|
||||||
|
|
||||||
|
|
||||||
public class TestingSettingsBroadcastReceiver extends BroadcastReceiver {
|
public class TestingSettingsBroadcastReceiver extends BroadcastReceiver {
|
||||||
|
|
||||||
public TestingSettingsBroadcastReceiver() {
|
public TestingSettingsBroadcastReceiver() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onReceive(Context context, Intent intent) {
|
public void onReceive(Context context, Intent intent) {
|
||||||
if (intent.getAction().equals(SECRET_CODE_ACTION)) {
|
if (intent.getAction().equals(TelephonyManager.ACTION_SECRET_CODE)) {
|
||||||
Intent i = new Intent(Intent.ACTION_MAIN);
|
Intent i = new Intent(Intent.ACTION_MAIN);
|
||||||
i.setClass(context, TestingSettingsActivity.class);
|
i.setClass(context, TestingSettingsActivity.class);
|
||||||
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
|
Reference in New Issue
Block a user