Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 333aba77 authored by Chris Göllner's avatar Chris Göllner
Browse files

Shortcut Helper - Go to physical keyboard settings when button clicked

Flag: com.android.systemui.keyboard_shortcut_helper_rewrite
Test: Manual
Fixes: 346982933
Change-Id: Ia60435381a3efc7e764ec80f15c3707dae4e90e9
parent 64e23d81
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -16,8 +16,11 @@

package com.android.systemui.keyboard.shortcut.ui.view

import android.content.ActivityNotFoundException
import android.content.Intent
import android.graphics.Insets
import android.os.Bundle
import android.provider.Settings
import android.view.View
import android.view.WindowInsets
import androidx.activity.BackEventCompat
@@ -83,7 +86,15 @@ constructor(
        }
    }

    private fun onKeyboardSettingsClicked() {}
    private fun onKeyboardSettingsClicked() {
        try {
            startActivity(Intent(Settings.ACTION_HARD_KEYBOARD_SETTINGS))
        } catch (e: ActivityNotFoundException) {
            // From the Settings docs: In some cases, a matching Activity may not exist, so ensure
            // you safeguard against this.
            e.printStackTrace()
        }
    }

    override fun onDestroy() {
        super.onDestroy()