| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 The CyanogenMod Project |
| Oliver Scott | f58c0f4 | 2024-01-08 14:52:12 -0500 | [diff] [blame^] | 3 | * Copyright (C) 2017-2024 The LineageOS Project |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 4 | * |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | * you may not use this file except in compliance with the License. |
| 7 | * You may obtain a copy of the License at |
| 8 | * |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | * |
| 11 | * Unless required by applicable law or agreed to in writing, software |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | * See the License for the specific language governing permissions and |
| 15 | * limitations under the License. |
| 16 | */ |
| 17 | |
| Michael Bestas | c83309e | 2018-02-03 17:42:13 +0200 | [diff] [blame] | 18 | package org.lineageos.setupwizard; |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 19 | |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 20 | import android.content.Intent; |
| 21 | import android.util.Log; |
| 22 | |
| Michael Bestas | c83309e | 2018-02-03 17:42:13 +0200 | [diff] [blame] | 23 | import org.lineageos.setupwizard.util.SetupWizardUtils; |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 24 | |
| Oliver Scott | f58c0f4 | 2024-01-08 14:52:12 -0500 | [diff] [blame^] | 25 | public class BluetoothSetupActivity extends SubBaseActivity { |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 26 | |
| 27 | public static final String TAG = BluetoothSetupActivity.class.getSimpleName(); |
| 28 | |
| 29 | private static final String ACTION_CONNECT_INPUT = |
| 30 | "com.google.android.intent.action.CONNECT_INPUT"; |
| 31 | |
| 32 | private static final String INTENT_EXTRA_NO_INPUT_MODE = "no_input_mode"; |
| 33 | |
| 34 | @Override |
| 35 | protected void onStartSubactivity() { |
| 36 | try { |
| 37 | Intent intent = new Intent(); |
| Michael Bestas | b7b34b9 | 2021-08-25 19:13:30 +0300 | [diff] [blame] | 38 | intent.setComponent(SetupWizardUtils.sTvAddAccessorySettingsActivity); |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 39 | intent.setAction(ACTION_CONNECT_INPUT); |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 40 | intent.putExtra(INTENT_EXTRA_NO_INPUT_MODE, true); |
| Oliver Scott | f58c0f4 | 2024-01-08 14:52:12 -0500 | [diff] [blame^] | 41 | startSubactivity(intent); |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 42 | } catch (Exception e) { |
| 43 | Log.e(TAG, "Error starting bluetooth setup", e); |
| Oliver Scott | f58c0f4 | 2024-01-08 14:52:12 -0500 | [diff] [blame^] | 44 | finishAction(RESULT_OK); |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 45 | SetupWizardUtils.disableComponent(this, BluetoothSetupActivity.class); |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 46 | } |
| 47 | } |
| cretin45 | d4cea55 | 2016-04-25 11:00:04 -0700 | [diff] [blame] | 48 | } |