RM6785: vibrator: Only handle actually supported effects
* Let framework handle the other ones
Change-Id: Ib8bf299a417d82fe6196e1b071b5a7b2f9c3e5d8
diff --git a/aidl/vibrator/Vibrator.cpp b/aidl/vibrator/Vibrator.cpp
index a284814..8200522 100644
--- a/aidl/vibrator/Vibrator.cpp
+++ b/aidl/vibrator/Vibrator.cpp
@@ -97,39 +97,12 @@
case Effect::CLICK:
timeoutMs = 70;
break;
- case Effect::DOUBLE_CLICK:
- timeoutMs = 50;
- activate(timeoutMs);
- usleep(150000);
- break;
- case Effect::TICK:
- case Effect::THUD:
- case Effect::POP:
- timeoutMs = 80;
- break;
- case Effect::HEAVY_CLICK:
- timeoutMs = 90;
- break;
- case Effect::RINGTONE_1:
- case Effect::RINGTONE_2:
- case Effect::RINGTONE_3:
- case Effect::RINGTONE_4:
- case Effect::RINGTONE_5:
- case Effect::RINGTONE_6:
- case Effect::RINGTONE_7:
- case Effect::RINGTONE_8:
- case Effect::RINGTONE_9:
- case Effect::RINGTONE_10:
- case Effect::RINGTONE_11:
- case Effect::RINGTONE_12:
- case Effect::RINGTONE_13:
- case Effect::RINGTONE_14:
- case Effect::RINGTONE_15:
- timeoutMs = 1000;
- break;
case Effect::TEXTURE_TICK:
timeoutMs = 40;
break;
+ case Effect::TICK:
+ timeoutMs = 80;
+ break;
default:
return ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
}
@@ -150,14 +123,7 @@
}
ndk::ScopedAStatus Vibrator::getSupportedEffects(std::vector<Effect>* _aidl_return) {
- *_aidl_return = {Effect::CLICK, Effect::DOUBLE_CLICK, Effect::TICK,
- Effect::THUD, Effect::POP, Effect::HEAVY_CLICK,
- Effect::RINGTONE_1, Effect::RINGTONE_2, Effect::RINGTONE_3,
- Effect::RINGTONE_4, Effect::RINGTONE_5, Effect::RINGTONE_6,
- Effect::RINGTONE_7, Effect::RINGTONE_8, Effect::RINGTONE_9,
- Effect::RINGTONE_10, Effect::RINGTONE_11, Effect::RINGTONE_12,
- Effect::RINGTONE_13, Effect::RINGTONE_14, Effect::RINGTONE_15,
- Effect::TEXTURE_TICK};
+ *_aidl_return = {Effect::CLICK, Effect::TEXTURE_TICK, Effect::TICK};
return ndk::ScopedAStatus::ok();
}
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index 694f3ba..fdbeaad 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -555,4 +555,34 @@
<!-- The type of the light sensor to be used by the display framework for things like
auto-brightness. If unset, then it just gets the default sensor of type TYPE_LIGHT. -->
<string name="config_displayLightSensorType" translatable="false">android.sensor.light</string>
+
+ <!-- Vibrator pattern for feedback about a long screen/key press -->
+ <integer-array name="config_longPressVibePattern">
+ <item>0</item>
+ <item>90</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback about touching a virtual key -->
+ <integer-array name="config_virtualKeyVibePattern">
+ <item>0</item>
+ <item>70</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback that simulates a double click effect -->
+ <integer-array name="config_doubleClickVibePattern">
+ <item>0</item>
+ <item>50</item>
+ <item>150</item>
+ <item>50</item>
+ </integer-array>
+
+ <!-- Vibrator pattern for feedback about booting with safe mode enabled -->
+ <integer-array name="config_safeModeEnabledVibePattern">
+ <item>0</item>
+ <item>40</item>
+ <item>160</item>
+ <item>165</item>
+ <item>500</item>
+ <item>600</item>
+ </integer-array>
</resources>