1#
2# Copyright (C) 2024 The Android Open Source Project
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#      http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#
16
17# ADB push intro copied from lockClocks.sh
18if [ "`command -v getprop`" == "" ]; then
19    if [ -n "`command -v adb`" ]; then
20        echo ""
21        echo "Pushing $0 and running it on device..."
22        dest=/data/local/tmp/`basename $0`
23        adb push $0 ${dest}
24        adb shell ${dest} $@
25        # adb shell rm ${dest} # will fail, not very important
26        exit
27    else
28        echo "Could not find adb. Options are:"
29        echo "  1. Ensure adb is on your \$PATH"
30        echo "  2. Manually adb push this script to your device, and run it there"
31        exit -1
32    fi
33fi
34
35DEVICE=`getprop ro.product.device`
36echo ""
37echo "Rebooting $DEVICE, and resetting animation scales!"
38echo "This will re-lock clocks, reenable JIT, and reset animation scale to 1.0"
39
40settings put global window_animation_scale 1.0
41settings put global transition_animation_scale 1.0
42settings put global animator_duration_scale 1.0
43
44reboot # required to relock clocks, and handles reenabling jit since the property won't persist
45