aboutsummaryrefslogtreecommitdiff
path: root/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound
diff options
context:
space:
mode:
authorLujiang Xue <rogerxue@google.com>2017-12-18 13:05:10 -0800
committerLujiang Xue <rogerxue@google.com>2017-12-18 13:05:10 -0800
commitcf8948051141a022c34bc4d0c861cbb0143d985f (patch)
tree0e579b8c6d00b037cf25161d0d77f15edcf566f4 /tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound
parent91ff18c92b58c438347c1661d4a38f504a1d3c7c (diff)
downloadCar-cf8948051141a022c34bc4d0c861cbb0143d985f.tar.gz
temp turn off touch effect on boot
Bug: 68882625 Test: build, flash Change-Id: I20a13df33845a2d9eaa4e4a52389a3ce4e0e9078
Diffstat (limited to 'tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound')
-rw-r--r--tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound/DisableTouchSoundOnBoot.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound/DisableTouchSoundOnBoot.java b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound/DisableTouchSoundOnBoot.java
new file mode 100644
index 0000000000..2c81bdab2e
--- /dev/null
+++ b/tests/EmbeddedKitchenSinkApp/src/com/google/android/car/kitchensink/touchsound/DisableTouchSoundOnBoot.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2017 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.google.android.car.kitchensink.touchsound;
+
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.provider.Settings;
+import android.util.Log;
+
+/**
+ * Temp solution until b/68882625 is fixed
+ */
+public class DisableTouchSoundOnBoot extends BroadcastReceiver {
+
+ private static final String KEY_TOUCH_SOUNDS = "sound_effects_enabled";
+
+ @Override
+ public void onReceive(Context context, Intent intent) {
+ Log.w("DisableTouchSoundOnBoot", "disabling touch sound");
+ Settings.System.putInt(context.getContentResolver(), KEY_TOUCH_SOUNDS, 0);
+ }
+}