vibrator: example: Fix out-of-scope memory access.

Bug: 129091875
Test: VTS
Change-Id: I64685e6e8982db1a33c8322e1df7d266fa367eaf
Signed-off-by: Harpreet "Eli" Sangha <eliptus@google.com>
diff --git a/vibrator/1.3/example/Vibrator.h b/vibrator/1.3/example/Vibrator.h
index 8cf0b1e..c118061 100644
--- a/vibrator/1.3/example/Vibrator.h
+++ b/vibrator/1.3/example/Vibrator.h
@@ -59,7 +59,7 @@
     void timeout();
 
     static void timerCallback(union sigval sigval);
-    static const char* effectToName(Effect effect);
+    static const std::string effectToName(Effect effect);
     static uint32_t effectToMs(Effect effect);
     static uint8_t strengthToAmplitude(EffectStrength strength);