blob: 7a1119c33abb3cb3a4a7a14f509df595f93cc820 [file] [log] [blame]
cretin45d4cea552016-04-25 11:00:04 -07001/*
2 * Copyright (C) 2016 The CyanogenMod Project
Oliver Scottf58c0f42024-01-08 14:52:12 -05003 * Copyright (C) 2017-2024 The LineageOS Project
cretin45d4cea552016-04-25 11:00:04 -07004 *
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 Bestasc83309e2018-02-03 17:42:13 +020018package org.lineageos.setupwizard;
cretin45d4cea552016-04-25 11:00:04 -070019
cretin45d4cea552016-04-25 11:00:04 -070020import android.content.Intent;
21import android.util.Log;
22
Michael Bestasc83309e2018-02-03 17:42:13 +020023import org.lineageos.setupwizard.util.SetupWizardUtils;
cretin45d4cea552016-04-25 11:00:04 -070024
Oliver Scottf58c0f42024-01-08 14:52:12 -050025public class BluetoothSetupActivity extends SubBaseActivity {
cretin45d4cea552016-04-25 11:00:04 -070026
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 Bestasb7b34b92021-08-25 19:13:30 +030038 intent.setComponent(SetupWizardUtils.sTvAddAccessorySettingsActivity);
cretin45d4cea552016-04-25 11:00:04 -070039 intent.setAction(ACTION_CONNECT_INPUT);
cretin45d4cea552016-04-25 11:00:04 -070040 intent.putExtra(INTENT_EXTRA_NO_INPUT_MODE, true);
Oliver Scottf58c0f42024-01-08 14:52:12 -050041 startSubactivity(intent);
cretin45d4cea552016-04-25 11:00:04 -070042 } catch (Exception e) {
43 Log.e(TAG, "Error starting bluetooth setup", e);
Oliver Scottf58c0f42024-01-08 14:52:12 -050044 finishAction(RESULT_OK);
cretin45d4cea552016-04-25 11:00:04 -070045 SetupWizardUtils.disableComponent(this, BluetoothSetupActivity.class);
cretin45d4cea552016-04-25 11:00:04 -070046 }
47 }
cretin45d4cea552016-04-25 11:00:04 -070048}