Tizen 2.0 Release
[apps/home/settings.git] / debian / com.samsung.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 FLIGHTMODE="flightmode"
14 NETWORK="network"
15 USBCON="usbconnectivity"
16
17 SOUND="sounds"
18 WALLPAPER="wallpaper"
19 DISPLAY="display"
20
21 MOTIONS="motions"
22 TILT_ZOOM="tilt_zoom"
23 TILT_SCROLL="tilt_scroll"
24 PANNING_MOVE="panning_move"
25 PANNING_BROWSER="panning_browser"
26 DOUBLETAP="double_tap"
27 TURNOVER="turn_over"
28 SHAKE="shake"
29 PICKUP_NOTIFIED="pickup_notified"
30 PICKUP_CALL="pickup_call"
31
32 POWERSAVING="powersaving"
33 FONT="font"
34 ROTATIONLOCK="rotationLock"
35 TIMEDATE="timeAndData"
36 ACCESS="accessibility"
37 LANGREGION="language"
38 VIEWTYPE="viewtype"
39 TOUCH="touch"
40 LICENSE="license"
41
42 NOTI="notification"
43 SECURITY="security"
44 MEMORY="memory"
45 ABOUT="about"
46 MENUWIDGET="menuwidget"
47 MENUSCREEN="menuscreen"
48
49 resetMenuscreen()
50 {
51         #vconftool $GOPTION set -t string db/setting/menuscreen/selected "com.samsung.cluster-home"
52         vconftool $GOPTION set -t string db/setting/menuscreen/package_name "com.samsung.menu-screen"
53 }
54
55 #$ECHO $GOPTION
56
57 #Flightmode
58 resetFlightmode()
59 {
60         vconftool $GOPTION set -t bool db/setting/flight_mode "0"
61 }
62
63 #network
64 resetNetwork()
65 {
66         vconftool $GOPTION set -t int db/setting/select_network "0"
67         vconftool $GOPTION set -t int db/setting/network_mode "0"
68         vconftool $GOPTION set -t bool db/setting/3gEnabled "1"
69         vconftool $GOPTION set -t bool db/setting/data_roaming "1"
70 }
71
72 #UsbConnectivity
73 resetUsbConnectivity()
74 {
75         vconftool $GOPTION set -t int memory/setting/usb_mode "-1" -i -f
76         vconftool $GOPTION set -t int memory/setting/usb_sel_mode "0" -i -f
77         vconftool $GOPTION set -t int memory/setting/usb_in_mode_change "0" -i -f
78 }
79
80 #sound profiles
81 resetSound()
82 {
83         DEFAULT_CALL_TONE="/opt/share/settings/Ringtones/Over the horizon.mp3"
84         DEFAULT_NOTI_TONE="/opt/share/settings/Alerts/Whistle.mp3"
85         DEFAULT_MEDIA_TONE="/opt/share/settings/Previews/Over the horizon.mp3"
86
87         vconftool $GOPTION set -t bool db/setting/sound/sound_on "1"
88         vconftool $GOPTION set -t bool db/setting/sound/vibration_on "1"
89
90         vconftool $GOPTION set -t int db/setting/sound/call/ringtone_sound_volume "13"
91         vconftool $GOPTION set -t int db/setting/sound/noti/sound_volume "7"
92         vconftool $GOPTION set -t int db/setting/sound/media/sound_volume "7"
93         vconftool $GOPTION set -t int db/setting/sound/touch_feedback/sound_volume "5"
94
95         vconftool $GOPTION set -t int db/setting/sound/noti/vibration_level "5"
96         vconftool $GOPTION set -t int db/setting/sound/touch_feedback/vibration_level "3"
97         vconftool $GOPTION set -t int db/setting/sound/touch_feedback/vibration_level_bak "3" ##private key
98
99         vconftool $GOPTION set -t string db/setting/sound/call/ringtone_path "${DEFAULT_CALL_TONE}"
100         vconftool $GOPTION set -t int db/setting/sound/call/vibration_type "2"
101
102         vconftool $GOPTION set -t string db/setting/sound/noti/msg_ringtone_path        "${DEFAULT_NOTI_TONE}"
103         vconftool $GOPTION set -t int db/setting/sound/noti/msg_alert_rep_type          "0"
104
105         vconftool $GOPTION set -t string db/setting/sound/noti/email_ringtone_path      "${DEFAULT_NOTI_TONE}"
106         vconftool $GOPTION set -t int db/setting/sound/noti/email_alert_rep_type                "0"
107
108         vconftool $GOPTION set -t bool db/setting/sound/sound_lock "1"
109 }
110
111 #wallpaper
112 resetWallpaper()
113 {
114         vconftool $GOPTION set -t string db/menu_widget/bgset "/opt/share/settings/Wallpapers/Home_default.jpg"
115         vconftool $GOPTION set -t string db/idle_lock/bgset "/opt/share/settings/Wallpapers/Home_default.jpg"
116 }
117
118 #motions
119 resetTiltZoom()
120 {
121         vconftool $GOPTION set -t bool db/setting/use_tilt "1"
122         vconftool $GOPTION set -t int db/setting/tilt_sensitivity "3"
123 }
124 resetTiltScroll()
125 {
126         vconftool $GOPTION set -t bool db/setting/use_tilt_scroll "1"
127         vconftool $GOPTION set -t int db/setting/tilt_scroll_sensitivity "3"
128 }
129
130 resetPanningMove()
131 {
132         vconftool $GOPTION set -t bool db/setting/use_panning "1"
133         vconftool $GOPTION set -t int db/setting/panning_sensitivity "3"
134 }
135 resetPanningBrowser()
136 {
137         vconftool $GOPTION set -t bool db/setting/use_panning_browser "1"
138         vconftool $GOPTION set -t int db/setting/panning_browser_sensitivity "3"
139 }
140 resetDoubleTap()
141 {
142         vconftool $GOPTION set -t bool db/setting/use_double_tap "1"
143 }
144
145 resetShake()
146 {
147         vconftool $GOPTION set -t bool db/setting/use_shake "1"
148 }
149 resetPickupNotified()
150 {
151         vconftool $GOPTION set -t bool db/setting/use_pick_up "1"
152 }
153 resetPickupCall()
154 {
155         vconftool $GOPTION set -t bool db/setting/use_pick_up_call "1"
156 }
157
158 resetTurnOver()
159 {
160         vconftool $GOPTION set -t bool db/setting/use_turn_over "1"
161 }
162
163 resetMotions()
164 {
165         vconftool $GOPTION set -t bool db/setting/motion_active "1"
166         vconftool $GOPTION set -t bool db/setting/motion/palm_swipe_capture "1"
167         vconftool $GOPTION set -t bool db/setting/motion/palm_touch_mute "1"
168
169         resetTiltZoom
170         resetTiltScroll
171         resetPanningMove
172         resetPanningBrowser
173         resetDoubleTap
174         resetTurnOver
175         resetShake
176         resetPickupNotified
177         resetPickupCall
178 }
179
180 #display and light
181 resetDisplay()
182 {
183         #backlight
184         vconftool $GOPTION set -t int db/setting/lcd_backlight_normal "30"
185         #vconftool $GOPTION set -t int db/setting/lcd_timeout_normal_backup "30"
186
187         #brightness
188         vconftool $GOPTION set -t int db/setting/Brightness "-1"
189         vconftool $GOPTION set -t int db/setting/brightness_automatic "0"
190
191         #battery
192         vconftool $GOPTION set -t bool db/setting/battery_percentage "0"
193         #launch
194         #vconftool $GOPTION set -t string db/menu_widget/launch_effect "0"
195 }
196
197 resetPowersaving()
198 {
199         vconftool $GOPTION set -t bool db/setting/pwrsv/system_mode/status "1"
200         vconftool $GOPTION set -t bool db/setting/pwrsv/system_mode/reminder "1"
201         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/status "0"
202
203         vconftool $GOPTION set -t int db/setting/pwrsv/custom_mode/at "30"
204         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/wifi "1"
205         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/bt "1"
206         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/gps "1"
207         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/data_sync "1"
208         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/hotspot "1"
209
210         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/brt/status  "1"
211         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/brt/auto/status "0"
212         vconftool $GOPTION set -t int db/setting/pwrsv/custom_mode/brt/value "10"
213         vconftool $GOPTION set -t int db/setting/pwrsv/custom_mode/backlight/time "15"
214
215         #v0.4
216         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/cpu "0"
217         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/display "0"
218         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/bg_color "0"
219         vconftool $GOPTION set -t bool db/setting/pwrsv/custom_mode/screen_vib "0"
220 }
221
222 #font
223 resetFont()
224 {
225         vconftool $GOPTION set -t int db/setting/font_size "1"
226         vconftool $GOPTION set -t int db/setting/font_type "0"
227 }
228
229 #RotationLock
230 resetRotationLock()
231 {
232         vconftool $GOPTION set -t bool db/setting/rotate_lock "1"
233 }
234
235 #time and date (zone)
236 resetTimeAndData()
237 {
238         vconftool $GOPTION set -t bool db/setting/automatic_time_update "1"
239
240         vconftool $GOPTION set -t int db/menu_widget/regionformat_time1224 "1"
241         vconftool $GOPTION set -t int db/setting/date_format "0"
242         vconftool $GOPTION set -t int db/setting/weekofday_format  "0"
243
244         vconftool $GOPTION set -t string db/setting/timezone "+9"
245         # to be removed
246         vconftool $GOPTION set -t string db/setting/cityname_id "IDS_WCL_BODY_CITYNAME_SEOUL"
247
248         vconftool $GOPTION set -t string db/setting/timezone_id "Asia/Seoul"
249
250         #if [ -f /opt/etc/localtime ]
251         #then
252         rm -f /opt/etc/localtime
253         ln -s /usr/share/zoneinfo/Asia/Seoul /opt/etc/localtime
254         #fi
255 }
256
257 #accessibility
258 resetAccessibility()
259 {
260         vconftool $GOPTION set -t bool db/setting/accessibility/accessibility "0"
261         vconftool $GOPTION set -t bool db/setting/accessibility/high_contrast "0"
262         vconftool $GOPTION set -t bool db/setting/accessibility/screen_zoom "1"
263         vconftool $GOPTION set -t int db/setting/accessibility/font_size "1"
264         #vconftool $GOPTION set -t int db/setting/accessibility/font_style "0"
265         vconftool $GOPTION set -t bool db/setting/accessibility/torch_light "0"
266         vconftool $GOPTION set -t bool db/setting/accessibility/mono_audio "0"
267         vconftool $GOPTION set -t int db/setting/accessibility/power_key_hold "1"
268         vconftool $GOPTION set -t bool db/setting/accessibility/led_notify "0"
269
270         vconftool $GOPTION set -t bool db/ciss/call_answering_key "0"
271         vconftool $GOPTION set -t bool db/ciss/call_power_key_ends_call "0"
272         vconftool $GOPTION set -t int db/ciss/answering_mode "0"
273         vconftool $GOPTION set -t int db/ciss/answering_mode_time "3"
274
275         vconftool $GOPTION set -t bool db/setting/accessibility/accept_call "0"
276         vconftool $GOPTION set -t bool db/setting/accessibility/enable_auto_answer "0"
277         vconftool $GOPTION set -t int db/setting/accessibility/auto_answer "1"
278         vconftool $GOPTION set -t bool db/setting/accessibility/powerkey_end_calls "0"
279
280 }
281
282 #language & region
283 resetLanguageAndRegion()
284 {
285         vconftool $GOPTION set -t int db/setting/lang "2"
286         vconftool $GOPTION set -t string db/menu_widget/language "en_US.UTF-8"
287         vconftool $GOPTION set -t string db/menu_widget/regionformat "en_US.UTF-8"
288 }
289
290 #viewtype
291 #resetViewtype()
292 #{
293         #vconftool $GOPTION set -t int db/menuscreen/viewtype "0"
294         #vconftool $GOPTION set -t int db/taskswitcher/viewtype "0"
295 #}
296
297 #License
298 resetLicense()
299 {
300         vconftool $GOPTION set -t bool db/setting/transaction_tracking "0"
301         vconftool $GOPTION set -t bool db/setting/expiry_reminder "0"
302         vconftool $GOPTION set -t int db/setting/roaming_network "0"
303 }
304
305 #Ticker notification
306 resetNotification()
307 {
308         vconftool $GOPTION set -t bool db/setting/ticker_noti/messages "1"
309         vconftool $GOPTION set -t bool db/setting/ticker_noti/email "1"
310         vconftool $GOPTION set -t bool db/setting/ticker_noti/im "1"
311         vconftool $GOPTION set -t bool db/setting/ticker_noti/twitter "1"
312         vconftool $GOPTION set -t bool db/setting/ticker_noti/facebook "1"
313
314         # display content
315         vconftool $GOPTION set -t bool db/setting/ticker_noti/display_content/messages "1"
316         vconftool $GOPTION set -t bool db/setting/ticker_noti/display_content/email "1"
317         vconftool $GOPTION set -t bool db/setting/ticker_noti/display_content/im "1"
318         vconftool $GOPTION set -t bool db/setting/ticker_noti/display_content/twitter "1"
319         vconftool $GOPTION set -t bool db/setting/ticker_noti/display_content/facebook "1"
320
321         vconftool $GOPTION set -t bool db/setting/ticker_noti/badge/messages "1"
322         vconftool $GOPTION set -t bool db/setting/ticker_noti/badge/email "1"
323         vconftool $GOPTION set -t bool db/setting/ticker_noti/badge/im "1"
324         vconftool $GOPTION set -t bool db/setting/ticker_noti/badge/twitter "1"
325         vconftool $GOPTION set -t bool db/setting/ticker_noti/badge/facebook "1"
326 }
327
328 #security
329 resetSecurity()
330 {
331         rm -rf /opt/data/setting/set_info
332
333         vconftool $GOPTION set -t bool db/setting/power_on_lock "0"
334         vconftool $GOPTION set -t bool db/setting/simple_password "1"
335         vconftool $GOPTION set -t bool db/setting/fmm/sim_change_alert "0"
336         vconftool $GOPTION set -t string db/setting/fmm/recipients ""
337         vconftool $GOPTION set -t string db/setting/fmm/sender ""
338         vconftool $GOPTION set -t string db/setting/fmm/alert_message ""
339         vconftool $GOPTION set -t bool db/setting/fmm/remote_control "0"
340         vconftool $GOPTION set -t bool db/setting/fmm/location_consent "0"
341
342         # NOT USED NOW.
343         #vconftool $GOPTION set -t bool db/setting/rcs "0"
344
345         vconftool $GOPTION set -t int db/setting/phone_lock_attempts_left "5"
346         vconftool $GOPTION set -t string db/setting/phone_lock_timestamp ""
347         vconftool $GOPTION set -t int db/setting/sim_lock_attempts_left "5"
348         vconftool $GOPTION set -t string db/setting/sim_lock_timestamp ""
349
350         vconftool $GOPTION set -t bool db/setting/fixed_dialing_mode "0"
351 }
352
353 #Memory
354 resetMemory()
355 {
356         vconftool $GOPTION set -t int db/setting/default_memory/wap "0"
357         vconftool $GOPTION set -t int db/setting/default_memory/bluetooth "0"
358         vconftool $GOPTION set -t int db/setting/default_memory/camera "0"
359         vconftool $GOPTION set -t int db/setting/default_memory/voice_recorder "0"
360         vconftool $GOPTION set -t int db/setting/default_memory/fm_radio "0"
361         vconftool $GOPTION set -t int db/setting/default_memory/all_share "0"
362         vconftool $GOPTION set -t int db/setting/default_memory/adobe_air "0"
363         vconftool $GOPTION set -t int db/setting/default_memory/dvb_h "0"
364
365         # format - system server
366         #vconftool $GOPTION -i set -t int memory/mmc/format "0"
367 }
368
369 #about
370 resetAbout()
371 {
372         vconftool $GOPTION set -t string db/setting/device_name "Redwood"
373 }
374
375 ########## invoke functions #######
376
377 if [ $1 == $FLIGHTMODE ]; then
378         resetFlightmode
379
380 elif [ $1 == $NETWORK ]; then
381         resetNetwork
382
383 elif [ $1 == $USBCON ]; then
384         resetUsbConnectivity
385
386 elif [ $1 == $SOUND ]; then
387         resetSound
388
389 elif [ $1 == $WALLPAPER ]; then
390         resetWallpaper
391
392 elif [ $1 == $DISPLAY ]; then
393         resetDisplay
394
395 elif [ $1 == $MOTIONS ]; then
396         resetMotions
397
398 elif [ $1 == $TILT_ZOOM ]; then
399         resetTiltZoom
400
401 elif [ $1 == $TILT_SCROLL ]; then
402         resetTiltScroll
403
404 elif [ $1 == $PANNING_MOVE ]; then
405         resetPanningMove
406
407 elif [ $1 == $PANNING_BROWSER ]; then
408         resetPanningBrowser
409
410 elif [ $1 == $DOUBLETAP ]; then
411         resetDoubleTap
412
413 elif [ $1 == $SHAKE ]; then
414         resetShake
415
416 elif [ $1 == $PICKUP_NOTIFIED ]; then
417         resetPickupNotified
418
419 elif [ $1 == $PICKUP_CALL ]; then
420         resetPickupCall
421
422 elif [ $1 == $TURNOVER ]; then
423         resetTurnOver
424
425 elif [ $1 == $FONT ]; then
426         resetFont
427
428 elif [ $1 == $POWERSAVING ]; then
429         resetPowersaving
430
431 elif [ $1 == $ROTATIONLOCK ]; then
432         resetRotationLock
433
434 elif [ $1 == $TIMEDATE ]; then
435         resetTimeAndData
436
437 elif [ $1 == $ACCESS ]; then
438         resetAccessibility
439
440 elif [ $1 == $LANGREGION ]; then
441         resetLanguageAndRegion
442
443 #elif [ $1 == $VIEWTYPE ]; then
444 #       resetViewtype
445
446 elif [ $1 == $LICENSE ]; then
447         resetLicense
448
449 elif [ $1 == $NOTI ]; then
450         resetNotification
451
452 elif [ $1 == $SECURITY ]; then
453         resetSecurity
454
455 elif [ $1 == $MEMORY ]; then
456         resetMemory
457
458 elif [ $1 == $ABOUT ]; then
459         resetAbout
460
461 elif [ $1 == $MENUSCREEN ]; then
462         resetMenuscreen
463 else
464         resetFlightmode
465         resetNetwork
466         resetUsbConnectivity
467         resetSound
468         resetWallpaper
469         resetMotions
470         resetDisplay
471         resetPowersaving
472         resetFont
473         resetRotationLock
474         resetTimeAndData
475         resetAccessibility
476         resetLanguageAndRegion
477 #       resetViewtype
478         resetLicense
479         resetNotification
480         resetSecurity
481         resetMemory
482         resetAbout
483         resetMenuscreen
484
485         vconftool $GOPTION -i set -t int memory/setting/font_changed "0"
486         #vconftool $GOPTION -i set -t int memory/mobile_hotspot/skin_changed "0"
487 fi
488
489 ########## ending #######
490
491
492 #create directory /opt/data/setting
493 if [ "${USER}" == "root" ]
494 then
495         if [ ! -d /opt/data/setting ]
496         then
497           mkdir -p /opt/data/setting
498         fi
499
500 #       if [ -f /opt/data/setting/setting.cfg ]
501 #       then
502 #               rm -rf /opt/data/setting/setting.cfg
503 #       fi
504         chown 5000:5000 /opt/data/setting -R
505 fi
506
507 #heynotitool set setting_time_changed -a
508 sync
509