dump_gti: fix I/O error when touch fails to resume am: 476373ef30

Original change: https://googleplex-android-review.googlesource.com/c/device/google/gs-common/+/24023803

Change-Id: I8e6b7bbfcd1170aee405036d145dbcd088de5145
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Wendly Li 2023-07-14 07:01:14 +00:00 committed by Automerger Merge Worker
commit 2ae11ae84f
2 changed files with 40 additions and 2 deletions

View File

@ -9,7 +9,26 @@ heatmap_path=$path
fi
echo "------ Force Touch Active ------"
result=$( cat "$path/force_active" 2>&1 )
if [ $? -eq 0 ]; then
state=$( echo "$result" |cut -d " " -f 2 )
if [ "$state" = "locked" ]; then
echo "The force_active is already locked!"
else
echo 1 > $path/force_active
if [ $? -ne 0 ]; then
echo "Failed to active touch device"
exit 1
fi
fi
else
if [[ $result == *Operation\ not\ supported* ]]; then
echo "force_active is not support, skip it"
else
echo "Failed to read the state of force_force"
exit 1
fi
fi
echo "------ Touch Firmware Version ------"
cat $path/fw_ver

View File

@ -9,7 +9,26 @@ heatmap_path=$path
fi
echo "------ Force Touch Active ------"
result=$( cat "$path/force_active" 2>&1 )
if [ $? -eq 0 ]; then
state=$( echo "$result" |cut -d " " -f 2 )
if [ "$state" = "locked" ]; then
echo "The force_active is already locked!"
else
echo 1 > $path/force_active
if [ $? -ne 0 ]; then
echo "Failed to active touch device"
exit 1
fi
fi
else
if [[ $result == *Operation\ not\ supported* ]]; then
echo "force_active is not support, skip it"
else
echo "Failed to read the state of force_force"
exit 1
fi
fi
echo "------ Touch Firmware Version ------"
cat $path/fw_ver