From 5d9ffb0115abbc1da8ef8ac003ccda6e5ae4971a Mon Sep 17 00:00:00 2001 From: Bryan Roscoe Date: Fri, 8 May 2026 17:52:25 -0500 Subject: [PATCH 1/2] Warn when launcher wizard finds Live Channels Provider disabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit After Setup-Launcher finishes its set-default flow, Test-ChannelDependencies checks whether com.android.providers.tv is in the disabled list. If so, the new launcher will appear with an empty Watch Next / Continue Watching row regardless of which streaming apps are installed — because the TvProvider is the system content provider every app uses to publish those entries. Surfaces a warning explaining the consequence and offers to re-enable the provider in place. Avoids the silent state Bryan hit in real life: provider disabled from a previous session, switch launcher, can't figure out why Apple TV's Continue Watching is empty. No effect on the launcher swap itself; runs only after the launcher has been set up successfully. --- Shield-Optimizer.ps1 | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/Shield-Optimizer.ps1 b/Shield-Optimizer.ps1 index 1b875a6..5fbe635 100644 --- a/Shield-Optimizer.ps1 +++ b/Shield-Optimizer.ps1 @@ -3069,6 +3069,35 @@ function Setup-Launcher ($Target) { Write-Host $Script:LastSetHomeError -ForegroundColor $Script:Colors.TextDim } } + + Test-ChannelDependencies -Target $Target +} + +# Check if com.android.providers.tv is disabled. Without it, no app can +# publish Watch Next / Continue Watching channels — Apple TV, Netflix, +# Disney+, etc. silently lose their channel rows. Offer to re-enable. +function Test-ChannelDependencies ($Target) { + $disabled = & $Script:AdbPath -s $Target shell "pm list packages -d" 2>&1 | Out-String + if (-not (Test-PackageInList -PackageList $disabled -Package "com.android.providers.tv")) { + return + } + + Write-Host "" + Write-Warn "Live Channels Provider (com.android.providers.tv) is disabled." + Write-Host " Without it, apps can't publish Watch Next / Continue Watching" -ForegroundColor $Script:Colors.TextDim + Write-Host " channels. Apple TV, Netflix, Disney+, etc. rows on your" -ForegroundColor $Script:Colors.TextDim + Write-Host " launcher's home screen will be empty." -ForegroundColor $Script:Colors.TextDim + Write-Host "" + + $idx = Read-Toggle -Prompt "Re-enable Live Channels Provider?" -Options @("YES", "NO") -DefaultIndex 0 + if ($idx -eq 0) { + $r = Invoke-AdbCommand -Target $Target -Command "pm enable com.android.providers.tv" + if ($r.Success) { + Write-Success "Re-enabled. Open Apple TV (or any channel-publishing app) once to repopulate." + } else { + Write-ErrorMsg "Failed to re-enable: $($r.Error)" + } + } } # Helper to show task summary (used for completion and abort) From d55001713dad41f20e4b4301e8b7203391a99a9e Mon Sep 17 00:00:00 2001 From: Bryan Roscoe Date: Tue, 19 May 2026 12:30:45 -0500 Subject: [PATCH 2/2] Move channel-dependency check to cover all launcher exit paths MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Review caught that placing Test-ChannelDependencies at the very end of Setup-Launcher only fires on the "default launcher set successfully" path. The already-active, stock-fallback, and various decline/abort paths all skipped it — even though the TvProvider dependency is just as relevant on those branches. Moved the call to immediately after the disabled-packages snapshot at the top of Setup-Launcher so every custom-launcher exit path benefits. Test-ChannelDependencies now accepts the already-fetched `pm list packages -d` blob via an optional -DisabledPackages parameter, avoiding a redundant ADB roundtrip. --- Shield-Optimizer.ps1 | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/Shield-Optimizer.ps1 b/Shield-Optimizer.ps1 index 5fbe635..a2e0a38 100644 --- a/Shield-Optimizer.ps1 +++ b/Shield-Optimizer.ps1 @@ -2879,6 +2879,13 @@ function Setup-Launcher ($Target) { $installedPkgs = (& $Script:AdbPath -s $Target shell pm list packages 2>&1 | Out-String) $disabledPkgs = (& $Script:AdbPath -s $Target shell pm list packages -d 2>&1 | Out-String) + # If com.android.providers.tv is disabled, warn before the wizard branches — + # every custom-launcher exit path (set-default, already-active, stock-fallback) + # leaves the user with a launcher whose Watch Next row will be empty until + # the provider is re-enabled. Doing this here covers all paths; doing it at + # the end of the function only covers the success path. + Test-ChannelDependencies -Target $Target -DisabledPackages $disabledPkgs + # Detect the currently active launcher $currentLauncher = Get-CurrentLauncher -Target $Target if ($currentLauncher) { @@ -3069,15 +3076,17 @@ function Setup-Launcher ($Target) { Write-Host $Script:LastSetHomeError -ForegroundColor $Script:Colors.TextDim } } - - Test-ChannelDependencies -Target $Target } # Check if com.android.providers.tv is disabled. Without it, no app can # publish Watch Next / Continue Watching channels — Apple TV, Netflix, # Disney+, etc. silently lose their channel rows. Offer to re-enable. -function Test-ChannelDependencies ($Target) { - $disabled = & $Script:AdbPath -s $Target shell "pm list packages -d" 2>&1 | Out-String +# Accepts the already-fetched `pm list packages -d` blob to avoid a duplicate +# ADB roundtrip when the caller already has it (Setup-Launcher does). +function Test-ChannelDependencies ($Target, $DisabledPackages = $null) { + $disabled = if ($DisabledPackages) { $DisabledPackages } else { + & $Script:AdbPath -s $Target shell "pm list packages -d" 2>&1 | Out-String + } if (-not (Test-PackageInList -PackageList $disabled -Package "com.android.providers.tv")) { return }