@@ -90,7 +90,7 @@
# Message to show with successful flashing.
# "
-SCRIPT_VERSION=1.0
+SCRIPT_VERSION=1.1
OS_VERSION=
FASTBOOT_BIN_PATH=
@@ -169,6 +169,7 @@
--blob-path Where possible vendor specific image files are located
--extra-opts Custom extra options for fastboot
--config Specify location for flash ops
+ --dry-run Only dry run, don't do any changes to device
EOF
}
@@ -202,6 +203,9 @@
shift
FLASH_CONFIG="$1"
;;
+ --dry-run)
+ ONLY_DRY_RUN=1
+ ;;
--help)
usage
exit 0
@@ -230,9 +234,10 @@
# Do not need root for fastboot on Mac OS X
if [ "$UNAME" != "Darwin" ] && [ "$(id -u)" -ne 0 ]; then
- exec sudo -E bash -c "FORCE=$FORCE FASTBOOT_BIN_NAME=\"$FASTBOOT_BIN_NAME\" IMAGE_PATH=\"$IMAGE_PATH\" BLOB_PATH=\"$BLOB_PATH\" FASTBOOTEXTRAOPTS=\"$FASTBOOTEXTRAOPTS\" FLASH_CONFIG=\"$FLASH_CONFIG\" $0"
+ exec sudo -E bash -c "FORCE=$FORCE FASTBOOT_BIN_NAME=\"$FASTBOOT_BIN_NAME\" IMAGE_PATH=\"$IMAGE_PATH\" BLOB_PATH=\"$BLOB_PATH\" FASTBOOTEXTRAOPTS=\"$FASTBOOTEXTRAOPTS\" FLASH_CONFIG=\"$FLASH_CONFIG\" ONLY_DRY_RUN=$ONLY_DRY_RUN $0"
fi
+echo "Flash utility v$SCRIPT_VERSION"
case $UNAME in
Linux)
@@ -297,25 +302,6 @@
exit 1
fi
-# Workaround for kickstart files until they are modified to not alter
-# flash.sh script directly.
-# If the valid product from flash-config.sh still contains @VALID_PRODUCTS@ placeholder,
-# assume this script is still being modified and set the product name here.
-# There are two variations of the modification, one uses DEVICE and other DEVICES
-# but both contain one or more of '-e "product_name"'
-for test_valid in "${VALID_PRODUCTS[@]}"; do
- if [ "$test_valid" == "@VALID_PRODUCTS@" ]; then
- old_IFS=$"$IFS"
- IFS=" "
- VALID_PRODUCTS=($(printf %s "@DEVICES@" | sed 's/-e //g'))
- if [ "${VALID_PRODUCTS[0]}" == '@DEVICES@' ]; then
- VALID_PRODUCTS=($(printf %s "@DEVICE@" | sed 's/-e //g'))
- fi
- IFS=$"$old_IFS"
- break
- fi
-done
-
TARGET_SERIALNO=
count=0
for SERIALNO in $FASTBOOT_DEVICES; do
@@ -517,8 +503,11 @@
DRY_RUN=1
run_flash_ops
-DRY_RUN=0
-run_flash_ops
+
+if [ -z "$ONLY_DRY_RUN" ]; then
+ DRY_RUN=0
+ run_flash_ops
+fi
echo
echo "Flashing completed."
|
@@ -0,0 +1,585 @@
+# -------- xpolicy.conf --------------------------------------------------------
+#
+# Files are read in following order,
+# 1) xpolicy.conf
+# 2) xpolicy.conf.d/*.conf, in descending order
+#
+# Variables can be defined anywhere, and they affect all the conf files. Variables
+# are updated if same variable is defined later on (for example variables in
+# xpolicy.conf.d/xvars.conf are applied most likely latest and are the active
+# ones). Variables can be used to replace any string configuration value
+# (NOT match types, etc.). For example following stream definition is valid:
+#
+# [stream]
+# property = $property_name@equals:$property_value
+# group = $group_name
+#
+# or for context definition following property action is valid:
+# set-property = sink-name@equals:$sink, property:$string, value@constant:$value
+#
+# Other sections than [variable] can also be defined in any conf file, and already
+# defined ones will be overridden by later definition.
+#
+
+
+# -------- Variable section ----------------------------------------------------
+
+# Defaults. To override define variables with new values
+# in xpolicy.conf.d directory (for example xpolicy.conf.d/xvars.conf).
+[variable]
+# sinks, sources and ports
+droid_source_input_microphone = input-builtin_mic
+droid_source_input_backmicrophone = input-back_mic
+droid_source_input_fmradio = input-fm_tuner
+droid_sink_port_change_delay = delayed_port_change
+delay_time = 150
+# cards and profiles
+droid_card = droid_card.primary
+droid_card_profile = default
+# bluetooth sco
+droid_sco_output = output-bluetooth_sco
+droid_sco_input = input-bluetooth_sco_headset
+
+# -------- Group section -------------------------------------------------------
+
+[group]
+name = othermedia
+flags = route_audio, limit_volume, cork_stream
+
+[group]
+name = idle
+flags = nopolicy
+sink = sink.null
+source = sink.null.monitor
+
+[group]
+name = background
+flags = limit_volume, cork_stream
+sink = droid.output.media_latency@equals:"true"
+source = droid.input.builtin@equals:"true"
+
+[group]
+name = systemsound
+flags = set_sink, limit_volume, cork_stream, mute_by_route
+sink = droid.output.media_latency@equals:"true"
+
+[group]
+name = btnotify
+flags = set_sink, limit_volume, cork_stream, mute_by_route, dynamic_sink
+sink = startswith:"bluez_sink"
+
+[group]
+name = feedbacksound
+flags = set_sink, limit_volume, cork_stream, mute_by_route
+sink = droid.output.low_latency@equals:"true"
+
+[group]
+name = inputsound
+flags = set_sink, limit_volume, cork_stream, mute_by_route
+sink = droid.output.low_latency@equals:"true"
+
+[group]
+name = event
+flags = set_sink, limit_volume, cork_stream, mute_by_route
+sink = droid.output.media_latency@equals:"true"
+
+[group]
+name = alarm
+flags = set_sink, limit_volume, mute_by_route, cork_stream, media_notify
+sink = droid.output.media_latency@equals:"true"
+
+[group]
+name = flash
+flags = limit_volume, cork_stream
+
+[group]
+name = player
+flags = route_audio, limit_volume, cork_stream
+
+[group]
+name = game
+flags = route_audio, limit_volume, cork_stream
+
+[group]
+name = voiceui
+flags = set_sink, limit_volume, cork_stream
+sink = droid.output.low_latency@equals:"true"
+
+[group]
+name = ringtone
+flags = set_sink, limit_volume, mute_by_route, cork_stream, media_notify
+sink = droid.output.media_latency@equals:"true"
+
+[group]
+name = camera
+flags = set_sink, set_source, limit_volume, cork_stream
+sink = droid.output.media_latency@equals:"true"
+source = droid.input.builtin@equals:"true"
+
+[group]
+name = videoeditor
+flags = route_audio, limit_volume, cork_stream
+
+[group]
+name = ipcall
+flags = set_sink, set_source, limit_volume, cork_stream
+sink = droid.output.low_latency@equals:"true"
+source = droid.input.builtin@equals:"true"
+
+[group]
+name = call
+flags = set_sink, set_source
+sink = droid.output.low_latency@equals:"true"
+source = droid.input.builtin@equals:"true"
+
+[group]
+name = navigator
+flags = set_sink, set_source, route_audio
+sink = droid.output.media_latency@equals:"true"
+source = droid.input.builtin@equals:"true"
+
+[group]
+name = cstone
+flags = route_audio, set_source, limit_volume
+
+[group]
+name = alwayson
+flags = set_sink, limit_volume, cork_stream
+sink = droid.output.media_latency@equals:"true"
+
+[group]
+name = nonsilent
+flags = set_sink, limit_volume, cork_stream
+sink = droid.output.media_latency@equals:"true"
+
+[group]
+name = internal
+flags = nopolicy
+sink = sink.null
+source = source.null.monitor
+
+[group]
+name = outgoing
+flags = route_audio
+
+[group]
+name = incoming
+flags = route_audio
+
+[group]
+name = alien
+flags = route_audio, limit_volume, mute_by_route
+
+[group]
+name = aliencall
+flags = route_audio, limit_volume, mute_by_route
+
+[group]
+name = probesink
+flags = set_sink, limit_volume, cork_stream
+sink = droid.output.media_latency@equals:"true"
+
+# -------- Card section --------------------------------------------------------
+
+# -------- Device section ------------------------------------------------------
+
+[device]
+type = tvoutandbta2dp
+sink = startswith:"bluez_sink"
+
+[device]
+type = ihfandheadset
+sink = droid.output.media_latency@equals:"true"
+ports = droid.output.primary@equals:"true"->output-speaker+wired_headphone
+flags = $droid_sink_port_change_delay
+delay = $delay_time
+
+[device]
+type = ihfandheadset
+source= droid.input.external@equals:"true"
|