blob: 2cf801bfc6a46c933bac1d14d0bde1381afbd3a5 (
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
|
#!/bin/sh --
# Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
# All Rights Reserved.
# Confidential and Proprietary - Qualcomm Technologies, Inc.
ril_db="/data/vendor/radio/qcrilNr.db"
help() {
echo "Syntax error! Example: qtigetprop [config_name]"
}
if [ $# -gt 1 ]; then
help
exit 1
elif [ $# -eq 1 ]; then
prop_name=$1
fi
# Disable exit on non 0
set +e
if [[ ! -f $ril_db ]]; then
getprop "$@"
else
if [ ! -z "$prop_name" ]; then
query_result=`echo "SELECT 1 FROM qcril_properties_table WHERE property='$prop_name';" | sqlite3 $ril_db`
if [[ $query_result == "1" ]]; then
result=`echo "SELECT value FROM qcril_properties_table WHERE property='$1';" | sqlite3 $ril_db`
if [ "$result" == "" ]; then
echo "SELECT def_val FROM qcril_properties_table WHERE property='$1';" | sqlite3 $ril_db
else
echo $result
fi
else
getprop $prop_name
fi
else
# print RIL configs
echo "SELECT * FROM qcril_properties_table;" | sqlite3 $ril_db | awk -F '|' '{
if ($3=="")
print "["$1"]: ["$2"]";
else
print "["$1"]: ["$3"]";
}'
# print Android properties
getprop 2>/dev/null || true
fi
fi
|