diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java old mode 100755 new mode 100644 index fb2d2ee08cbda..84868f58d9227 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDevice.java @@ -1125,6 +1125,16 @@ abstract class HdmiCecLocalDevice { removeActionExcept(clazz, null); } + // Remove all running actions. + @ServiceThreadOnly + void removeAllActions() { + assertRunOnServiceThread(); + for (HdmiCecFeatureAction action : mActions) { + action.finish(false); + } + mActions.clear(); + } + // Remove all actions matched with the given Class type besides |exception|. @ServiceThreadOnly void removeActionExcept( diff --git a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java index 32ff5e2208254..a46dd0460d3b3 100644 --- a/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java +++ b/services/core/java/com/android/server/hdmi/HdmiCecLocalDeviceAudioSystem.java @@ -229,6 +229,14 @@ public class HdmiCecLocalDeviceAudioSystem extends HdmiCecLocalDeviceSource { super.disableDevice(initiatedByCec, callback); assertRunOnServiceThread(); mService.unregisterTvInputCallback(mTvInputCallback); + // Removing actions and invoking the callback is similar to + // HdmiCecLocalDevicePlayback#disableDevice and HdmiCecLocalDeviceTv#disableDevice, + // with the difference that in those classes only specific actions are removed and + // here we remove all actions. We don't expect any issues with removing all actions + // at this time, but we have to pay attention in the future. + removeAllActions(); + // Call the callback instantly or else it will be called 5 seconds later. + checkIfPendingActionsCleared(); } @Override diff --git a/services/proguard.flags b/services/proguard.flags index 4c2830e5c447d..85d05afdccc68 100644 --- a/services/proguard.flags +++ b/services/proguard.flags @@ -42,19 +42,6 @@ -keep,allowoptimization,allowaccessmodification class * extends android.os.IInterface -keep,allowoptimization,allowaccessmodification class * extends android.os.IHwInterface -# Global entities normally kept through explicit Manifest entries -# TODO(b/210510433): Revisit and consider generating from frameworks/base/core/res/AndroidManifest.xml, -# by including that manifest with the library rule that triggers optimization. --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.Activity --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.Service --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.app.backup.BackupAgent --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.content.BroadcastReceiver --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.content.ContentProvider --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.preference.Preference --keep,allowoptimization,allowaccessmodification class com.android.server.** extends android.view.View { - public (...); -} - # Various classes subclassed in or referenced via JNI in ethernet-service -keep public class android.net.** { *; } -keep,allowoptimization,allowaccessmodification class com.android.net.module.util.* { *; }