1#!/bin/bash
2
3parseoptions() {
4    verbose=false
5    user_experience=false
6    little_cores_off=false
7    iterations=0
8    pagecached=false
9
10    adb="adb"
11    while [ $# -gt 1 ]
12    do
13        case $1 in
14            -a)
15                ;;
16            -b)
17                little_cores_off=true
18                ;;
19            -c)
20                pagecached=true
21                ;;
22            -h)
23                usage
24                ;;
25            -s)
26                if [ -z "$2" ]; then
27                    usage
28                fi
29                adb="adb -s $2"
30                shift
31                ;;
32            -u)
33                user_experience=true
34                ;;
35            -v)
36                verbose=true
37                ;;
38            *)
39                usage
40                ;;
41            esac
42        shift
43    done
44
45    iterations=$1
46    if [ "$iterations" -lt 100 ]; then
47        usage
48    fi
49}
50
51getstats () {
52    infile=$1
53    app=$2
54    echo "Data for $app :"
55
56    # Activity Manager reports ThisTime and TotalTime. TotalTime seems to be
57    # a more measure of the launch from the users perspective. So using TotalTime
58    # as our metric for launch latency
59
60    # From Activity Manager
61    echo "Launch Time (TotalTime) :"
62    grep -F TotalTime "$infile" | awk '{print $2}' | computestats
63
64    # Data from simpleperf
65    echo "cpu-cycles :"
66    grep -F cpu-cycles "$infile" | awk '{print $1}' | sed s/,//g | computestats
67
68    # CPU util% Data from /proc/stat
69    echo "cpu-util% :"
70    grep -F 'Total CPU util' "$infile" | awk '{print $5}' | computestatsf
71    echo "user-cpu-util% :"
72    grep -F 'User CPU util' "$infile" | awk '{print $5}' | computestatsf
73    echo "sys-cpu-util% (incl hardirq/softirq) :"
74    grep -F 'Sys CPU util' "$infile" | awk '{print $5}' | computestatsf
75
76    if [ $verbose == true ]; then
77        echo "instructions : "
78        grep -F instructions "$infile" | awk '{print $1}' | sed s/,//g | computestats
79
80        echo "cycles per instruction : "
81        grep -F instructions "$infile" | awk '{print $4}' | sed s/,//g | computestatsf
82
83        echo "branch-misses : "
84        grep -F branch-misses "$infile" | awk '{print $1}' | sed s/,//g | computestats
85
86        echo "context-switches : "
87        grep -F context-switches "$infile" | awk '{print $1}' | sed s/,//g | computestats
88
89        echo "page-faults : "
90        grep -F page-faults "$infile" | awk '{print $1}' | sed s/,//g | computestats
91    fi
92
93    if [ "$system_bdev_set" == true ]; then
94        # (Storage) Data from /proc we've collected
95        echo "KB read for $system_block_device blkdev :"
96        grep -F KB "$infile" | grep system | awk '{print $5}' | computestats
97
98        echo "iowait% :"
99        grep -F IOwait "$infile" | awk '{print $3}' | computestatsf
100
101        echo "Device util% for $system_block_device blkdev :"
102        grep -F 'Device util' "$infile" | awk '{print $4}' | computestatsf
103    fi
104}
105
106cpufreq_volantis() {
107    echo "Setting Governor to performance"
108    if [ $little_cores_off == true ]; then
109        echo "Cannot turn off Little cores on $model"
110        exit 1
111    fi
112    i=0
113    num_cores=2
114    while [ $i -lt  $num_cores ]
115    do
116        $adb shell "echo performance  > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_g\
117overnor"
118        $adb shell "echo 2499000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_fr\
119eq"
120        i=$((i + 1))
121    done
122    # Lock the GPU frequencies
123    echo -n 852000000 > /d/clock/override.gbus/rate
124    echo -n 1 > /d/clock/override.gbus/state
125}
126
127cpufreq_fugu() {
128    echo "Setting Governor to performance"
129    if [ $little_cores_off == true ]; then
130        echo "Cannot turn off Little cores on $model"
131        exit 1
132    fi
133    i=0
134    num_cores=4
135    while [ $i -lt  $num_cores ]
136    do
137        $adb shell "echo performance  > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
138        $adb shell "echo 1833000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
139        i=$((i + 1))
140    done
141}
142
143cpufreq_taimen_walleye () {
144    echo "Setting Governor to performance"
145    # GPU Governor and Frequency
146    $adb shell 'echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor'
147    $adb shell 'echo 624000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq'
148    if [ $little_cores_off == true ]; then
149        # Disable Little Cores, force app to run on big cores
150        echo "Disabling Little Cores"
151        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu0/online'
152        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu1/online'
153        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu2/online'
154        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu3/online'
155    else
156        echo "Enabling All Cores"
157        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu0/online'
158        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu1/online'
159        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu2/online'
160        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu3/online'
161        $adb shell 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
162        $adb shell 'echo 1900800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'
163    fi
164    # Set Governor to performance, up scaling_max_frequency to highest
165    $adb shell 'echo performance  > /sys/devices/system/cpu/cpu4/cpufreq/scaling_governor'
166    # Only necessary to set max_freq on cpu4, cpu5-7 are in same cluster and will
167    # automatically get the same settings
168    $adb shell 'echo 2457600 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq'
169}
170
171cpufreq_marlin_sailfish () {
172    echo "Setting Governor to performance"
173    # GPU Governor and Frequency
174    $adb shell 'echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor'
175    $adb shell 'echo 624000000 > /sys/class/kgsl/kgsl-3d0/devfreq/max_freq'
176    if [ $little_cores_off == true ]; then
177        # Disable Little Cores, force app to run on big cores
178        echo "Disabling Little Cores"
179        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu0/online'
180        $adb shell 'echo 0 > /sys/devices/system/cpu/cpu1/online'
181    else
182        echo "Enabling All Cores"
183        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu0/online'
184        $adb shell 'echo 1 > /sys/devices/system/cpu/cpu1/online'
185        $adb shell 'echo performance > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor'
186        $adb shell 'echo 1996800 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq'
187        # cpu1 needed ?
188        $adb shell 'echo performance > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'
189        $adb shell 'echo 1996800 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq'
190    fi
191    # Set Governor to performance, up scaling_max_frequency to highest
192    $adb shell 'echo performance  > /sys/devices/system/cpu/cpu2/cpufreq/scaling_governor'
193    # Only necessary to set max_freq on cpu2, cpu3 is in same cluster and will
194    # automatically get the same settings
195    $adb shell 'echo 2150400 > /sys/devices/system/cpu/cpu2/cpufreq/scaling_max_freq'
196}
197
198cpufreq_angler () {
199    echo "Setting Governor and Frequency"
200    # GPU Governor and Frequency
201    $adb shell "echo performance > /sys/class/kgsl/kgsl-3d0/devfreq/governor"
202    $adb shell "echo 0 > /sys/class/kgsl/kgsl-3d0/bus_split"
203    $adb shell "echo 1 > /sys/class/kgsl/kgsl-3d0/force_clk_on"
204    $adb shell "echo 10000 > /sys/class/kgsl/kgsl-3d0/idle_timer"
205    if [ $little_cores_off == true ]; then
206        # Disable Little Cores, force app to run on big cores
207        echo "Disabling Little Cores"
208        i=0
209        num_cores=4
210        while [ $i -lt $num_cores ]
211        do
212            $adb shell "echo 0 > /sys/devices/system/cpu/cpu$i/online"
213            i=$((i + 1))
214        done
215    else
216        echo "Enabling All Cores"
217        # Enable Little cores here, set governor to performance
218        # Lock frequency of little cores
219        i=0
220        num_cores=4
221        while [ $i -lt $num_cores ]
222        do
223            $adb shell "echo 1 > /sys/devices/system/cpu/cpu$i/online"
224            $adb shell "echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
225            # Lock frequency of little cores
226            $adb shell "echo 1555200 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
227            i=$((i + 1))
228        done
229    fi
230    i=4
231    num_cores=8
232    while [ $i -lt $num_cores ]
233    do
234        $adb shell "echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
235        # Lock frequency of big cores
236        $adb shell "echo 1958400 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
237        i=$((i + 1))
238    done
239}
240
241cpufreq_go() {
242    echo "Setting Governor to performance"
243    $adb shell 'echo 0 > /proc/hps/enabled'
244    for i in 0 1 2 3
245    do
246	$adb shell "echo 1 > /sys/devices/system/cpu/cpu$i/online"
247	$adb shell "echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor"
248	$adb shell "echo 1092000 > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_max_freq"
249    done
250}
251
252get_taimen_walleye_devnames () {
253    # This bit of code required to get the block dev for /system and /vendor
254    # Suffix can be _a or _b, depending on what the active /system partition is
255#    suffix=`$adb shell getprop ro.boot.slot_suffix`
256    # Get the blockdevice using the suffix we got above
257#    system_block_device=`$adb shell ls -l /dev/block/platform/soc/*ufs*/by-name/system$suffix | awk '{ print $10 }' `
258    # Vendor is more straightforward, but we don't use it right now
259#    vendor_block_device=`$adb shell df /vendor | grep -v Filesystem | awk '{print $1}' `
260    # finally extract the last component of the absolute device pathname we got above
261#    system_block_device=`echo $system_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
262#    vendor_block_device=`echo $vendor_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
263    system_bdev_set=true
264#   For now, hardcode sda for Marlin/Sailfish block device
265#   XXX - We'll get stats for entire device
266    system_block_device=sda
267    echo Block Device $system_block_device
268}
269
270#
271# This strange bit of logic is needed to get the underlying block devices for /system
272# for Marlin/Sailfish
273#
274get_marlin_sailfish_devnames () {
275    # This bit of code required to get the block dev for /system and /vendor
276    # Suffix can be _a or _b, depending on what the active /system partition is
277#    suffix=`$adb shell getprop ro.boot.slot_suffix`
278    # Get the blockdevice using the suffix we got above
279#    system_block_device=`$adb shell ls -l /dev/block/platform/soc/*ufs*/by-name/system$suffix | awk '{ print $10 }' `
280    # Vendor is more straightforward, but we don't use it right now
281#    vendor_block_device=`$adb shell df /vendor | grep -v Filesystem | awk '{print $1}' `
282    # finally extract the last component of the absolute device pathname we got above
283#    system_block_device=`echo $system_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
284#    vendor_block_device=`echo $vendor_block_device | awk 'BEGIN { FS ="/" } ; { print $4 }' `
285    system_bdev_set=true
286#   For now, hardcode sda for Marlin/Sailfish block device
287#   XXX - We'll get stats for entire device
288    system_block_device=sda
289    echo Block Device $system_block_device
290}
291
292get_angler_devnames () {
293    # Get the underlying bdev from the "by-name" mapping
294    system_block_device=$($adb shell 'find /dev/block/platform -name by-name | xargs ls -l' | grep system | awk '{ print $10 }')
295    # extract the last component of the absolute device pathname we got above
296    system_block_device=$(echo "$system_block_device" | awk 'BEGIN { FS ="/" } ; { print $4 }')
297    # vendor is unused right now, but get the bdev anyway in case we decide to use it
298    # Get the underlying bdev from the "by-name" mapping
299    vendor_block_device=$($adb shell 'find /dev/block/platform -name by-name | xargs ls -l' | grep vendor | awk '{ print $10 }')
300    # extract the last component of the absolute device pathname we got above
301    vendor_block_device=$(echo "$vendor_block_device" | awk 'BEGIN { FS ="/" } ; { print $4 }')
302    system_bdev_set=true
303}
304
305get_fugu_devnames () {
306    system_block_device=$($adb shell ls -l /dev/block/by-name/system | awk '{ print $10 }')
307    system_block_device=$(echo "$system_block_device" | awk 'BEGIN { FS ="/" } ; { print $4 }')
308    system_bdev_set=true
309}
310
311dev_name_default_mmc () {
312    system_block_device=mmcblk0
313    system_bdev_set=true
314}
315
316get_volantis_devnames () {
317    dev_name_default_mmc
318}
319
320get_go_devnames () {
321    dev_name_default_mmc
322}
323
324system_stats_before() {
325    if [ $system_bdev_set == true ]; then
326        # Get BEFORE read stats for /system
327        system=$($adb shell 'cat /proc/diskstats' | grep -w $system_block_device)
328        BEFORE_RD_IOS_SYSTEM=$(echo "$system" | awk '{ print $4 }')
329        BEFORE_RD_SECTORS_SYSTEM=$(echo "$system" | awk '{ print $6 }')
330        # iowait% computation
331        procstat=$($adb shell 'cat /proc/stat' | grep -w cpu)
332        user_ticks_before=$(echo "$procstat" | awk '{ print ($2 + $3) }')
333        sys_ticks_before=$(echo "$procstat" | awk '{ print ($4 + $7 + $8) }')
334        cpubusy_ticks_before=$(echo "$procstat" | awk '{ print ($2 + $3 + $4 + $7 + $8) }')
335        iowait_ticks_before=$(echo "$procstat" | awk '{ print $6 }')
336        total_ticks_before=$(echo "$procstat" | awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }')
337        # Device util% computation
338        uptime=$($adb shell 'cat /proc/uptime')
339        uptime_before_ms=$(echo "$uptime" | awk '{ print ($1 * 1000) }')
340        device_util_before_ms=$(echo "$system" | awk '{ print ($13) }')
341    fi
342}
343
344system_stats_after() {
345    if [ $system_bdev_set == true ]; then
346        # Get AFTER read stats for /system
347        system=$($adb shell 'cat /proc/diskstats' | grep -w $system_block_device)
348        AFTER_RD_IOS_SYSTEM=$(echo "$system" | awk '{ print $4 }')
349        AFTER_RD_SECTORS_SYSTEM=$(echo "$system" | awk '{ print $6 }')
350        # iowait% computation
351        procstat=$($adb shell 'cat /proc/stat' | grep -w cpu)
352        user_ticks_after=$(echo "$procstat" | awk '{ print ($2 + $3) }')
353        sys_ticks_after=$(echo "$procstat" | awk '{ print ($4 + $7 + $8) }')
354        cpubusy_ticks_after=$(echo "$procstat" | awk '{ print ($2 + $3 + $4 + $7 + $8) }')
355        iowait_ticks_after=$(echo "$procstat" | awk '{ print $6 }')
356        total_ticks_after=$(echo "$procstat" | awk '{ print ($2 + $3 + $4 + $5 + $7 + $8) }')
357        # Device util% computation
358        uptime=$($adb shell 'cat /proc/uptime')
359        uptime_after_ms=$(echo "$uptime" | awk '{ print ($1 * 1000) }')
360        device_util_after_ms=$(echo "$system" | awk '{ print ($13) }')
361    fi
362}
363
364system_stats_delta() {
365    if [ $system_bdev_set == true ]; then
366        # Sectors to KB
367        READ_KB_SYSTEM=$((AFTER_RD_SECTORS_SYSTEM - BEFORE_RD_SECTORS_SYSTEM))
368        READ_KB_SYSTEM=$((READ_KB_SYSTEM / 2))
369        echo Read IOs /system = $((AFTER_RD_IOS_SYSTEM - BEFORE_RD_IOS_SYSTEM))
370        echo Read KB /system = $READ_KB_SYSTEM
371        echo "$iowait_ticks_before" "$iowait_ticks_after" "$total_ticks_before" "$total_ticks_after" | awk '{ printf "IOwait = %.2f\n", (($2 - $1) * 100.0) / ($4 - $3) }'
372        echo "$device_util_before_ms" "$device_util_after_ms" "$uptime_before_ms" "$uptime_after_ms" | awk '{ printf "Device util% = %.2f\n", (($2 - $1) * 100.0) / ($4 - $3) }'
373        echo "$user_ticks_after" "$user_ticks_before" "$total_ticks_after" "$total_ticks_before" | awk '{ printf "User CPU util% = %.2f\n", (($1 - $2) * 100.0) / ($3 - $4) }'
374        echo "$sys_ticks_after" "$sys_ticks_before" "$total_ticks_after" "$total_ticks_before" | awk '{ printf "Sys CPU util% = %.2f\n", (($1 - $2) * 100.0) / ($3 - $4) }'
375        echo "$cpubusy_ticks_after" "$cpubusy_ticks_before" "$total_ticks_after" "$total_ticks_before" | awk '{ printf "Total CPU util% = %.2f\n", (($1 - $2) * 100.0) / ($3 - $4) }'
376    fi
377}
378
379launch_app() {
380    package=$1
381    activity=$2
382    $adb shell "am force-stop $package"
383    sleep 1
384
385    printf "Testing %s: \n" "$package" 1>&2
386    i=0
387    while [ $i -lt "$iterations" ]
388    do
389        if [ $pagecached == false ]; then
390            $adb shell 'echo 3 > /proc/sys/vm/drop_caches'
391        fi
392        printf '[ %d%% ]\r' "$((i * 100 / iterations))" 1>&2
393        # The -W argument to am start forces am start to wait till the launch completes.
394        # The -S argument forces it to kill any existing app that is running first
395        # eg. adb shell 'am start -W -S -n com.android.chrome/com.google.android.apps.chrome.Main'
396        system_stats_before
397        $adb shell "simpleperf stat -a am start -W -n $package/$activity"
398        system_stats_after
399        system_stats_delta
400        sleep 1
401        $adb shell "am force-stop $package"
402        sleep 1
403        i=$((i + 1))
404    done
405    printf "\n" 1>&2
406}
407
408launch_fugu_apps() {
409    launch_app com.google.android.youtube.tv com.google.android.apps.youtube.tv.activity.TvGuideActivity > "$BASHPID-youtube-$model"
410    getstats "$BASHPID-youtube-$model" YouTube
411    launch_app com.google.android.play.games com.google.android.gms.games.pano.activity.PanoGamesOnboardHostActivity > "$BASHPID-games-$model"
412    getstats "$BASHPID-games-$model" Games
413    launch_app com.google.android.music com.android.music.activitymanagement.TopLevelActivity > "$BASHPID-music-$model"
414    getstats "$BASHPID-music-$model" Music
415}
416
417launch_phone_apps() {
418    launch_app com.android.chrome com.google.android.apps.chrome.Main > "$BASHPID-chrome-$model"
419    getstats "$BASHPID-chrome-$model" Chrome
420    launch_app com.google.android.GoogleCamera com.android.camera.CameraActivity > "$BASHPID-camera-$model"
421    getstats "$BASHPID-camera-$model" Camera
422    launch_app com.google.android.apps.maps com.google.android.maps.MapsActivity > "$BASHPID-maps-$model"
423    getstats "$BASHPID-maps-$model" Maps
424    launch_app com.google.android.youtube com.google.android.apps.youtube.app.WatchWhileActivity > "$BASHPID-youtube-$model"
425    getstats "$BASHPID-youtube-$model" YouTube
426}
427
428launch_go_apps() {
429    launch_app com.android.chrome com.google.android.apps.chrome.Main > "$BASHPID-chrome-$model"
430    getstats "$BASHPID-chrome-$model" Chrome
431    launch_app com.google.android.gm.lite com.google.android.gm.ConversationListActivityGmail > "$BASHPID-gmailgo-$model"
432    getstats "$BASHPID-gmailgo-$model" GmailGo
433    launch_app com.google.android.apps.youtube.mango com.google.android.apps.youtube.lite.frontend.activities.SplashActivity > "$BASHPID-youtubego-$model"
434    getstats "$BASHPID-youtubego-$model" YouTubeGo
435    launch_app com.android.vending com.google.android.finsky.activities.MainActivity > "$BASHPID-play-$model"
436    getstats "$BASHPID-play-$model" Play
437    launch_app com.android.settings com.android.settings.Settings > "$BASHPID-settings-$model"
438    getstats "$BASHPID-settings-$model" Settings
439}
440
441usage() {
442    echo 'Usage: app-launcher [-c|-v|-s <serial num>] -a|-b|-u num-iterations'
443    echo 'where num-iterations >= 100'
444    echo '-v (optional) for verbose stats dump'
445    echo '-s <serial num> (optional) run test on specific device'
446    echo '-a|-b|-u required:'
447    echo '        -a:all cores'
448    echo '        -b:only big cores'
449    echo '        -c:pagecached. Do not drop pagecache before each launch (not default)'
450    echo '        -h:Dump this help menu'
451    echo '        -u:user experience, no change to cpu/gpu frequencies or governors'
452    echo '        -a/-b locks CPU/GPU freqs to max, performance governor, thermal/perfd off'
453    echo '        -u runs with default device configs, as users would see it'
454    exit 1
455}
456
457setup() {
458    echo "Setting up device"
459    # Set developer options, will automatically 'Stay Awake'
460    $adb shell 'am start -n com.android.settings/.DevelopmentSettings'
461    # Set screen timeout to 30 minutes
462    $adb shell 'settings put system screen_off_timeout 1800000'
463
464    # TODO: Consider rebooting device to start with a clean state
465
466    # Disable automatic rotation and NFC
467    # This works on OC, but haven't tested on NYC or earlier
468    $adb shell 'content insert --uri content://settings/system --bind name:s:accelerometer_rotation --bind value:i:0'
469    $adb shell 'svc nfc disable'
470
471    # Clear all notifications
472    $adb shell 'service call notification 1'
473    # Go to home screen
474    $adb shell 'input keyevent KEYCODE_WAKEUP' && sleep 0.5
475    $adb shell 'input keyevent KEYCODE_MENU'   && sleep 0.5
476    $adb shell 'input keyevent KEYCODE_HOME'   && sleep 0.5
477    sleep 2
478    # TODO: kill all background apps
479    # TODO: clear popups
480}
481
482#
483# The main() part of the script follows :
484#
485
486if [ $# -lt 2 ]; then
487    usage
488fi
489
490if ! which computestats > /dev/null ; then
491    echo "ERROR: Please add computestats utiliy to your PATH"
492    exit 1
493fi
494
495if ! which computestatsf > /dev/null ; then
496    echo "Error: Please add computestatsf utility to your PATH"
497    exit 1
498fi
499
500parseoptions "$@"
501
502$adb root && $adb wait-for-device
503
504if [ $user_experience == false ]; then
505    # Important to stop the thermal-engine to prevent throttling while test is running
506    # and stop perfd
507    $adb shell 'stop thermal-engine'
508    $adb shell 'stop perfd'
509else
510    echo "User Experience: Default Configs. No changes to cpufreq settings"
511fi
512
513# Releases are inconsistent with various trailing characters, remove them all
514model=$($adb shell getprop ro.product.name | sed 's/[ \t\r\n]*$//')
515
516echo "Found $model Device"
517
518system_bdev_set=false
519case $model in
520    # Android Go
521    aosp_gobo | full_k37_y33_gms | gobo | gobo_512)
522	if [ $user_experience == false ]; then
523	    cpufreq_go
524        fi
525	get_go_devnames
526        ;;
527    taimen | muskie | walleye)
528        if [ $user_experience == false ]; then
529            cpufreq_taimen_walleye
530        fi
531        get_taimen_walleye_devnames
532        ;;
533    marlin | sailfish)
534        if [ $user_experience == false ]; then
535            cpufreq_marlin_sailfish
536        fi
537        get_marlin_sailfish_devnames
538        ;;
539    angler)
540        if [ $user_experience == false ]; then
541            cpufreq_angler
542        fi
543        get_angler_devnames
544        ;;
545    fugu)
546        if [ $user_experience == false ]; then
547            cpufreq_fugu
548        fi
549        get_fugu_devnames
550        ;;
551    volantis | volantisg)
552        if [ $user_experience == false ]; then
553            cpufreq_volantis
554        fi
555        get_volantis_devnames
556        ;;
557    *)
558        echo "Unknown Device $model"
559        exit 1
560        ;;
561esac
562
563setup
564
565#
566# launch each app in turn
567#
568case $model in
569    # Android Go
570    aosp_gobo | full_k37_y33_gms | gobo | gobo_512)
571	launch_go_apps
572	;;
573    fugu)
574	launch_fugu_apps
575        ;;
576    *)
577	launch_phone_apps
578        ;;
579esac
580
581# cleanup
582rm $BASHPID*
583