1 #include "android_os_vibrator.h" 2 3 4 5 6 7 8 namespace android::os::vibrator { 9 10 class flag_provider : public flag_provider_interface { 11 public: 12 13 adaptive_haptics_enabled()14 virtual bool adaptive_haptics_enabled() override { 15 return true; 16 } cancel_by_appops()17 virtual bool cancel_by_appops() override { 18 return ANDROID_OS_VIBRATOR_CANCEL_BY_APPOPS; 19 } fix_audio_coupled_haptics_scaling()20 virtual bool fix_audio_coupled_haptics_scaling() override { 21 return false; 22 } haptic_feedback_input_source_customization_enabled()23 virtual bool haptic_feedback_input_source_customization_enabled() override { 24 return ANDROID_OS_VIBRATOR_HAPTIC_FEEDBACK_INPUT_SOURCE_CUSTOMIZATION_ENABLED; 25 } haptic_feedback_vibration_oem_customization_enabled()26 virtual bool haptic_feedback_vibration_oem_customization_enabled() override { 27 return ANDROID_OS_VIBRATOR_HAPTIC_FEEDBACK_VIBRATION_OEM_CUSTOMIZATION_ENABLED; 28 } haptics_scale_v2_enabled()29 virtual bool haptics_scale_v2_enabled() override { 30 return false; 31 } load_haptic_feedback_vibration_customization_from_resources()32 virtual bool load_haptic_feedback_vibration_customization_from_resources() override { 33 return ANDROID_OS_VIBRATOR_LOAD_HAPTIC_FEEDBACK_VIBRATION_CUSTOMIZATION_FROM_RESOURCES; 34 } normalized_pwle_effects()35 virtual bool normalized_pwle_effects() override { 36 return false; 37 } primitive_composition_absolute_delay()38 virtual bool primitive_composition_absolute_delay() override { 39 return false; 40 } throttle_vibration_params_requests()41 virtual bool throttle_vibration_params_requests() override { 42 return true; 43 } vendor_vibration_effects()44 virtual bool vendor_vibration_effects() override { 45 return false; 46 } vibration_attribute_ime_usage_api()47 virtual bool vibration_attribute_ime_usage_api() override { 48 return false; 49 } vibration_pipeline_enabled()50 virtual bool vibration_pipeline_enabled() override { 51 return false; 52 } vibration_xml_apis()53 virtual bool vibration_xml_apis() override { 54 return false; 55 } 56 57 58 59 }; 60 61 std::unique_ptr<flag_provider_interface> provider_ = 62 std::make_unique<flag_provider>(); 63 } 64 65 android_os_vibrator_adaptive_haptics_enabled()66bool android_os_vibrator_adaptive_haptics_enabled() { 67 return true; 68 } 69 android_os_vibrator_cancel_by_appops()70bool android_os_vibrator_cancel_by_appops() { 71 return ANDROID_OS_VIBRATOR_CANCEL_BY_APPOPS; 72 } 73 android_os_vibrator_fix_audio_coupled_haptics_scaling()74bool android_os_vibrator_fix_audio_coupled_haptics_scaling() { 75 return false; 76 } 77 android_os_vibrator_haptic_feedback_input_source_customization_enabled()78bool android_os_vibrator_haptic_feedback_input_source_customization_enabled() { 79 return ANDROID_OS_VIBRATOR_HAPTIC_FEEDBACK_INPUT_SOURCE_CUSTOMIZATION_ENABLED; 80 } 81 android_os_vibrator_haptic_feedback_vibration_oem_customization_enabled()82bool android_os_vibrator_haptic_feedback_vibration_oem_customization_enabled() { 83 return ANDROID_OS_VIBRATOR_HAPTIC_FEEDBACK_VIBRATION_OEM_CUSTOMIZATION_ENABLED; 84 } 85 android_os_vibrator_haptics_scale_v2_enabled()86bool android_os_vibrator_haptics_scale_v2_enabled() { 87 return false; 88 } 89 android_os_vibrator_load_haptic_feedback_vibration_customization_from_resources()90bool android_os_vibrator_load_haptic_feedback_vibration_customization_from_resources() { 91 return ANDROID_OS_VIBRATOR_LOAD_HAPTIC_FEEDBACK_VIBRATION_CUSTOMIZATION_FROM_RESOURCES; 92 } 93 android_os_vibrator_normalized_pwle_effects()94bool android_os_vibrator_normalized_pwle_effects() { 95 return false; 96 } 97 android_os_vibrator_primitive_composition_absolute_delay()98bool android_os_vibrator_primitive_composition_absolute_delay() { 99 return false; 100 } 101 android_os_vibrator_throttle_vibration_params_requests()102bool android_os_vibrator_throttle_vibration_params_requests() { 103 return true; 104 } 105 android_os_vibrator_vendor_vibration_effects()106bool android_os_vibrator_vendor_vibration_effects() { 107 return false; 108 } 109 android_os_vibrator_vibration_attribute_ime_usage_api()110bool android_os_vibrator_vibration_attribute_ime_usage_api() { 111 return false; 112 } 113 android_os_vibrator_vibration_pipeline_enabled()114bool android_os_vibrator_vibration_pipeline_enabled() { 115 return false; 116 } 117 android_os_vibrator_vibration_xml_apis()118bool android_os_vibrator_vibration_xml_apis() { 119 return false; 120 } 121 122