summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-09-26 16:43:29 -0700
committerWink Saville <wink@google.com>2012-09-26 16:43:29 -0700
commita8e4f50aead658df817e0c0434fc5fb261701208 (patch)
tree746bd8d4090e1c5cd885de51cdc7881101ca2c74
parent598b3dd80f8f575c953cf8c64fb5be80d530de9a (diff)
downloadpackages_apps_Stk-a8e4f50aead658df817e0c0434fc5fb261701208.zip
packages_apps_Stk-a8e4f50aead658df817e0c0434fc5fb261701208.tar.gz
packages_apps_Stk-a8e4f50aead658df817e0c0434fc5fb261701208.tar.bz2
Fix mVibrator initialization.
getSystemService cannot be called during java#init, moving initialization of mVibrator into onCreate. Bug: 6886400 Change-Id: I644aa674fffb11ea755bd6d96169e43896c839f2
-rw-r--r--src/com/android/stk/ToneDialog.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/com/android/stk/ToneDialog.java b/src/com/android/stk/ToneDialog.java
index 0370939..0ad6ee8 100644
--- a/src/com/android/stk/ToneDialog.java
+++ b/src/com/android/stk/ToneDialog.java
@@ -55,7 +55,7 @@ public class ToneDialog extends Activity {
}
};
- Vibrator mVibrator = (Vibrator)getSystemService(VIBRATOR_SERVICE);
+ Vibrator mVibrator;
// Message id to signal tone duration timeout.
private static final int MSG_ID_STOP_TONE = 0xda;
@@ -64,7 +64,9 @@ public class ToneDialog extends Activity {
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
- initFromIntent(getIntent());
+ mVibrator = (Vibrator)getSystemService(VIBRATOR_SERVICE);
+
+ initFromIntent(getIntent());
// remove window title
View title = findViewById(com.android.internal.R.id.title);