Skip to content

Commit cc6491b

Browse files
author
alex-hermes-agent
committed
fix(v1.17): use raw int for RT-G2 YouTube button (268)
KEYCODE_YOUTUBE is not a real android.view.KeyEvent constant (build failed with 'Unresolved reference: KEYCODE_YOUTUBE'). The RT-G2 forensics (20.09) measured the dedicated YouTube button as raw keycode 268 and the Netflix/SmartTube button as 177 (= KEYCODE_MENU). Use raw ints for both, documented. KEYCODE_MENU (177) is a real named constant and stays named.
1 parent 1634faa commit cc6491b

1 file changed

Lines changed: 12 additions & 8 deletions

File tree

app/src/main/java/com/alexk/tvlock/PinActivity.kt

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,19 @@ class PinActivity : Activity() {
8989
if (!accepted) LockPollService.instance?.onGateDismissed()
9090
}
9191

92-
// Launch-shortcut class of the RT-G2 remote. 268 = KEYCODE_YOUTUBE (confirmed
93-
// storm key), 177 = the Netflix/SmartTube dedicated button (stock AOSP 177
94-
// = KEYCODE_MENU; forensics 20.09: relaunches the blocked app over the gate).
95-
// D-PAD / navigation-DPAD keys are deliberately NOT consumed — the PIN UI still
96-
// runs on the D-pad, 3×DPAD_UP within 2 s summons the hidden keypad, and
97-
// BACK hides it without leaving the screen.
92+
// Launch-shortcut class of the RT-G2 remote.
93+
// 268 = the dedicated YouTube button. There is NO public named constant for
94+
// it in android.view.KeyEvent (KEYCODE_YOUTUBE is not a real SDK symbol;
95+
// it is the raw int the button emits).
96+
// 177 = the dedicated Netflix/SmartTube button = KeyEvent.KEYCODE_MENU
97+
// (stock AOSP names 177 MENU; forensics 20.09: it relaunches the
98+
// blocked app over the gate).
99+
// DPAD / navigation-DPAD keys are deliberately NOT consumed — the PIN UI still
100+
// runs on the D-pad, 3×DPAD_UP within 2 s summons the hidden keypad, and BACK
101+
// hides it without leaving the screen.
98102
private val LAUNCH_SHORTCUTS: Set<Int> = setOf(
99-
KeyEvent.KEYCODE_YOUTUBE, // 268
100-
KeyEvent.KEYCODE_MENU, // 177 — RT-G2 Netflix/SmartTube button
103+
268, // RT-G2 YouTube button (raw keycode)
104+
KeyEvent.KEYCODE_MENU, // 177 — RT-G2 Netflix/SmartTube button
101105
)
102106

103107
private fun isShortcutLaunchKey(keyCode: Int): Boolean = LAUNCH_SHORTCUTS.contains(keyCode)

0 commit comments

Comments
 (0)