Tizen release 1.0
[apps/home/settings.git] / debian / org.tizen.setting.postinst
1 #!/bin/sh
2 #This is setting postinst file
3
4 GOPTION=""  # Set without -g, -u options
5 if [ ${USER} == "root" ]
6 then
7   # Set vconf values with -g/-u options
8   GOPTION="-g 6514"
9 fi
10
11 ECHO="echo"
12 ################# shell paragrames ##############
13 NETWORK="network"
14 DATAROAMING="dataroaming"
15 USBCON="usbconnectivity"
16
17 SOUND="sounds"
18 WALLPAPER="wallpaper"
19 DISPLAY="display"
20
21 MOTIONS="motions"
22 TILT="tile"
23 PANNING="panning"
24 DOUBLETAP="double_tap"
25 TURNOVER="turn_over"
26 SHAKE="shake"
27 PICKUP="pick up"
28
29 POWERSAVING="powersaving"
30 FONT="font"
31 ROTATIONLOCK="rotationLock"
32 TIMEDATE="timeAndData"
33 ACCESS="accessibility"
34 LANGREGION="language"
35 VIEWTYPE="viewtype"
36 TOUCH="touch"
37 LICENSE="license"
38
39 NOTI="notification"
40 SECURITY="security"
41 MEMORY="memory"
42 ABOUT="about"
43 MENUWIDGET="menuwidget"
44
45 #$ECHO $GOPTION
46
47 #network
48 resetNetwork()
49 {
50         vconftool $GOPTION set -t int db/setting/select_network "0"
51         vconftool $GOPTION set -t int db/setting/network_mode "0"
52         vconftool $GOPTION set -t bool db/setting/3gEnabled "1"
53 }
54
55 #dataRoaming
56 resetDataRoaming()
57 {
58         vconftool $GOPTION set -t bool db/setting/data_roaming "1"
59 }
60
61 #UsbConnectivity
62 resetUsbConnectivity()
63 {
64         #connectivity
65         #vconftool $GOPTION set -t bool db/setting/ask_on_con "0"
66         # debug mode is default
67         vconftool $GOPTION set -t int memory/setting/usb_mode "-1" -i -f
68         vconftool $GOPTION set -t int memory/setting/usb_sel_mode "0" -i -f
69         vconftool $GOPTION set -t int db/setting/usb_debugmode "0"
70         vconftool $GOPTION set -t int memory/setting/usb_in_mode_change "0" -i -f
71 }
72
73 #sound profiles
74 resetSound()
75 {
76         DEFAULT_CALL_TONE="/opt/share/settings/Ringtones/General_Over the horizon.mp3"
77
78         vconftool $GOPTION set -t bool db/setting/sound/sound_on "1"
79         vconftool $GOPTION set -t bool db/setting/sound/vibration_on "1"
80
81         vconftool $GOPTION set -t int db/setting/sound/call/ringtone_sound_volume "13"
82         vconftool $GOPTION set -t int db/setting/sound/noti/sound_volume "7"
83         vconftool $GOPTION set -t int db/setting/sound/media/sound_volume "7"
84         vconftool $GOPTION set -t int db/setting/sound/touch_feedback/sound_volume "5"
85
86         vconftool $GOPTION set -t int db/setting/sound/noti/vibration_level "5"
87         vconftool $GOPTION set -t int db/setting/sound/touch_feedback/vibration_level "3"
88
89         vconftool $GOPTION set -t string db/setting/sound/call/ringtone_path "${DEFAULT_CALL_TONE}"
90         vconftool $GOPTION set -t int db/setting/sound/call/vibration_type "2"
91
92         vconftool $GOPTION set -t string db/setting/sound/noti/msg_ringtone_path        "${DEFAULT_CALL_TONE}"
93         vconftool $GOPTION set -t int db/setting/sound/noti/msg_alert_rep_type          "0"
94
95         vconftool $GOPTION set -t string db/setting/sound/noti/email_ringtone_path      "${DEFAULT_CALL_TONE}"
96         vconftool $GOPTION set -t int db/setting/sound/noti/email_alert_rep_type                "0"
97
98         vconftool $GOPTION set -t bool db/setting/sound/sound_lock "1"
99         #vconftool $GOPTION set -t bool db/setting/sound/keypad_on "1"
100         #vconftool $GOPTION set -t bool db/setting/sound/sound_effect_on "1"
101
102         #others
103         vconftool $GOPTION set -t string db/setting/notification_tone   "${DEFAULT_CALL_TONE}"
104         vconftool $GOPTION set -t string db/setting/media_tone "${DEFAULT_CALL_TONE}"
105         vconftool $GOPTION set -t string db/setting/touch_tone                  "${DEFAULT_CALL_TONE}"
106         vconftool $GOPTION set -t int db/setting/touch_vibration_tone "2"
107 }
108
109 #wallpaper
110 resetWallpaper()
111 {
112         vconftool $GOPTION set -t string db/menu_widget/bgset "/opt/share/settings/Wallpapers/Home_default.jpg"
113         vconftool $GOPTION set -t string db/idle_lock/bgset "/opt/share/settings/Wallpapers/Home_default.jpg"
114 }
115
116 #motions
117 resetTilt()
118 {
119         vconftool $GOPTION set -t bool db/setting/use_tilt "1"
120         vconftool $GOPTION set -t int db/setting/tilt_sensitivity "3"
121 }
122
123 resetPanning()
124 {
125         vconftool $GOPTION set -t bool db/setting/use_panning "1"
126         vconftool $GOPTION set -t int db/setting/panning_sensitivity "3"
127 }
128
129 resetDoubleTap()
130 {
131         vconftool $GOPTION set -t bool db/setting/use_double_tap "0"
132 }
133
134 resetShake()
135 {
136         vconftool $GOPTION set -t bool db/setting/use_shake "0"
137 }
138 resetPickup()
139 {
140         vconftool $GOPTION set -t bool db/setting/use_pickup "0"
141 }
142 resetTurnOver()
143 {
144         vconftool $GOPTION set -t bool db/setting/use_turn_over "0"
145 }
146
147 resetMotions()
148 {
149         vconftool $GOPTION set -t bool db/setting/motion_active "1"
150         vconftool $GOPTION set -t bool db/setting/internet_on "1"
151         vconftool $GOPTION set -t bool db/setting/gallery_on "1"
152
153         resetTilt
154         resetPanning
155         resetDoubleTap
156         resetTurnOver
157         resetShake
158         resetPickup
159 }
160
161 #display and light
162 resetDisplay()
163 {
164         #backlight
165         vconftool $GOPTION set -t int db/MainLCD/Backlight/Normal "30"
166         vconftool $GOPTION set -t int db/setting/lcd_timeout_normal_backup "30"
167
168         #brightness
169         vconftool $GOPTION set -t int db/setting/Brightness "-1"
170         vconftool $GOPTION set -t bool db/setting/brightness_automatic "0"
171
172         #battery
173         vconftool $GOPTION set -t bool db/setting/battery/charger "0"
174         vconftool $GOPTION set -t bool db/setting/battery_percentage "0"
175         #launch
176         vconftool $GOPTION set -t string db/menu_widget/launch_effect "0"
177 }
178
179 resetPowersaving()
180 {
181         vconftool $GOPTION set -t bool db/setting/powersaving/powersaving_active "0"
182         vconftool $GOPTION set -t bool db/setting/powersaving/powersaving_active_reminder "1"
183         vconftool $GOPTION set -t bool db/setting/powersaving/customed_active "0"
184
185         vconftool $GOPTION set -t int db/setting/powersaving/powersaving_at "30"
186         vconftool $GOPTION set -t bool db/setting/powersaving/wifi_off "0"
187         vconftool $GOPTION set -t bool db/setting/powersaving/bt_off "0"
188         vconftool $GOPTION set -t bool db/setting/powersaving/gps_off "0"
189         vconftool $GOPTION set -t bool db/setting/powersaving/ync_off "0"
190         vconftool $GOPTION set -t int db/setting/powersaving/screen_timeout "15"
191
192         vconftool $GOPTION set -t bool db/setting/powersaving/brightness_active "0"
193         vconftool $GOPTION set -t bool db/setting/powersaving/brightness_auto "1"
194         vconftool $GOPTION set -t int db/setting/powersaving/brightness "10"
195 }
196
197 #font
198 resetFont()
199 {
200         vconftool $GOPTION set -t int db/setting/font_size "1"
201         vconftool $GOPTION set -t int db/setting/font_type "0"
202 }
203
204 #RotationLock
205 resetRotationLock()
206 {
207         vconftool $GOPTION set -t bool db/setting/rotate_lock "0"
208 }
209
210 #time and date (zone)
211 resetTimeAndData()
212 {
213         vconftool $GOPTION set -t bool db/setting/automatic_time_update "1"
214         vconftool $GOPTION set -t bool db/setting/dst "0"
215
216         vconftool $GOPTION set -t int db/menu_widget/regionformat_time1224 "1"
217         vconftool $GOPTION set -t int db/setting/date_format "0"
218         vconftool $GOPTION set -t int db/setting/weekofday_format  "0"
219
220         vconftool $GOPTION set -t string db/setting/timezone "+9"
221         # to be removed
222         vconftool $GOPTION set -t string db/setting/cityname_id "IDS_WCL_BODY_CITYNAME_SEOUL"
223
224         vconftool $GOPTION set -t string db/setting/timezone_id "Asia/Seoul"
225
226         #if [ -f /opt/etc/localtime ]
227         #then
228         rm -f /opt/etc/localtime
229         ln -s /usr/share/zoneinfo/Asia/Seoul /opt/etc/localtime
230         #fi
231 }
232
233 #accessibility
234 resetAccessibility()
235 {
236         vconftool $GOPTION set -t bool db/setting/accessibility/accessibility "1"
237         vconftool $GOPTION set -t bool db/setting/accessibility/high_contrast "0"
238         vconftool $GOPTION set -t bool db/setting/accessibility/screen_zoom "1"
239         vconftool $GOPTION set -t int db/setting/accessibility/font_size "72"
240         vconftool $GOPTION set -t int db/setting/accessibility/font_style "0"
241         vconftool $GOPTION set -t bool db/setting/accessibility/torch_light "0"
242         vconftool $GOPTION set -t bool db/setting/accessibility/mono_audio "0"
243         vconftool $GOPTION set -t bool db/setting/accessibility/accept_call "0"
244         vconftool $GOPTION set -t bool db/setting/accessibility/enable_auto_answer "0"
245         vconftool $GOPTION set -t int db/setting/accessibility/auto_answer "1"
246         vconftool $GOPTION set -t bool db/setting/accessibility/powerkey_end_calls "0"
247         vconftool $GOPTION set -t int db/setting/accessibility/power_key_hold "0"
248 }
249
250 #language & region
251 resetLanguageAndRegion()
252 {
253         vconftool $GOPTION set -t int db/setting/lang "2"
254         vconftool $GOPTION set -t string db/menu_widget/language "en_US.UTF-8"
255         vconftool $GOPTION set -t string db/menu_widget/regionformat "en_US.UTF-8"
256 }
257
258 #viewtype
259 resetViewtype()
260 {
261         vconftool $GOPTION set -t int db/menuscreen/viewtype "0"
262         vconftool $GOPTION set -t int db/taskswitcher/viewtype "0"
263 }
264
265 #touch
266 resetTouch()
267 {
268         vconftool $GOPTION set -t int db/setting/vib_feedback "3"
269         vconftool $GOPTION set -t bool db/setting/touch_panel_autolock "0"
270 }
271
272 #License
273 resetLicense()
274 {
275         vconftool $GOPTION set -t bool db/setting/transaction_tracking "0"
276         vconftool $GOPTION set -t bool db/setting/expiry_reminder "0"
277         vconftool $GOPTION set -t int db/setting/roaming_network "0"
278 }
279
280 #Ticker notification
281 resetNotification()
282 {
283         vconftool $GOPTION set -t bool db/setting/ticker_noti/display_content "0"
284         vconftool $GOPTION set -t bool db/setting/ticker_noti/messages "1"
285         vconftool $GOPTION set -t bool db/setting/ticker_noti/vmail "1"
286         vconftool $GOPTION set -t bool db/setting/ticker_noti/email "1"
287         #vconftool $GOPTION set -t bool db/setting/ticker_noti/recv_seven_email "0"
288         #vconftool $GOPTION set -t bool db/setting/ticker_noti/im "1"
289         #vconftool $GOPTION set -t bool db/setting/ticker_noti/osp "1"
290         vconftool $GOPTION set -t bool db/setting/ticker_noti/sns "0"
291         vconftool $GOPTION set -t bool db/setting/ticker_noti/file_tran "1"
292 }
293
294 #security
295 resetSecurity()
296 {
297         vconftool $GOPTION set -t string db/setting/phone_passwd ""
298         rm -rf /opt/data/setting/set_info
299         #vconftool $GOPTION set -t string db/setting/privacy_passwd ""
300         
301         vconftool $GOPTION set -t bool db/setting/power_on_lock "0"
302         vconftool $GOPTION set -t bool db/setting/phone_lock "0"
303         vconftool $GOPTION set -t bool db/setting/simple_password "1"
304         vconftool $GOPTION set -t bool db/setting/fmm/sim_change_alert "0"
305         vconftool $GOPTION set -t string db/setting/fmm/recipients ""
306         vconftool $GOPTION set -t string db/setting/fmm/sender ""
307         vconftool $GOPTION set -t string db/setting/fmm/alert_message ""
308         vconftool $GOPTION set -t bool db/setting/fmm/remote_control "0"
309         vconftool $GOPTION set -t bool db/setting/fmm/location_consent "0"
310         
311         # NOT USED NOW.
312         vconftool $GOPTION set -t bool db/setting/rcs "0"
313
314         vconftool $GOPTION set -t int db/setting/phone_lock_attempts_left "5"
315         vconftool $GOPTION set -t string db/setting/phone_lock_timestamp ""
316         vconftool $GOPTION set -t int db/setting/sim_lock_attempts_left "5"
317         vconftool $GOPTION set -t string db/setting/sim_lock_timestamp ""
318 }
319
320 #Memory
321 resetMemory()
322 {
323         vconftool $GOPTION set -t int db/setting/default_memory/wap "0"
324         vconftool $GOPTION set -t int db/setting/default_memory/bluetooth "0"
325         vconftool $GOPTION set -t int db/setting/default_memory/camera "0"
326         vconftool $GOPTION set -t int db/setting/default_memory/voice_recorder "0"
327         vconftool $GOPTION set -t int db/setting/default_memory/fm_radio "0"
328         vconftool $GOPTION set -t int db/setting/default_memory/all_share "0"
329         vconftool $GOPTION set -t int db/setting/default_memory/adobe_air "0"
330
331         # format - system server
332         #vconftool $GOPTION -i set -t int memory/mmc/format "0"
333 }
334
335 #about
336 resetAbout()
337 {
338         vconftool $GOPTION set -t string db/setting/device_name "Tizen"
339 }
340
341 #menu and widgets
342 resetMenuWidgets()
343 {
344         vconftool $GOPTION set -t bool db/setting/adaptive_menu_order "0"
345 }
346
347
348 ########## invoke functions #######
349
350 if [ $1 == $NETWORK ]; then
351         resetNetwork
352
353 elif [ $1 == $DATAROAMING ]; then
354         resetDataRoaming
355
356 elif [ $1 == $USBCON ]; then
357         resetUsbConnectivity
358
359 elif [ $1 == $SOUND ]; then
360         resetSound
361
362 elif [ $1 == $WALLPAPER ]; then
363         resetWallpaper
364
365 elif [ $1 == $DISPLAY ]; then
366         resetDisplay
367
368 elif [ $1 == $MOTIONS ]; then
369         resetMotions
370
371 elif [ $1 == $TILT ]; then
372         resetTilt
373
374 elif [ $1 == $PANNING ]; then
375         resetPanning
376
377 elif [ $1 == $DOUBLETAP ]; then
378         resetDoubleTap
379
380 elif [ $1 == $SHAKE ]; then
381         resetShake
382
383 elif [ $1 == $PICKUP ]; then
384         resetPickup
385
386 elif [ $1 == $TURNOVER ]; then
387         resetTurnOver
388
389 elif [ $1 == $FONT ]; then
390         resetFont
391
392 elif [ $1 == $POWERSAVING ]; then
393         resetPowersaving
394
395 elif [ $1 == $ROTATIONLOCK ]; then
396         resetRotationLock
397
398 elif [ $1 == $TIMEDATE ]; then
399         resetTimeAndData
400
401 elif [ $1 == $ACCESS ]; then
402         resetAccessibility
403
404 elif [ $1 == $LANGREGION ]; then
405         resetLanguageAndRegion
406
407 elif [ $1 == $VIEWTYPE ]; then
408         resetViewtype
409
410 elif [ $1 == $TOUCH ]; then
411         resetTouch
412
413 elif [ $1 == $LICENSE ]; then
414         resetLicense
415
416 elif [ $1 == $NOTI ]; then
417         resetNotification
418
419 elif [ $1 == $SECURITY ]; then
420         resetSecurity
421
422 elif [ $1 == $MEMORY ]; then
423         resetMemory
424
425 elif [ $1 == $ABOUT ]; then
426         resetAbout
427
428 elif [ $1 == $MENUWIDGET ]; then
429         resetMenuWidgets
430
431 else
432         resetNetwork
433         resetDataRoaming
434         resetUsbConnectivity
435         resetSound
436         resetWallpaper
437         resetMotions
438         resetDisplay
439         resetPowersaving
440         resetFont
441         resetRotationLock
442         resetTimeAndData
443         resetAccessibility
444         resetLanguageAndRegion
445         resetViewtype
446         resetTouch
447         resetLicense
448         resetNotification
449         resetSecurity
450         resetMemory
451         resetAbout
452         resetMenuWidgets
453
454         vconftool $GOPTION -i set -t int memory/setting/font_changed "0"
455         vconftool $GOPTION -i set -t int memory/mobile_hotspot/skin_changed "0"
456 fi
457
458 ########## ending #######
459
460
461 #create directory /opt/data/setting
462 if [ "${USER}" == "root" ]
463 then
464         if [ ! -d /opt/data/setting ]
465         then
466           mkdir -p /opt/data/setting
467           chown 5000:5000 /opt/data/setting -R
468         fi
469         chown 5000:5000 /opt/etc/X11/Xresources
470 fi
471 heynotitool set setting_time_changed -a
472
473 sync
474