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