File tree Expand file tree Collapse file tree 3 files changed +14
-14
lines changed
Expand file tree Collapse file tree 3 files changed +14
-14
lines changed Original file line number Diff line number Diff line change @@ -1211,19 +1211,19 @@ initialize()
12111211 ui_error ' Downgrade not allowed!!!' 95
12121212 fi
12131213
1214- IS_INSTALLATION= ' true '
1214+ SETUP_TYPE= ' install '
12151215 if
12161216 test " ${LIVE_SETUP_ENABLED:? } " = ' true' && {
12171217 test " ${MODULE_VERCODE:? } " -eq " ${PREV_MODULE_VERCODE:? } " || test " ${PREV_INSTALL_FAILED:? } " = ' true'
12181218 }
12191219 then
12201220 choose ' What do you want to do?' ' +) Reinstall' ' -) Uninstall'
12211221 if test " ${?} " ! = ' 3' ; then
1222- IS_INSTALLATION= ' false '
1222+ SETUP_TYPE= ' uninstall '
12231223 fi
12241224 fi
1225- readonly IS_INSTALLATION
1226- export IS_INSTALLATION
1225+ readonly SETUP_TYPE
1226+ export SETUP_TYPE
12271227
12281228 remount_read_write " ${SYS_MOUNTPOINT:? } " || {
12291229 deinitialize
@@ -1864,11 +1864,11 @@ finalize_correctly()
18641864 deinitialize
18651865 touch " ${TMP_PATH:? } /installed"
18661866
1867- if test " ${IS_INSTALLATION : ? } " = ' true ' ; then
1868- ui_msg ' Installation finished.'
1869- else
1870- ui_msg ' Uninstallation finished. '
1871- fi
1867+ case " ${SETUP_TYPE ?} " in
1868+ ' install ' ) ui_msg ' Installation finished.' ;;
1869+ ' uninstall ' ) ui_msg ' Uninstallation finished. ' ;;
1870+ * ) ui_error ' Invalid setup type ' ;;
1871+ esac
18721872}
18731873
18741874# Error checking functions
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ INSTALL_CALENDARSYNC="$(parse_setting 'INSTALL_CALENDARSYNC' "${INSTALL_CALENDAR
3030display_info
3131ui_msg_empty_line
3232
33- if test " ${IS_INSTALLATION :? } " = ' true ' ; then
33+ if test " ${SETUP_TYPE :? } " = ' install ' ; then
3434 ui_msg ' Starting installation...'
3535 ui_msg_empty_line
3636
5656 ui_msg_empty_line
5757fi
5858
59- if test " ${IS_INSTALLATION :? } " = ' true ' ; then
59+ if test " ${SETUP_TYPE :? } " = ' install ' ; then
6060 disable_app ' com.google.android.syncadapters.calendar'
6161 disable_app ' com.google.android.syncadapters.contacts'
6262 disable_app ' com.google.android.backuptransport'
6565# Clean previous installations
6666clean_previous_installations
6767
68- if test " ${IS_INSTALLATION :? } " ! = ' true ' ; then
68+ if test " ${SETUP_TYPE :? } " = ' uninstall ' ; then
6969 clear_app ' com.google.android.syncadapters.calendar'
7070 clear_app ' com.google.android.syncadapters.contacts'
7171 clear_app ' com.google.android.backuptransport'
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ if test "${IS_INCLUDED:-false}" = 'false'; then
5454
5555 # shellcheck disable=SC2034
5656 {
57- IS_INSTALLATION= ' false '
57+ SETUP_TYPE= ' uninstall '
5858 FIRST_INSTALLATION=' true'
5959 API=999
6060 SYS_PATH=" ${ANDROID_ROOT:-/ system} "
@@ -138,7 +138,7 @@ uninstall_list | while IFS='|' read -r FILENAME INTERNAL_NAME _; do
138138
139139 if test -n " ${INTERNAL_NAME} " ; then
140140 # Only delete app updates during uninstallation or first-time installation
141- if test " ${IS_INSTALLATION :? } " ! = ' true ' || test " ${FIRST_INSTALLATION:? } " = ' true' ; then
141+ if test " ${SETUP_TYPE :? } " = ' uninstall ' || test " ${FIRST_INSTALLATION:? } " = ' true' ; then
142142 delete " ${DATA_PATH:? } /app/${INTERNAL_NAME} "
143143 delete " ${DATA_PATH:? } /app/${INTERNAL_NAME} .apk"
144144 delete " ${DATA_PATH:? } /app/${INTERNAL_NAME} " -*
You can’t perform that action at this time.
0 commit comments