The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 1 | package com.android.settings; |
| 2 | |
Fan Zhang | c7162cd | 2018-06-18 15:21:41 -0700 | [diff] [blame] | 3 | import static com.android.internal.telephony.TelephonyIntents.SECRET_CODE_ACTION; |
| 4 | |
Jason Monk | 39b4674 | 2015-09-10 15:52:51 -0400 | [diff] [blame] | 5 | import android.content.BroadcastReceiver; |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 6 | import android.content.Context; |
| 7 | import android.content.Intent; |
Jason Monk | 39b4674 | 2015-09-10 15:52:51 -0400 | [diff] [blame] | 8 | |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 9 | import com.android.settings.Settings.TestingSettingsActivity; |
| 10 | |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 11 | |
| 12 | public class TestingSettingsBroadcastReceiver extends BroadcastReceiver { |
| 13 | |
| 14 | public TestingSettingsBroadcastReceiver() { |
| 15 | } |
| 16 | |
| 17 | @Override |
| 18 | public void onReceive(Context context, Intent intent) { |
| 19 | if (intent.getAction().equals(SECRET_CODE_ACTION)) { |
| 20 | Intent i = new Intent(Intent.ACTION_MAIN); |
Jason Monk | b7e4380 | 2016-06-06 16:01:58 -0400 | [diff] [blame] | 21 | i.setClass(context, TestingSettingsActivity.class); |
The Android Open Source Project | afc4ab2 | 2009-03-03 19:32:34 -0800 | [diff] [blame] | 22 | i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); |
| 23 | context.startActivity(i); |
| 24 | } |
| 25 | } |
| 26 | } |