From 5752b1b27bb261da979edc4cab81e0be6d3b5eca Mon Sep 17 00:00:00 2001 From: Bernardo Rufino Date: Tue, 9 Mar 2021 14:57:25 +0000 Subject: [PATCH] Remove collapsePanels() publicAlternatives Back when we added Intent.ACSD to publicAlternatives of collapsePanels() in ag/13035420, we didn't have the complete picture of which use-cases the Intent.ACSD would remain valid for and I thought there might still be 3p valid use-cases. Turns out cinek@ was right in that CL. After finished implementation, there are not 3p valid use-cases for Intent.ACSD anymore - this is explained in detail in ag/13331897 but TL;DR; for security reasons we're deprecating the intent and in S the platform will automatically be responsible for collapsing the shade where applicable. So, the result is that there are no public alternatives to collapsePanels() anymore and this is on purpose since having this capability lead to abuse. Test: Builds Bug: 159105552 Change-Id: I5ead6f83d19b00a27498a0ef42b6957667964644 --- core/java/android/app/StatusBarManager.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/java/android/app/StatusBarManager.java b/core/java/android/app/StatusBarManager.java index afcf63b0f1e23..1765849c8314d 100644 --- a/core/java/android/app/StatusBarManager.java +++ b/core/java/android/app/StatusBarManager.java @@ -331,10 +331,12 @@ public class StatusBarManager { * @hide */ @RequiresPermission(android.Manifest.permission.STATUS_BAR) - @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, publicAlternatives = "Send {@link " - + "android.content.Intent#ACTION_CLOSE_SYSTEM_DIALOGS} instead.") + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, publicAlternatives = "This operation" + + " is not allowed anymore, please see {@link android.content" + + ".Intent#ACTION_CLOSE_SYSTEM_DIALOGS} for more details.") @TestApi public void collapsePanels() { + try { final IStatusBarService svc = getService(); if (svc != null) {