-
Notifications
You must be signed in to change notification settings - Fork 0
/
0001-Setting-Alone-Driving-Mode.patch
1995 lines (1972 loc) · 97.1 KB
/
0001-Setting-Alone-Driving-Mode.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From f424fed93861db3b0dede914c5a90a80ae65893a Mon Sep 17 00:00:00 2001
From: Yanuar Harry <[email protected]>
Date: Tue, 19 Aug 2014 22:05:44 +0200
Subject: [PATCH] Driving Mode
Change-Id: I28c1fae2affe9bb4756672e72e3be8b2cde98dd2
---
AndroidManifest.xml | 17 +
res/drawable-hdpi/ic_settings_driving.png | Bin 0 -> 1445 bytes
res/drawable-xhdpi/ic_settings_driving.png | Bin 0 -> 1867 bytes
res/drawable-xxhdpi/ic_settings_driving.png | Bin 0 -> 2824 bytes
res/values-de/cm_strings.xml | 84 ++
res/values/donottranslate.xml | 4 +
res/values/pac_arrays.xml | 27 +
res/values/pac_attrs.xml | 1 +
res/values/pac_strings.xml | 85 ++
res/xml/pac_ui_settings.xml | 7 +
res/xml/tts_notif_settings.xml | 138 ++++
src/com/android/settings/pac/TtsNotification.java | 376 +++++++++
.../pac/lsn/AppMultiSelectListPreference.java | 4 +
src/com/android/settings/tts/IntentReceiver.java | 69 ++
src/com/android/settings/tts/NotifyService.java | 845 ++++++++++++++++++++
.../android/settings/tts/TextToSpeechSettings.java | 8 +-
16 files changed, 1664 insertions(+), 1 deletion(-)
create mode 100644 res/drawable-hdpi/ic_settings_driving.png
create mode 100644 res/drawable-xhdpi/ic_settings_driving.png
create mode 100644 res/drawable-xxhdpi/ic_settings_driving.png
create mode 100644 res/xml/tts_notif_settings.xml
create mode 100644 src/com/android/settings/pac/TtsNotification.java
create mode 100644 src/com/android/settings/tts/IntentReceiver.java
create mode 100644 src/com/android/settings/tts/NotifyService.java
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 21c09a6..22fa5e5 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -73,6 +73,8 @@
<uses-permission android:name="android.permission.READ_PHONE_BLACKLIST" />
<uses-permission android:name="android.permission.CHANGE_PHONE_BLACKLIST" />
<uses-permission android:name="android.permission.CHANGE_HEADS_UP_STATE" />
+ <uses-permission android:name="android.permission.RECEIVE_SMS" />
+ <uses-permission android:name="android.permission.SYSTEM_NOTIFICATION_LISTENER" />
<permission
android:name="android.permission.REQUEST_SUPERUSER"
@@ -2202,6 +2204,21 @@
</intent-filter>
</receiver>
+ <receiver android:name=".tts.IntentReceiver" >
+ <intent-filter>
+ <action android:name="android.intent.action.BOOT_COMPLETED" />
+ <action android:name="android.intent.action.PHONE_STATE" />
+ <action android:name="android.provider.Telephony.SMS_RECEIVED" />
+ <action android:name="android.intent.action.ACTION_POWER_CONNECTED" />
+ <action android:name="android.intent.action.ACTION_POWER_DISCONNECTED" />
+ <action android:name="com.android.settings.tts.action.SPEAK_NOTIFICATION" />
+ <action android:name="com.android.settings.tts.action.SPEAK_MUSIC" />
+ <action android:name="com.android.settings.tts.action.RUN_DRIVEMODE" />
+ </intent-filter>
+ </receiver>
+
+ <service android:name=".tts.NotifyService" />
+
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.android.settings.files"
diff --git a/res/drawable-hdpi/ic_settings_driving.png b/res/drawable-hdpi/ic_settings_driving.png
new file mode 100644
index 0000000000000000000000000000000000000000..a59606f2ec17120b041f30ed5887269d052ca41f
GIT binary patch
literal 1445
zcmV;W1zP%vP)<h;3K|Lk000e1NJLTq001xm001xu1^@s6R|5Hm00006VoOIv0RI60
z0RN!9r;`8x010qNS#tmYL?i$JL?i(~XT($h000McNliru-USd16)Kp|vw;8r1u{uQ
zK~!ko)tYOFRaF$nf9vK*li+K{8FduVs3r@+LP(Gjg`7%FvZ!hNRG%V32#WlW(HlSX
zB?>~UFbEn*i0G*mjwV!0nP$Fl2F=Gz^GeBa@G<`T&^od?o;#j%A2ZB?%RT4Zeg1o`
zz4l)Fzt+Am%Ed|nB552@1xy2KfGK`o1LS}%pa<yo&nckK%>Erw10>x9tN<PW76O$i
zUp)`B0$%{1o7w(hb(^FrN#9B8R`Jp+X_ur~W%q!jiNHGG`GlVbfO9}6&<nKtv=J~F
z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f8)M5l*JXdcU$bW})sFHgBJl9Q4?h^TPJvgXhU
zO_WlGofVkF)=1i(pnR*O85yx6y1ysD`6)|M|80RrG$t7ERDoEZ4wcmBVvF*ObN@*0
zF0ic9A1u^pk)AH3tm2tsBp;dC;X(>qQ!{q_pa+Eck{0@PQ#lG-xrESo23Q-6;!NPz
z0ynASzGD`0l(ij*BGm=pxhy4_q~dO8+7hFCATCWQ-<?==aktp=dSJj>Nl#vD3YDe2
z9s%b$;P@(q0fSz(z^|K9M4QqcaKxrle}Xq2NjhSZw94DG_-Upjtx0G%Rnm&sVlCYf
zQ^IbT?~w0RSENePINy=u^0B1x-ljp)OMcE){zJal0^5*>CJadGk<=mSV#4p2+}IvT
z=kj1|k~C#F>h`1apgX~k5&x^fsQ<IasF(i$7c_41MP?a%00000NkvXXu0mjfY1EaJ
literal 0
HcmV?d00001
diff --git a/res/drawable-xhdpi/ic_settings_driving.png b/res/drawable-xhdpi/ic_settings_driving.png
new file mode 100644
index 0000000000000000000000000000000000000000..20cb52e5082ee05771d1828a4972eb9b8e0cd0e6
GIT binary patch
literal 1867
zcmV-R2ekN!P)<h;3K|Lk000e1NJLTq002M$002M;1^@s6s%dfF00006VoOIv0RI60
z0RN!9r;`8x010qNS#tmYL?i$JL?i(~XT($h000McNliru-USd16%M4#S5N=|2G~hN
zK~#9!?VD+g6-5xo|Aiv5#06PUL0k?+0mXwvF)AMMh<@<+prYT@5HK-BMU8i2jGEvF
z6HlUvSBzIMqNq_4jb~gTqKLtRLnJB^msJ*IW!J@@AE+0{cIM5znR$BzD|wmed0kcA
z)!o%q)z#8&4pwglK!c<al7{<ln52Cp@7pA`N&3xyzxs2tnf=~xB@3JeybY`degk%p
z4LX5#U@h=Ia6y0S^kKj)z$VItZNS~Y;lO~t*zsoIO`wbV!e77#z?43r1Avi|?v!+8
zhU)FUzB?ps@O9oHX|SZBlEz9JBB{xBLmIp!X`Y$=(9@%B{+tDDOc}8iz@5MhU;?mL
z3hh0Calnbbls-wJ|0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O(YD6TfWM+s
zrn1M@2=~;v|8M2Q+czk03I)(6sWU(rorBRsbr!(&dEx?r0J`Irz*g-#tB)#;u{j#p
zD(SsCb$*4UwK?#{NB4b6JK_Y;8eJC-XXaR+-IA`Z*XWyBXAZn$gYstorN#rkDG-U7
zS+d=KLxHw@SS=oq77=PLz__f4(4!?Elw4LzOt7V3Ozz@>oxipq|K~Et1gk`a4=H*E
z0DM$q$3OMRQW3r*V{#f&qr!3L0ymd*F3=n^!$Rl)CZ{D+W#oB9&F2D+xHu*^ue977
zPp654A4=r0cg&eUOQxW1!r9=eBIg4E{kswbu%N6|H(+Vjv%vu|d-+C54+ozoNt#*G
z0CgmMZ+GvqXy?!Hphy%Jo7rcz5J}1pIJkrc-s-eI^cdqZFV8Q5_FlE-2MkEC=-MRR
z9`o1Ik`f@1bdi}Ym2|0>i*~+2Qk+M6ubFMANdPW{CnY@?d~TA|QqoeG>d&K8&b@^t
zlESRDH_Ytryb`UJCAL0qmRMv75FE73&pYx(vc#&*0NlAb#XYDfjFYswppn$={{6NB
z)4ox=BEZvQ{yxdfI@1(uYTApLZI`sacBQ(9%VCY1yOu)-oNZ=TN;)}@4gk*b*j}jM
zIwdt{&1lJ#_hV*T-LLM73sOp2nInB}a~Pki!N^%EDJe8Iv6edonG>H}2*V|P7DM9*
zNv-ZnOvo_$Ch2Klj--WIlpt^*Fx%r6$LXJlb_LdHS1wb1FHmH-FR<0`3+$JGe}4kr
zGfC?lcnR3j>-PmJyMsTo-Wa*d4_}Y)l$q@bb$9xGfT_Sqz-@i<#z>6Ixgev9Tg$b%
zEU>UHcLQ<?qTk*cD_an|=e@xMVf2feqyOI>{vUR8_#4U*AO8GjpD6$U002ovPDHLk
FV1k=Occ1_O
literal 0
HcmV?d00001
diff --git a/res/drawable-xxhdpi/ic_settings_driving.png b/res/drawable-xxhdpi/ic_settings_driving.png
new file mode 100644
index 0000000000000000000000000000000000000000..1c25a284acd354e8131eb2632af693029e9935b7
GIT binary patch
literal 2824
zcm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e(Vj6eO7`?SQ&7Mr
zA74yj3Lwwf(>*OD%KZT=Z3?uc6mYBO{nVrs01N<r8$qVh-XGxU2~lp)I0@XHkOCg^
zy#GcL3IM)Hv>X2Naf60uPKbJk%-?bDkf|<m4!9k-!d6<xO8BGBC;;aUnN<<_&(|F?
z9_uLTElOvsA{NA;Uj-a4&=TD^8mDrA+18>f?^~2SLdCsD>=5u(oTS**AuI8g2*cdm
z5bthZU`_-p&Kr`G?|Z~Nf_CO6z2kO;dk^p#54{VCo<VV^JC%S-d3WO6q<1(bU*&a^
zo=fOr?~*(T{M9~jGitS4x5#?iYr585k{(42wPR;7(G6K+139{NI|(IJ?i0@0{7|`3
z+oE!(d{?_u-bWe3fF~kEJrs);;F&y)?<R-J7%nHqev+gia*{|5QoQVnhvl3@Ym{>=
zXrrWc#+dDSlh@?DXVl0!ab9bmIyvcH`r4<r{&)1V$^LASa}KLbQkya6ges_@f(j}q
ag#QBKufz5auDQ$r0000<MNUMnLSTZVxJB0h
literal 0
HcmV?d00001
diff --git a/res/values-de/cm_strings.xml b/res/values-de/cm_strings.xml
index 9363ce4..1a363d6 100644
--- a/res/values-de/cm_strings.xml
+++ b/res/values-de/cm_strings.xml
@@ -916,4 +916,88 @@ auf <xliff:g id="new" example="libart.so">%2$s</xliff:g> zu ändern?</string>
<string name="enable_adb_summary_cm">ADB-Protokoll für Debugging über USB oder Netzwerk aktivieren</string>
<string name="block_notifications_title">Benachrichtigungen filtern</string>
<string name="no_filters_title">Keine Filter aktiv</string>
+ <!-- Driving mode -->
+ <!-- require add space in the end of string -->
+ <string name="voice_tts_new_call">Eingehender Anruf von </string>
+ <!-- require add space in the end of string -->
+ <string name="voice_tts_new_sms">Neue Textnachricht von </string>
+ <!-- require add space in the end of string -->
+ <string name="voice_tts_new_notif">Neues Ereignis von </string>
+ <string name="voice_tts_title">Driving Mode</string>
+
+ <string name="tts_settings_reset_message">Alle Einstellungen zurücksetzen?</string>
+ <string name="voice_tts_notification_title">Drive Mode einschalten</string>
+ <string name="voice_tts_notification_summary_on">Driving Mode</string>
+ <string name="voice_tts_notification_summary_off">Drive Mode ausschalten</string>
+ <string name="voice_tts_volume_title">Lautstärke</string>
+ <string name="voice_tts_volume_summary">Stelle Sprachlautstärke ein</string>
+ <string name="voice_tts_call_title">Eingehender Anruf</string>
+ <string name="voice_tts_call_summary">Sprache für eingehende Anrufe ein/ausschalten</string>
+ <string name="voice_tts_sms_title">Neue Nachricht</string>
+ <string name="voice_tts_sms_summary">Sprache für Nachrichten ein/ausschalten</string>
+ <string name="voice_tts_sms_read_title">Lese neue Nachricht</string>
+ <string name="voice_tts_sms_read_summary">Sprache für neue Nachrichten ein/ausschalten</string>
+ <string name="voice_tts_charge_full_title">Akkuanzeige</string>
+ <string name="voice_tts_charge_full_summary">Sprache wenn Akku voll ein/ausschalten</string>
+ <string name="voice_tts_charge_on_title">Ladegerät angeschlossen</string>
+ <string name="voice_tts_charge_on_summary">Sprache für angeschlossenes Ladegerät ein/ausschalten</string>
+ <string name="voice_tts_charge_off_title">Ladegerät ausgesteckt</string>
+ <string name="voice_tts_charge_off_summary">Sprache für abgestecktes Ladegerät ein/ausschalten</string>
+ <string name="voice_tts_clock_title">Uhr</string>
+ <string name="voice_tts_clock_summary">Sprache für Uhr ein/ausschalten wenn Display eingeschaltet wird</string>
+ <string name="voice_tts_date_title">Datum</string>
+ <string name="voice_tts_date_summary">Sprache für Datum ein/ausschalten wenn Display eingeschaltet wird</string>
+ <string name="voice_tts_notif_title">Ereignis</string>
+ <string name="voice_tts_notif_summary">Sprache für Ereignis ein/ausschalten</string>
+ <string name="voice_tts_notif_read_title">Lese neues Ereignis</string>
+ <string name="voice_tts_notif_read_summary">Sprache für ein neues Ereignis ein/ausschalten</string>
+ <string name="voice_tts_whitelist_title">enthaltene Apps</string>
+ <string name="voice_tts_whitelist_summary">Welche Apps sind erlaubt was vorgelesen werden können</string>
+ <string name="voice_tts_music_title">Musik Titel</string>
+ <string name="voice_tts_music_summary">Sprache für Liedtitel ein/ausschalten</string>
+ <string name="voice_tts_annoy_notif_title">Begrenzung der Sprachbenachrichtigung</string>
+ <string name="voice_tts_annoy_notif_summary">Begrenzung der Sprachbenachrichtigung jeder App - nur einmal pro eingestellten Zeit spielen</string>
+ <string name="voice_tts_annoy_notif_default">Standardverhalten</string>
+ <string name="voice_tts_annoy_notif_3s">3 Sekunden</string>
+ <string name="voice_tts_annoy_notif_5s">5 Sekunden</string>
+ <string name="voice_tts_annoy_notif_10s">10 Sekunden</string>
+ <string name="voice_tts_annoy_notif_15s">15 Sekunden</string>
+ <string name="voice_tts_annoy_notif_30s">30 Sekunden</string>
+ <string name="voice_tts_annoy_notif_45s">45 Sekunden</string>
+ <string name="voice_tts_annoy_notif_1m">1 Minute</string>
+ <string name="voice_tts_annoy_notif_2m">2 Minuten</string>
+ <string name="voice_tts_annoy_notif_5m">5 Minuten</string>
+ <string name="voice_tts_charge_full">Akku aufgeladen</string>
+ <string name="voice_tts_charge_on">Laden beginnt</string>
+ <string name="voice_tts_charge_off">Laden gestoppt</string>
+ <string name="voice_tts_time">Es ist</string>
+ <string name="voice_tts_date">Wir haben den</string>
+ <string name="voice_tts_music">Nun spielt</string>
+ <string name="voice_tts_engine_started">Drive Mode gestartet</string>
+ <string name="unknown_tts">Unbekannt</string>
+ <string name="unknown_number_tts">Unbekannte Nummer</string>
+ <string name="time_one">Eins</string>
+ <string name="time_two">Zwei</string>
+ <string name="time_three">Drei</string>
+ <string name="time_four">Vier</string>
+ <string name="time_five">Fünf</string>
+ <string name="time_six">Sechs</string>
+ <string name="time_seven">Sieben</string>
+ <string name="time_eight">Acht</string>
+ <string name="time_nine">Neun</string>
+ <string name="time_ten">Zehn</string>
+ <string name="time_eleven">Elf</string>
+ <string name="time_twelve">Zwölf</string>
+ <string name="time_oclock">Uhr</string>
+ <string name="time_five_past">Fünf nach</string>
+ <string name="time_ten_past">Zehn nach</string>
+ <string name="time_quarter_past">Viertel nach</string>
+ <string name="time_twenty_past">Zwanzig nach</string>
+ <string name="time_twenty_five_past">Fünfundzwanzig nach</string>
+ <string name="time_half_past">Halb</string>
+ <string name="time_twenty_five_to">Fünfundzwanzig vor</string>
+ <string name="time_twenty_to">Zwanzig vor</string>
+ <string name="time_quarter_to">Viertel vor</string>
+ <string name="time_ten_to">Zehn vor</string>
+ <string name="time_five_to">Fünf vor</string>
</resources>
diff --git a/res/values/donottranslate.xml b/res/values/donottranslate.xml
index e6bd9a6..540420b 100644
--- a/res/values/donottranslate.xml
+++ b/res/values/donottranslate.xml
@@ -33,4 +33,8 @@
<item>@string/input_method_selector_always_show_value</item>
<item>@string/input_method_selector_always_hide_value</item>
</string-array>
+ <!-- DO NOT TRANSLATE. ICU date format for display. -->
+ <string name="tts_date_pattern" translatable="false">ddMMMMyyyy</string>
+ <!-- DO NOT TRANSLATE. ICU weekday format for display -->
+ <string name="tts_weekday_pattern" translatable="false">eeee</string>
</resources>
diff --git a/res/values/pac_arrays.xml b/res/values/pac_arrays.xml
index 3ade4e7..6d974a7 100644
--- a/res/values/pac_arrays.xml
+++ b/res/values/pac_arrays.xml
@@ -688,4 +688,31 @@
<!-- You better not add new string-arrays here, organize them alphabetically! -->
+ <!-- Driving mode -->
+ <string-array name="voice_tts_annoy_notif_entries">
+ <item>@string/voice_tts_annoy_notif_default</item>
+ <item>@string/voice_tts_annoy_notif_3s</item>
+ <item>@string/voice_tts_annoy_notif_5s</item>
+ <item>@string/voice_tts_annoy_notif_10s</item>
+ <item>@string/voice_tts_annoy_notif_15s</item>
+ <item>@string/voice_tts_annoy_notif_30s</item>
+ <item>@string/voice_tts_annoy_notif_45s</item>
+ <item>@string/voice_tts_annoy_notif_1m</item>
+ <item>@string/voice_tts_annoy_notif_2m</item>
+ <item>@string/voice_tts_annoy_notif_5m</item>
+ </string-array>
+
+ <string-array name="voice_tts_annoy_notif_values" translatable="false">
+ <item>0</item>
+ <item>3000</item>
+ <item>5000</item>
+ <item>10000</item>
+ <item>15000</item>
+ <item>30000</item>
+ <item>45000</item>
+ <item>60000</item>
+ <item>120000</item>
+ <item>300000</item>
+ </string-array>
+
</resources>
diff --git a/res/values/pac_attrs.xml b/res/values/pac_attrs.xml
index b6a28c6..fd0ed5e 100644
--- a/res/values/pac_attrs.xml
+++ b/res/values/pac_attrs.xml
@@ -48,6 +48,7 @@
<attr name="minimun" format="integer" />
<attr name="unitsLeft" format="string|reference" />
<attr name="unitsRight" format="string|reference" />
+ <attr name="interval" format="integer" />
</declare-styleable>
</resources>
diff --git a/res/values/pac_strings.xml b/res/values/pac_strings.xml
index d8e8382..f1d33cc 100644
--- a/res/values/pac_strings.xml
+++ b/res/values/pac_strings.xml
@@ -660,4 +660,89 @@
<!-- You better not add new strings here, organize them alphabetically! -->
+ <!-- Driving mode -->
+ <!-- require add space in the end of string -->
+ <string name="voice_tts_new_call">Incoming call from </string>
+ <!-- require add space in the end of string -->
+ <string name="voice_tts_new_sms">New text message from </string>
+ <!-- require add space in the end of string -->
+ <string name="voice_tts_new_notif">New notification from </string>
+ <string name="voice_tts_title">Driving Mode</string>
+
+ <string name="tts_settings_reset_message">Reset all settings to default?</string>
+ <string name="voice_tts_notification_title">Drive mode</string>
+ <string name="voice_tts_notification_summary_on">Enable driving mode</string>
+ <string name="voice_tts_notification_summary_off">Disable driving mode</string>
+ <string name="voice_tts_volume_title">Volume</string>
+ <string name="voice_tts_volume_summary">Set volume for speak</string>
+ <string name="voice_tts_call_title">Incoming call</string>
+ <string name="voice_tts_call_summary">Enable/disable speak for Incoming calls</string>
+ <string name="voice_tts_sms_title">New message</string>
+ <string name="voice_tts_sms_summary">Enable/disable speak for New messages</string>
+ <string name="voice_tts_sms_read_title">Read new message</string>
+ <string name="voice_tts_sms_read_summary">Enable/disable speak for Read New messages</string>
+ <string name="voice_tts_charge_full_title">Battery full indicator</string>
+ <string name="voice_tts_charge_full_summary">Enable/disable speak for battery fully charged</string>
+ <string name="voice_tts_charge_on_title">Connect charger</string>
+ <string name="voice_tts_charge_on_summary">Enable/disable speak for charging connected</string>
+ <string name="voice_tts_charge_off_title">Disconnect charger</string>
+ <string name="voice_tts_charge_off_summary">Enable/disable speak for charging disconnected</string>
+ <string name="voice_tts_clock_title">Clock</string>
+ <string name="voice_tts_clock_summary">Enable/disable speak for clock after screen turn on</string>
+ <string name="voice_tts_date_title">Date</string>
+ <string name="voice_tts_date_summary">Enable/disable speak for date after screen turn on</string>
+ <string name="voice_tts_notif_title">Notification</string>
+ <string name="voice_tts_notif_summary">Enable/disable speak for new notification</string>
+ <string name="voice_tts_notif_read_title">Read new notifications</string>
+ <string name="voice_tts_notif_read_summary">Enable/disable speak for Read New messages from notifications</string>
+ <string name="voice_tts_whitelist_title">Included applications</string>
+ <string name="voice_tts_whitelist_summary">Which apps allowed to speak for new notifications</string>
+ <string name="voice_tts_music_title">Music track</string>
+ <string name="voice_tts_music_summary">Enable/disable speak for song name</string>
+ <string name="voice_tts_annoy_notif_title">Less frequent speak notification</string>
+ <string name="voice_tts_annoy_notif_summary">Limit the speak notification of each app to only play once per set time period</string>
+ <string name="voice_tts_annoy_notif_default">Default Behaviour</string>
+ <string name="voice_tts_annoy_notif_3s">3 seconds</string>
+ <string name="voice_tts_annoy_notif_5s">5 seconds</string>
+ <string name="voice_tts_annoy_notif_10s">10 seconds</string>
+ <string name="voice_tts_annoy_notif_15s">15 seconds</string>
+ <string name="voice_tts_annoy_notif_30s">30 seconds</string>
+ <string name="voice_tts_annoy_notif_45s">45 seconds</string>
+ <string name="voice_tts_annoy_notif_1m">1 minute</string>
+ <string name="voice_tts_annoy_notif_2m">2 minutes</string>
+ <string name="voice_tts_annoy_notif_5m">5 minutes</string>
+ <string name="voice_tts_charge_full">Battery fully charged</string>
+ <string name="voice_tts_charge_on">Charging Start</string>
+ <string name="voice_tts_charge_off">Charging Stop</string>
+ <string name="voice_tts_time">Time is</string>
+ <string name="voice_tts_date">Date is</string>
+ <string name="voice_tts_music">Now playing</string>
+ <string name="voice_tts_engine_started">Drive Mode Ready</string>
+ <string name="unknown_tts">Unknown</string>
+ <string name="unknown_number_tts">Unknown number</string>
+ <string name="time_one">One</string>
+ <string name="time_two">Two</string>
+ <string name="time_three">Three</string>
+ <string name="time_four">Four</string>
+ <string name="time_five">Five</string>
+ <string name="time_six">Six</string>
+ <string name="time_seven">Seven</string>
+ <string name="time_eight">Eight</string>
+ <string name="time_nine">Nine</string>
+ <string name="time_ten">Ten</string>
+ <string name="time_eleven">Eleven</string>
+ <string name="time_twelve">Twelve</string>
+ <string name="time_oclock">o Clock</string>
+ <string name="time_five_past">Five after</string>
+ <string name="time_ten_past">Ten after</string>
+ <string name="time_quarter_past">Quarter after</string>
+ <string name="time_twenty_past">Twenty</string>
+ <string name="time_twenty_five_past">TwentyFive after</string>
+ <string name="time_half_past">Half past</string>
+ <string name="time_twenty_five_to">TwentyFive till</string>
+ <string name="time_twenty_to">Twenty till</string>
+ <string name="time_quarter_to">Quarter till</string>
+ <string name="time_ten_to">Ten till</string>
+ <string name="time_five_to">Five till</string>
+
</resources>
diff --git a/res/xml/pac_ui_settings.xml b/res/xml/pac_ui_settings.xml
index d65e8f7..cf8d3d3 100644
--- a/res/xml/pac_ui_settings.xml
+++ b/res/xml/pac_ui_settings.xml
@@ -60,4 +60,11 @@
android:summary="@string/wakelock_blocker_header_summary"
android:icon="@drawable/ic_wakelock_blocker" />
+ <PreferenceScreen
+ android:key="interface_voice_tts"
+ android:icon="@drawable/ic_settings_driving"
+ android:title="@string/voice_tts_title"
+ android:fragment="com.android.settings.pac.TtsNotification" >
+ </PreferenceScreen>
+
</PreferenceScreen>
diff --git a/res/xml/tts_notif_settings.xml b/res/xml/tts_notif_settings.xml
new file mode 100644
index 0000000..4c05666
--- /dev/null
+++ b/res/xml/tts_notif_settings.xml
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014 The OmniROM 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.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:settings="http://schemas.android.com/apk/res/com.android.settings"
+ android:title="@string/voice_tts_title" >
+
+ <PreferenceScreen android:key="tts_settings_preference"
+ android:fragment="com.android.settings.tts.TextToSpeechSettings"
+ android:title="@string/tts_settings_title"/>
+
+ <SwitchPreference
+ android:key="voice_tts"
+ android:persistent="false"
+ android:title="@string/voice_tts_notification_title"
+ android:summaryOff="@string/voice_tts_notification_summary_off"
+ android:summaryOn="@string/voice_tts_notification_summary_on" />
+
+ <com.android.settings.pac.SeekBarPreferenceCHOS
+ android:key="voice_tts_volume"
+ android:dependency="voice_tts"
+ android:persistent="false"
+ android:title="@string/voice_tts_volume_title"
+ android:summary="@string/voice_tts_volume_summary"
+ android:max="100"
+ settings:min="0"
+ settings:interval="1"
+ settings:unitsLeft=""
+ settings:unitsRight=" %"
+ android:defaultValue="80" />
+
+ <CheckBoxPreference
+ android:key="voice_tts_call"
+ android:persistent="false"
+ android:title="@string/voice_tts_call_title"
+ android:summary="@string/voice_tts_call_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_sms"
+ android:persistent="false"
+ android:title="@string/voice_tts_sms_title"
+ android:summary="@string/voice_tts_sms_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_sms_read"
+ android:persistent="false"
+ android:title="@string/voice_tts_sms_read_title"
+ android:summary="@string/voice_tts_sms_read_summary"
+ android:dependency="voice_tts_sms"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_charge_full"
+ android:persistent="false"
+ android:title="@string/voice_tts_charge_full_title"
+ android:summary="@string/voice_tts_charge_full_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_charge_on"
+ android:persistent="false"
+ android:title="@string/voice_tts_charge_on_title"
+ android:summary="@string/voice_tts_charge_on_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_charge_off"
+ android:persistent="false"
+ android:title="@string/voice_tts_charge_off_title"
+ android:summary="@string/voice_tts_charge_off_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_clock"
+ android:persistent="false"
+ android:title="@string/voice_tts_clock_title"
+ android:summary="@string/voice_tts_clock_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_date"
+ android:persistent="false"
+ android:title="@string/voice_tts_date_title"
+ android:summary="@string/voice_tts_date_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_music"
+ android:persistent="false"
+ android:title="@string/voice_tts_music_title"
+ android:summary="@string/voice_tts_music_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_notif"
+ android:persistent="false"
+ android:title="@string/voice_tts_notif_title"
+ android:summary="@string/voice_tts_notif_summary"
+ android:dependency="voice_tts"/>
+
+ <CheckBoxPreference
+ android:key="voice_tts_notif_read"
+ android:persistent="false"
+ android:title="@string/voice_tts_notif_read_title"
+ android:summary="@string/voice_tts_notif_read_summary"
+ android:dependency="voice_tts_notif"/>
+
+ <com.android.settings.pac.lsn.AppMultiSelectListPreference
+ android:key="voice_tts_whitelist"
+ android:persistent="false"
+ android:dependency="voice_tts_notif"
+ android:title="@string/voice_tts_whitelist_title"
+ android:summary="@string/voice_tts_whitelist_summary" />
+
+ <ListPreference
+ android:key="voice_tts_annoy_notif"
+ android:dependency="voice_tts_notif"
+ android:title="@string/voice_tts_annoy_notif_title"
+ android:summary="@string/voice_tts_annoy_notif_summary"
+ android:entries="@array/voice_tts_annoy_notif_entries"
+ android:entryValues="@array/voice_tts_annoy_notif_values"
+ android:persistent="false"
+ android:defaultValue="0" />
+
+</PreferenceScreen>
diff --git a/src/com/android/settings/pac/TtsNotification.java b/src/com/android/settings/pac/TtsNotification.java
new file mode 100644
index 0000000..824bf77
--- /dev/null
+++ b/src/com/android/settings/pac/TtsNotification.java
@@ -0,0 +1,376 @@
+/*
+ * Copyright (C) 2014 The OmniROM 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.android.settings.pac;
+
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.content.ActivityNotFoundException;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.preference.CheckBoxPreference;
+import android.preference.ListPreference;
+import android.preference.Preference;
+import android.preference.Preference.OnPreferenceChangeListener;
+import android.preference.PreferenceCategory;
+import android.preference.PreferenceScreen;
+import android.preference.PreferenceManager;
+import android.preference.SwitchPreference;
+import android.provider.Settings;
+import android.speech.tts.TextToSpeech;
+import android.text.TextUtils;
+import android.util.Log;
+import android.view.Menu;
+import android.view.MenuInflater;
+import android.view.MenuItem;
+
+import com.android.settings.pac.SeekBarPreferenceCHOS;
+import com.android.settings.pac.lsn.AppMultiSelectListPreference;
+import com.android.settings.SettingsPreferenceFragment;
+import com.android.settings.tts.IntentReceiver;
+import com.android.settings.R;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public class TtsNotification extends SettingsPreferenceFragment implements
+ OnPreferenceChangeListener {
+
+ private static final String TAG = "TtsNotification";
+ private static final String KEY_VOICE_TTS = "voice_tts";
+ private static final String KEY_VOICE_TTS_VOLUME = "voice_tts_volume";
+ private static final String KEY_VOICE_TTS_CALL = "voice_tts_call";
+ private static final String KEY_VOICE_TTS_SMS = "voice_tts_sms";
+ private static final String KEY_VOICE_TTS_SMS_READ = "voice_tts_sms_read";
+ private static final String KEY_VOICE_TTS_CHARGE_FULL = "voice_tts_charge_full";
+ private static final String KEY_VOICE_TTS_CHARGE_ON = "voice_tts_charge_on";
+ private static final String KEY_VOICE_TTS_CHARGE_OFF = "voice_tts_charge_off";
+ private static final String KEY_VOICE_TTS_CLOCK = "voice_tts_clock";
+ private static final String KEY_VOICE_TTS_DATE = "voice_tts_date";
+ private static final String KEY_VOICE_TTS_MUSIC = "voice_tts_music";
+ private static final String KEY_VOICE_TTS_NOTIF = "voice_tts_notif";
+ private static final String KEY_VOICE_TTS_NOTIF_READ = "voice_tts_notif_read";
+ private static final String KEY_VOICE_TTS_INCLUDED_APPS = "voice_tts_whitelist";
+ private static final String KEY_VOICE_TTS_ANNOY_NOTIF = "voice_tts_annoy_notif";
+
+ private static final int MULTIPLIER_VOLUME = 10;
+
+ private static final int MENU_RESET = Menu.FIRST;
+
+ private SwitchPreference mEnableVoiceTTS;
+ private SeekBarPreferenceCHOS mVoiceVolume;
+ private CheckBoxPreference mEnableVoiceTTScall;
+ private CheckBoxPreference mEnableVoiceTTSsms;
+ private CheckBoxPreference mEnableVoiceTTSsmsRead;
+ private CheckBoxPreference mEnableVoiceTTSchargeFull;
+ private CheckBoxPreference mEnableVoiceTTSchargeOn;
+ private CheckBoxPreference mEnableVoiceTTSchargeOff;
+ private CheckBoxPreference mEnableVoiceTTSclock;
+ private CheckBoxPreference mEnableVoiceTTSdate;
+ private CheckBoxPreference mEnableVoiceTTSmusic;
+ private CheckBoxPreference mEnableVoiceTTSnotif;
+ private CheckBoxPreference mEnableVoiceTTSnotifRead;
+ private AppMultiSelectListPreference mIncludedAppsPref;
+ private ListPreference mAnnoyingNotifications;
+
+ private boolean isEngineReady;
+ private SharedPreferences mShareprefs;
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ addPreferencesFromResource(R.xml.tts_notif_settings);
+
+ Context context = getActivity();
+ PreferenceScreen prefSet = getPreferenceScreen();
+
+ mShareprefs = PreferenceManager.getDefaultSharedPreferences(context);
+
+ mEnableVoiceTTS = (SwitchPreference) prefSet.findPreference(KEY_VOICE_TTS);
+ mEnableVoiceTTS.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED, false));
+ mEnableVoiceTTS.setOnPreferenceChangeListener(this);
+
+ mVoiceVolume = (SeekBarPreferenceCHOS) prefSet.findPreference(KEY_VOICE_TTS_VOLUME);
+ mVoiceVolume.setValue((mShareprefs.getInt(IntentReceiver.VOICE_VOLUME, 8) * MULTIPLIER_VOLUME));
+ mVoiceVolume.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTScall = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_CALL);
+ mEnableVoiceTTScall.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_CALL, false));
+ mEnableVoiceTTScall.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSsms = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_SMS);
+ mEnableVoiceTTSsms.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_SMS, false));
+ mEnableVoiceTTSsms.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSsmsRead = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_SMS_READ);
+ mEnableVoiceTTSsmsRead.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_SMS_READ, false));
+ mEnableVoiceTTSsmsRead.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSchargeFull = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_CHARGE_FULL);
+ mEnableVoiceTTSchargeFull.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_CHARGE_FULL, false));
+ mEnableVoiceTTSchargeFull.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSchargeOn = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_CHARGE_ON);
+ mEnableVoiceTTSchargeOn.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_CHARGE_ON, false));
+ mEnableVoiceTTSchargeOn.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSchargeOff = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_CHARGE_OFF);
+ mEnableVoiceTTSchargeOff.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_CHARGE_OFF, false));
+ mEnableVoiceTTSchargeOff.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSclock = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_CLOCK);
+ mEnableVoiceTTSclock.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_CLOCK, false));
+ mEnableVoiceTTSclock.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSdate = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_DATE);
+ mEnableVoiceTTSdate.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_DATE, false));
+ mEnableVoiceTTSdate.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSmusic = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_MUSIC);
+ mEnableVoiceTTSmusic.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_MUSIC, false));
+ mEnableVoiceTTSmusic.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSnotif = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_NOTIF);
+ mEnableVoiceTTSnotif.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_NOTIF, false));
+ mEnableVoiceTTSnotif.setOnPreferenceChangeListener(this);
+
+ mEnableVoiceTTSnotifRead = (CheckBoxPreference) prefSet.findPreference(KEY_VOICE_TTS_NOTIF_READ);
+ mEnableVoiceTTSnotifRead.setChecked(mShareprefs.getBoolean(IntentReceiver.ENABLED_NOTIF_READ, false));
+ mEnableVoiceTTSnotifRead.setOnPreferenceChangeListener(this);
+
+ mIncludedAppsPref = (AppMultiSelectListPreference) prefSet.findPreference(KEY_VOICE_TTS_INCLUDED_APPS);
+ Set<String> includedApps = getIncludedApps();
+ if (includedApps != null) mIncludedAppsPref.setValues(includedApps);
+ mIncludedAppsPref.setOnPreferenceChangeListener(this);
+
+ mAnnoyingNotifications = (ListPreference) prefSet.findPreference(KEY_VOICE_TTS_ANNOY_NOTIF);
+ mAnnoyingNotifications.setValue(Integer.toString(
+ mShareprefs.getInt(IntentReceiver.ANNOYING_NOTIFICATION, 0)));
+ mAnnoyingNotifications.setOnPreferenceChangeListener(this);
+
+ if (!mShareprefs.getBoolean(IntentReceiver.FIRST_BOOT_INUSE, false)) {
+ Intent checkIntent = new Intent();
+ checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
+ startActivityForResult(checkIntent, 1);
+ }
+
+ checkForEngineReady();
+
+ setHasOptionsMenu(true);
+ }
+
+ @Override
+ public void onActivityResult(int requestCode, int resultCode, Intent data) {
+ if (requestCode == 1) {
+ if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
+ mShareprefs.edit().putBoolean(IntentReceiver.ENGINE_READY, true).commit();
+ checkForEngineReady();
+ mShareprefs.edit().putBoolean(IntentReceiver.FIRST_BOOT_INUSE, true).commit();
+ } else {
+ // missing data, install it
+ Intent installIntent = new Intent();
+ installIntent.setAction(
+ TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
+ startActivity(installIntent);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENGINE_READY, false).commit();
+ checkForEngineReady();
+ }
+ }
+ }
+
+ private void checkForEngineReady() {
+ isEngineReady = mShareprefs.getBoolean(IntentReceiver.ENGINE_READY, false);
+ mEnableVoiceTTS.setEnabled(isEngineReady);
+ mVoiceVolume.setEnabled(isEngineReady);
+ mEnableVoiceTTScall.setEnabled(isEngineReady);
+ mEnableVoiceTTSsms.setEnabled(isEngineReady);
+ mEnableVoiceTTSsmsRead.setEnabled(isEngineReady);
+ mEnableVoiceTTSchargeFull.setEnabled(isEngineReady);
+ mEnableVoiceTTSchargeOn.setEnabled(isEngineReady);
+ mEnableVoiceTTSchargeOff.setEnabled(isEngineReady);
+ mEnableVoiceTTSclock.setEnabled(isEngineReady);
+ mEnableVoiceTTSdate.setEnabled(isEngineReady);
+ mEnableVoiceTTSmusic.setEnabled(isEngineReady);
+ mEnableVoiceTTSnotif.setEnabled(isEngineReady);
+ mEnableVoiceTTSnotifRead.setEnabled(isEngineReady);
+ mIncludedAppsPref.setEnabled(isEngineReady);
+ mAnnoyingNotifications.setEnabled(isEngineReady);
+ }
+
+ @Override
+ public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
+ menu.add(0, MENU_RESET, 0, R.string.reset)
+ .setIcon(R.drawable.ic_settings_backup) // use the backup icon
+ .setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
+ }
+
+ @Override
+ public boolean onOptionsItemSelected(MenuItem item) {
+ switch (item.getItemId()) {
+ case MENU_RESET:
+ resetToDefault();
+ return true;
+ default:
+ return super.onContextItemSelected(item);
+ }
+ }
+
+ private void resetToDefault() {
+ AlertDialog.Builder alertDialog = new AlertDialog.Builder(getActivity());
+ alertDialog.setTitle(R.string.reset);
+ alertDialog.setMessage(R.string.tts_settings_reset_message);
+ alertDialog.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
+ public void onClick(DialogInterface dialog, int id) {
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED, false).commit();
+ mEnableVoiceTTS.setChecked(false);
+ mShareprefs.edit().putInt(IntentReceiver.VOICE_VOLUME, 8).commit();
+ mVoiceVolume.setValue(80);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CALL, false).commit();
+ mEnableVoiceTTScall.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_SMS, false).commit();
+ mEnableVoiceTTSsms.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_SMS_READ, false).commit();
+ mEnableVoiceTTSsmsRead.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CHARGE_FULL, false).commit();
+ mEnableVoiceTTSchargeFull.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CHARGE_ON, false).commit();
+ mEnableVoiceTTSchargeOn.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CHARGE_OFF, false).commit();
+ mEnableVoiceTTSchargeOff.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CLOCK, false).commit();
+ mEnableVoiceTTSclock.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_DATE, false).commit();
+ mEnableVoiceTTSdate.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_MUSIC, false).commit();
+ mEnableVoiceTTSmusic.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_NOTIF, false).commit();
+ mEnableVoiceTTSnotif.setChecked(false);
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_NOTIF_READ, false).commit();
+ mEnableVoiceTTSnotifRead.setChecked(false);
+ mShareprefs.edit().putString(IntentReceiver.INCLUDE_NOTIFICATIONS, "").commit();
+ mIncludedAppsPref.setClearValues();
+ mShareprefs.edit().putInt(IntentReceiver.ANNOYING_NOTIFICATION, 0).commit();
+ mAnnoyingNotifications.setValue("0");
+ }
+ });
+ alertDialog.setNegativeButton(R.string.cancel, null);
+ alertDialog.create().show();
+ }
+
+ @Override
+ public boolean onPreferenceChange(Preference preference, Object newValue) {
+ if (preference == mEnableVoiceTTS) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED, value ? true : false).commit();
+ if (value) {
+ Intent intent = new Intent(IntentReceiver.ACTION_RUN_DRIVEMODE);
+ getActivity().getApplicationContext().sendBroadcast(intent);
+ }
+ return true;
+ } else if (preference == mVoiceVolume) {
+ int value = ((Integer)newValue).intValue();
+ int val = (value / MULTIPLIER_VOLUME);
+ mShareprefs.edit().putInt(IntentReceiver.VOICE_VOLUME, val).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTScall) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CALL, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSsms) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_SMS, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSsmsRead) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_SMS_READ, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSchargeFull) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CHARGE_FULL, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSchargeOn) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CHARGE_ON, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSchargeOff) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CHARGE_OFF, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSclock) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_CLOCK, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSdate) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_DATE, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSmusic) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_MUSIC, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSnotif) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_NOTIF, value ? true : false).commit();
+ return true;
+ } else if (preference == mEnableVoiceTTSnotifRead) {
+ boolean value = (Boolean) newValue;
+ mShareprefs.edit().putBoolean(IntentReceiver.ENABLED_NOTIF_READ, value ? true : false).commit();
+ return true;
+ } else if (preference == mIncludedAppsPref) {
+ storeIncludedApps((Set<String>) newValue);
+ return true;
+ } else if (preference == mAnnoyingNotifications) {
+ int value = Integer.valueOf((String) newValue);
+ mShareprefs.edit().putInt(IntentReceiver.ANNOYING_NOTIFICATION, value).commit();
+ return true;
+ }
+ return false;
+ }
+
+ @Override
+ public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
+ // If we didn't handle it, let preferences handle it.
+ return super.onPreferenceTreeClick(preferenceScreen, preference);
+ }
+
+ @Override
+ public void onResume() {
+ super.onResume();
+ }
+
+ private Set<String> getIncludedApps() {
+ String included = mShareprefs.getString(IntentReceiver.INCLUDE_NOTIFICATIONS, "");
+ if (TextUtils.isEmpty(included))
+ return null;
+
+ return new HashSet<String>(Arrays.asList(included.split("\\|")));
+ }
+
+ private void storeIncludedApps(Set<String> values) {
+ StringBuilder builder = new StringBuilder();
+ String delimiter = "";
+ for (String value : values) {
+ builder.append(delimiter);
+ builder.append(value);
+ delimiter = "|";