Skip to content
This repository was archived by the owner on Jan 5, 2022. It is now read-only.

Commit b95e103

Browse files
committed
add Standard Apps to defaultApps section
1 parent 45dd6bc commit b95e103

File tree

1 file changed

+44
-3
lines changed

1 file changed

+44
-3
lines changed

Diff for: lib/packagedata.lib

+44-3
Original file line numberDiff line numberDiff line change
@@ -486,6 +486,47 @@ function _makeDefaultAppDoc() {
486486
local mdfile="${DOCDIR}/defaultApps.md"
487487
echo -e "$(heading 2 "Default Apps on ${DEVICE_NAME}" "defaultApps")\n" >> "${mdfile}"
488488
_makeWebviewDetails
489+
_mkStandardApps
490+
}
491+
492+
#
493+
# Standard Apps
494+
# (called from _makeDefaultAppDoc())
495+
# needs to be disabled for Dummies due to a bunch of separate calls
496+
#
497+
function _mkStandardApps() {
498+
[[ -n "${DUMMYDIR}" ]] && {
499+
doProgress "! skipping StandardApps for dummy device"
500+
return
501+
}
502+
503+
local pkgname
504+
505+
echo "$(tab_classopen 'block')" >> "${mdfile}"
506+
echo "$(trth2 'Standard Apps')" >> "${mdfile}"
507+
pkgname="$(trim "$(adb $ADBOPTS shell cmd package resolve-activity tel://123456 |grep packageName|head -n 1)")"
508+
_defAppLine "Dialer" "${pkgname}"
509+
pkgname="$(trim "$(adb $ADBOPTS shell cmd package resolve-activity mailto:[email protected] |grep packageName|head -n 1)")"
510+
_defAppLine "Mail" "${pkgname}"
511+
pkgname="$(trim "$(adb $ADBOPTS shell cmd package resolve-activity http://www.example.com/ |grep packageName|head -n 1)")"
512+
_defAppLine "Browser" "${pkgname}"
513+
pkgname="$(trim "$(adb $ADBOPTS shell cmd package resolve-activity sms://123456 |grep packageName|head -n 1)")"
514+
_defAppLine "Messenging" "${pkgname}"
515+
pkgname="$(trim "$(adb $ADBOPTS shell cmd package resolve-activity -c android.intent.category.HOME -a android.intent.action.MAIN |grep packageName|head -n 1)")"
516+
_defAppLine "Homescreen" "${pkgname}"
517+
518+
echo -e "$(tab_close)\n" >> "${mdfile}"
519+
}
520+
function _defAppLine() {
521+
local app=$1
522+
local pkgname=$2
523+
[[ -n "${pkgname}" ]] && {
524+
if [[ "${pkgname#packageName=*}" = "android" ]]; then
525+
echo "$(trthtd "$app" 'unknown')" >> "${mdfile}"
526+
else
527+
echo "$(trthtd "$app" "$(_mkAppLink "${pkgname#packageName=*}" "$(_getSysAppName "${pkgname#packageName=*}")")")" >> "${mdfile}"
528+
fi
529+
}
489530
}
490531

491532
#
@@ -541,7 +582,7 @@ function _makeWebviewDetails() {
541582
done < "${tmp}"
542583

543584
# generate document
544-
echo "$(tab_classopen 'apps')" >> "${mdfile}"
585+
echo "$(tab_classopen 'block')" >> "${mdfile}"
545586
echo "$(trth2 'WebViews')" >> "${mdfile}"
546587
[[ -n "${WEBVIEW['installed']}" ]] && echo "$(trthtd 'Any WebView package installed' "${WEBVIEW['installed']}")" >> "${mdfile}"
547588
[[ -n "${WEBVIEW['dirty']}" ]] && echo "$(trthtd 'WebView package dirty' "${WEBVIEW['dirty']}")" >> "${mdfile}"
@@ -572,7 +613,7 @@ function _makeWebviewDetails() {
572613

573614
#
574615
# Get app name from appcache
575-
# (used by _makeWebviewDetails())
616+
# (used by _makeWebviewDetails() & _mkStandardApps())
576617
# param: pkgname
577618
function _getSysAppName() {
578619
local pkgname=$1
@@ -589,7 +630,7 @@ function _getSysAppName() {
589630

590631
#
591632
# Create app link depending on whether name and URL are available
592-
# (used by _makeWebviewDetails())
633+
# (used by _makeWebviewDetails() & _mkStandardApps())
593634
# params: pkgname, appname
594635
function _mkAppLink() {
595636
local pkgname=$1

0 commit comments

Comments
 (0)