Home | History | Annotate | Download | only in print
      1 # Copyright (C) 2014 The Android Open Source Project
      2 #
      3 # Licensed under the Apache License, Version 2.0 (the "License");
      4 # you may not use this file except in compliance with the License.
      5 # You may obtain a copy of the License at
      6 #
      7 #      http://www.apache.org/licenses/LICENSE-2.0
      8 #
      9 # Unless required by applicable law or agreed to in writing, software
     10 # distributed under the License is distributed on an "AS IS" BASIS,
     11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     12 # See the License for the specific language governing permissions and
     13 # limitations under the License.
     14 
     15 # Script to start "print-instrument" on the device
     16 #
     17 # The script sets up an alternative dalvik cache when running as
     18 # non-root. Jar files needs to be dexopt'd to run in Dalvik. For
     19 # plain jar files, this is done at first use. shell user does not
     20 # have write permission to default system Dalvik cache so we
     21 # redirect to an alternative cache.
     22 
     23 RUN_BASE=/data/local/tmp
     24 
     25 # If not running as root, use an alternative dex cache.
     26 if [ ${USER_ID} -ne 0 ]; then
     27   tmp_cache=${RUN_BASE}/dalvik-cache
     28   if [ ! -d ${tmp_cache} ]; then
     29     mkdir -p ${tmp_cache}
     30   fi
     31   export ANDROID_DATA=${RUN_BASE}
     32 fi
     33 
     34 # Run print-instrument.
     35 export CLASSPATH=${RUN_BASE}/CtsPrintInstrument.jar
     36 
     37 exec app_process ${RUN_BASE} android.print.cts.PrintInstrument ${@}
     38