summaryrefslogtreecommitdiff
path: root/rootdir/etc/init.camera.rc
blob: ce77064a141004af0dcfcf8718afbc82a09b0ced (plain)
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
#
# Copyright (C) 2017 The LineageOS 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.
#

on early-boot
    #SONY early boot
    start ta_qmi_service
    start sct_service

on boot
    # PM8941 flash
    chown system camera /sys/class/misc/pm8941-flash/device/current1
    chown system camera /sys/class/misc/pm8941-flash/device/current2
    chown system camera /sys/class/misc/pm8941-flash/device/fault_status
    chown system camera /sys/class/misc/pm8941-flash/device/fine_current1
    chown system camera /sys/class/misc/pm8941-flash/device/fine_current2
    chown system camera /sys/class/misc/pm8941-flash/device/flash_timer
    chown system camera /sys/class/misc/pm8941-flash/device/mask_clamp_current
    chown system camera /sys/class/misc/pm8941-flash/device/mask_enable
    chown system camera /sys/class/misc/pm8941-flash/device/max_current
    chown system camera /sys/class/misc/pm8941-flash/device/mode
    chown system camera /sys/class/misc/pm8941-flash/device/startup_delay
    chown system camera /sys/class/misc/pm8941-flash/device/strobe
    chown system camera /sys/class/misc/pm8941-flash/device/vph_pwr_droop

on post-fs-data
    # we will remap this as /mnt/sdcard with the sdcard fuse tool
    mkdir /data/misc/camera 0770 media camera
    mkdir /data/misc/cameraserver 0700 cameraserver cameraserver

    # create directory for scd
    mkdir /dev/socket/scd 0755 system system
    mkdir /data/scd 0755 system system

    # Change to socket location on libkeyctrl/suntory for /data encryption
    # Create suntory data directory
    mkdir /dev/socket/suntory 0755 system system
    mkdir /data/suntory 0755 system system

on post-fs-data
    # SONY: Start early TA-users
    mkdir /data/etc 0755 root shell
    start taimport

    # SONY: Create dir for Widevine keybox
    mkdir /data/persist/wv 0700 system system

    # SONY: Camera
    mkdir /data/camera 0770 media camera
    chown media camera /sys/devices/sony_camera_0/info

    chmod 0660 /sys/devices/sony_camera_0/info
    chown media camera /sys/devices/sony_camera_1/info
    chmod 0660 /sys/devices/sony_camera_1/info

    # SONY: Import MiscTA to System properties
    start property_taimport
    setprop init.taimport.ready true
    # taimport ready, use this as trigger for multi-cdf-symlinker

service taimport /vendor/bin/taimport
    user system
    group system
    oneshot
    disabled

service property_taimport /vendor/bin/taimport property
    user system
    group system
    oneshot
    disabled

# This script init /cache/CredentialManagerData if /data/credmgr doesn't meet our requirements
service initcredmgr /vendor/bin/credmgrfirstboot.sh
    class late_start
    user system
    group system
    oneshot

# When credmgrfirstboot is ready it set sys.credmgrdready=true.
# Start credmgrd after that
on property:sys.credmgrdready=true
    start credmgrd

# Start Credential manager daemon
service credmgrd /vendor/bin/credmgrd
    user system
    group system camera media
    socket credmgr stream 0660 system camera
    disabled

# Secure Config Transfer service
service sct_service /vendor/bin/sct_service
    user root
    disabled

# Trim Area QMI service
service ta_qmi_service /vendor/bin/ta_qmi_service
    user system
    group system net_raw wakelock
    disabled

service scd /vendor/bin/scd
    class late_start
    user system
    group system

service qcamerasvr /vendor/bin/mm-qcamera-daemon
    class main
    user camera
    group camera media system inet input graphics

on property:init.svc.media=restarting
    restart qcamerasvr

on property:init.svc.servicemanager=restarting
    restart qcamerasvr

# SONY: TrimArea Daemon
# Last 2 args: start block(blk size 128k), number of blocks(partitionsize(kb)/128(kb))
service tad_static /vendor/bin/tad_static /dev/block/bootdevice/by-name/TA 0,16
    class core
    user system
    group system camera media
    socket tad stream 0770 system system

service updatemiscta /vendor/bin/updatemiscta
    class main
    user system
    group system
    oneshot