Loading services/core/java/com/android/server/vibrator/VendorVibrationSession.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import java.util.NoSuchElementException; final class VendorVibrationSession extends IVibrationSession.Stub implements VibrationSession, CancellationSignal.OnCancelListener, IBinder.DeathRecipient { private static final String TAG = "VendorVibrationSession"; private static final boolean DEBUG = false; // To enable these logs, run: // 'adb shell setprop persist.log.tag.VendorVibrationSession DEBUG && adb reboot' private static final boolean DEBUG = VibratorDebugUtils.isDebuggable(TAG); /** Calls into VibratorManager functionality needed for playing an {@link ExternalVibration}. */ interface VibratorManagerHooks { Loading services/core/java/com/android/server/vibrator/VibrationThread.java +3 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,9 @@ import java.util.Objects; /** Plays a {@link HalVibration} in dedicated thread. */ final class VibrationThread extends Thread { static final String TAG = "VibrationThread"; static final boolean DEBUG = false; // To enable these logs, run: // 'adb shell setprop persist.log.tag.VibrationThread DEBUG && adb reboot' static final boolean DEBUG = VibratorDebugUtils.isDebuggable(TAG); /** Calls into VibratorManager functionality needed for playing a {@link HalVibration}. */ interface VibratorManagerHooks { Loading services/core/java/com/android/server/vibrator/VibratorDebugUtils.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.vibrator; import android.util.Log; class VibratorDebugUtils { /** * Checks if debugging is enabled for the specified tag or globally. * * <p>To enable debugging:<br> * {@code adb shell setprop persist.log.tag.Vibrator_All DEBUG}<br> * To disable debugging:<br> * {@code adb shell setprop persist.log.tag.Vibrator_All \"\" } * * @param tag The tag to check for debugging. Use the tag name from the calling class. * @return True if debugging is enabled for the tag or globally (Vibrator_All), false otherwise. */ public static boolean isDebuggable(String tag) { return Log.isLoggable(tag, Log.DEBUG) || Log.isLoggable("Vibrator_All", Log.DEBUG); } } services/core/java/com/android/server/vibrator/VibratorManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,9 @@ public class VibratorManagerService extends IVibratorManagerService.Stub { private static final String EXTERNAL_VIBRATOR_SERVICE = "external_vibrator_service"; private static final String VIBRATOR_CONTROL_SERVICE = "android.frameworks.vibrator.IVibratorControlService/default"; private static final boolean DEBUG = false; // To enable these logs, run: // 'adb shell setprop persist.log.tag.VibratorManagerService DEBUG && adb reboot' private static final boolean DEBUG = VibratorDebugUtils.isDebuggable(TAG); private static final VibrationAttributes DEFAULT_ATTRIBUTES = new VibrationAttributes.Builder().build(); private static final int ATTRIBUTES_ALL_BYPASS_FLAGS = Loading Loading
services/core/java/com/android/server/vibrator/VendorVibrationSession.java +3 −1 Original line number Diff line number Diff line Loading @@ -51,7 +51,9 @@ import java.util.NoSuchElementException; final class VendorVibrationSession extends IVibrationSession.Stub implements VibrationSession, CancellationSignal.OnCancelListener, IBinder.DeathRecipient { private static final String TAG = "VendorVibrationSession"; private static final boolean DEBUG = false; // To enable these logs, run: // 'adb shell setprop persist.log.tag.VendorVibrationSession DEBUG && adb reboot' private static final boolean DEBUG = VibratorDebugUtils.isDebuggable(TAG); /** Calls into VibratorManager functionality needed for playing an {@link ExternalVibration}. */ interface VibratorManagerHooks { Loading
services/core/java/com/android/server/vibrator/VibrationThread.java +3 −1 Original line number Diff line number Diff line Loading @@ -36,7 +36,9 @@ import java.util.Objects; /** Plays a {@link HalVibration} in dedicated thread. */ final class VibrationThread extends Thread { static final String TAG = "VibrationThread"; static final boolean DEBUG = false; // To enable these logs, run: // 'adb shell setprop persist.log.tag.VibrationThread DEBUG && adb reboot' static final boolean DEBUG = VibratorDebugUtils.isDebuggable(TAG); /** Calls into VibratorManager functionality needed for playing a {@link HalVibration}. */ interface VibratorManagerHooks { Loading
services/core/java/com/android/server/vibrator/VibratorDebugUtils.java 0 → 100644 +37 −0 Original line number Diff line number Diff line /* * Copyright (C) 2025 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.server.vibrator; import android.util.Log; class VibratorDebugUtils { /** * Checks if debugging is enabled for the specified tag or globally. * * <p>To enable debugging:<br> * {@code adb shell setprop persist.log.tag.Vibrator_All DEBUG}<br> * To disable debugging:<br> * {@code adb shell setprop persist.log.tag.Vibrator_All \"\" } * * @param tag The tag to check for debugging. Use the tag name from the calling class. * @return True if debugging is enabled for the tag or globally (Vibrator_All), false otherwise. */ public static boolean isDebuggable(String tag) { return Log.isLoggable(tag, Log.DEBUG) || Log.isLoggable("Vibrator_All", Log.DEBUG); } }
services/core/java/com/android/server/vibrator/VibratorManagerService.java +3 −1 Original line number Diff line number Diff line Loading @@ -108,7 +108,9 @@ public class VibratorManagerService extends IVibratorManagerService.Stub { private static final String EXTERNAL_VIBRATOR_SERVICE = "external_vibrator_service"; private static final String VIBRATOR_CONTROL_SERVICE = "android.frameworks.vibrator.IVibratorControlService/default"; private static final boolean DEBUG = false; // To enable these logs, run: // 'adb shell setprop persist.log.tag.VibratorManagerService DEBUG && adb reboot' private static final boolean DEBUG = VibratorDebugUtils.isDebuggable(TAG); private static final VibrationAttributes DEFAULT_ATTRIBUTES = new VibrationAttributes.Builder().build(); private static final int ATTRIBUTES_ALL_BYPASS_FLAGS = Loading