1
0
mirror of https://codeberg.org/Freeyourgadget/Gadgetbridge synced 2024-11-30 14:02:56 +01:00

Galaxy Buds: adding initial support for Galaxy Buds 2019

This commit is contained in:
vanous 2021-10-24 10:02:45 +02:00
parent 3db6e5d9ec
commit da0c43f77d
29 changed files with 1147 additions and 2 deletions

View File

@ -1,5 +1,8 @@
### Changelog ### Changelog
### {next}
* Support for Galaxy Buds 2019
### 0.61.0 ### 0.61.0
* Initial support for Nothing Ear(1) * Initial support for Nothing Ear(1)
* Amazfit Bip U/Pro: Fix flashing firmware and watchfaces * Amazfit Bip U/Pro: Fix flashing firmware and watchfaces

View File

@ -0,0 +1,86 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="35.69236mm"
height="42.231304mm"
viewBox="0 0 35.69236 42.231304"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="galaxy_buds.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.5407127"
inkscape:cx="24.599397"
inkscape:cy="100.56234"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-58.009475,-114.68386)">
<g
id="g11302">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 62.481984,130.19859 c -1.422876,1.97773 -0.400592,5.02874 3.539949,5.03091"
id="path10585"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 66.103138,121.7957 c 2.666757,-1.07007 4.567397,-1.03074 7.019236,-0.32613 1.148282,0.32999 2.049576,1.68227 2.142569,2.8734 0.428995,5.49489 -2.903496,8.17341 -6.263367,7.93085 -2.05934,-0.14867 -4.130587,-2.74489 -4.627575,-5.01288 -0.41816,-1.90826 -0.08389,-4.73774 1.729137,-5.46524 z"
id="path5256"
sodipodi:nodetypes="ssssss" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 68.424274,119.2465 c 3.534371,-0.50931 7.153563,0.99406 8.625608,4.36799 1.972926,4.52216 -0.871682,11.86623 -6.124093,12.64208 -9.667201,1.42779 -12.807218,-15.52506 -2.501515,-17.01007"
id="path3567" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 70.54094,115.0684 c -1.528272,0.40147 -2.479848,2.50023 -3.65606,3.48042 -1.57278,1.31064 -3.329209,2.02976 -4.365471,3.91113 -0.788477,1.43151 -0.572308,3.47576 -1.409777,4.73562 -0.43788,0.65873 -1.309196,0.96445 -1.803823,1.61735 -1.540471,2.03338 -1.370542,5.10243 0.479425,6.88871 1.219739,1.17764 3.141402,1.6612 4.790555,1.28077 0.702868,-0.16221 1.380432,-0.74583 2.116667,-0.68541 1.719445,0.14105 2.786803,0.97944 4.618181,0.50261 6.467763,-1.6839 8.890577,-9.24373 7.458556,-15.10934 -0.757382,-3.10205 -4.540443,-7.59068 -8.228253,-6.62186"
id="path3559" />
</g>
<g
id="g11302-3"
transform="matrix(-1,0,0,1,151.71131,19.553843)">
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 62.481984,130.19859 c -1.422876,1.97773 -0.400592,5.02874 3.539949,5.03091"
id="path10585-6"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 66.103138,121.7957 c 2.666757,-1.07007 4.567397,-1.03074 7.019236,-0.32613 1.148282,0.32999 2.049576,1.68227 2.142569,2.8734 0.428995,5.49489 -2.903496,8.17341 -6.263367,7.93085 -2.05934,-0.14867 -4.130587,-2.74489 -4.627575,-5.01288 -0.41816,-1.90826 -0.08389,-4.73774 1.729137,-5.46524 z"
id="path5256-7"
sodipodi:nodetypes="ssssss" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 68.424274,119.2465 c 3.534371,-0.50931 7.153563,0.99406 8.625608,4.36799 1.972926,4.52216 -0.871682,11.86623 -6.124093,12.64208 -9.667201,1.42779 -12.807218,-15.52506 -2.501515,-17.01007"
id="path3567-5" />
<path
style="fill:none;stroke:#000000;stroke-width:0.5;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 70.54094,115.0684 c -1.528272,0.40147 -2.479848,2.50023 -3.65606,3.48042 -1.57278,1.31064 -3.329209,2.02976 -4.365471,3.91113 -0.788477,1.43151 -0.572308,3.47576 -1.409777,4.73562 -0.43788,0.65873 -1.309196,0.96445 -1.803823,1.61735 -1.540471,2.03338 -1.370542,5.10243 0.479425,6.88871 1.219739,1.17764 3.141402,1.6612 4.790555,1.28077 0.702868,-0.16221 1.380432,-0.74583 2.116667,-0.68541 1.719445,0.14105 2.786803,0.97944 4.618181,0.50261 6.467763,-1.6839 8.890577,-9.24373 7.458556,-15.10934 -0.757382,-3.10205 -4.540443,-7.59068 -8.228253,-6.62186"
id="path3559-3" />
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="40mm"
height="40mm"
viewBox="0 0 40.000001 39.999999"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="ic_device_galaxy_buds.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.5407127"
inkscape:cx="32.471204"
inkscape:cy="54.512264"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-106.33137,-119.64791)">
<rect
style="fill:#4dabf5;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
id="rect11523"
width="30"
height="30"
x="111.33137"
y="124.64791"
ry="2.4056475" />
<g
id="g12091"
transform="matrix(0.66666666,0,0,0.66666666,77.011931,48.318237)"
style="stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none">
<g
id="g12078"
style="stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none">
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:1.35;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 89.229326,149.75243 c 1.422876,1.97773 0.400592,5.02874 -3.539949,5.03091"
id="path10585-6"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:1.35;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 85.608172,141.34954 c -2.666757,-1.07007 -4.567397,-1.03074 -7.019236,-0.32613 -1.148282,0.32999 -2.049576,1.68227 -2.142569,2.8734 -0.428995,5.49489 2.903496,8.17341 6.263367,7.93085 2.05934,-0.14867 4.130587,-2.74489 4.627575,-5.01288 0.41816,-1.90826 0.08389,-4.73774 -1.729137,-5.46524 z"
id="path5256-7"
sodipodi:nodetypes="ssssss" />
<path
style="fill:none;stroke:#fcffff;stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 83.287036,138.80034 c -3.534371,-0.50931 -7.153563,0.99406 -8.625608,4.36799 -1.972926,4.52216 0.871682,11.86623 6.124093,12.64208 9.667201,1.42779 12.807218,-15.52506 2.501515,-17.01007"
id="path3567-5" />
</g>
<path
style="fill:none;stroke:#fcffff;stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 81.17037,134.62224 c 1.528272,0.40147 2.479848,2.50023 3.65606,3.48042 1.57278,1.31064 3.329209,2.02976 4.365471,3.91113 0.788477,1.43151 0.572308,3.47576 1.409777,4.73562 0.43788,0.65873 1.309196,0.96445 1.803823,1.61735 1.540471,2.03338 1.370542,5.10243 -0.479425,6.88871 -1.219739,1.17764 -3.141402,1.6612 -4.790555,1.28077 -0.702868,-0.16221 -1.380432,-0.74583 -2.116667,-0.68541 -1.719445,0.14105 -2.786803,0.97944 -4.618181,0.50261 -6.467763,-1.6839 -8.890577,-9.24373 -7.458556,-15.10934 0.757382,-3.10205 4.540443,-7.59068 8.228253,-6.62186"
id="path3559-3" />
</g>
<path
style="fill:none;stroke:#fcffff;stroke-width:0.999996;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 122.30295,126.33466 c -1.01885,0.26765 -1.65323,1.66683 -2.43737,2.32029 -1.04852,0.87375 -2.21948,1.35316 -2.91032,2.60741 -0.52565,0.95434 -0.38154,2.31718 -0.93985,3.15709 -0.29192,0.43915 -0.8728,0.64296 -1.20255,1.07824 -1.02698,1.35557 -0.91369,3.40161 0.31962,4.59246 0.81316,0.78509 2.09427,1.10747 3.1937,0.85385 0.46858,-0.10813 0.92029,-0.49721 1.41111,-0.45694 1.1463,0.094 1.85787,0.65296 3.07879,0.33508 4.31184,-1.1226 5.92705,-6.16249 4.97237,-10.0729 -0.50492,-2.06804 -3.02696,-5.06045 -5.4855,-4.41458"
id="path3559" />
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:0.999996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 116.93031,136.42146 c -0.94858,1.31848 -0.26706,3.35249 2.35997,3.35394"
id="path10585"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:0.999996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 119.34442,130.81954 c 1.77783,-0.71339 3.04493,-0.68717 4.67949,-0.21743 0.76552,0.22 1.36638,1.12151 1.42838,1.9156 0.28599,3.66326 -1.93567,5.44894 -4.17558,5.28724 -1.3729,-0.0991 -2.75373,-1.82993 -3.08505,-3.34193 -0.27878,-1.27217 -0.0559,-3.1585 1.15276,-3.64348 z"
id="path5256"
sodipodi:nodetypes="ssssss" />
<path
style="fill:none;stroke:#fcffff;stroke-width:0.999996;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 120.89184,129.12006 c 2.35625,-0.33954 4.76904,0.66271 5.7504,2.912 1.31529,3.01478 -0.58112,7.91081 -4.08272,8.42805 -6.4448,0.95186 -8.53815,-10.35004 -1.66768,-11.34005"
id="path3567" />
<rect
style="fill:none;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
id="rect14099"
width="40"
height="40"
x="106.33137"
y="119.64791" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
width="40mm"
height="40mm"
viewBox="0 0 40.000001 39.999999"
version="1.1"
id="svg5"
inkscape:version="1.1.1 (3bf5ae0d25, 2021-09-20)"
sodipodi:docname="ic_device_galaxy_buds_disabled.svg"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<sodipodi:namedview
id="namedview7"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
inkscape:document-units="mm"
showgrid="false"
inkscape:zoom="2.5407127"
inkscape:cx="32.471204"
inkscape:cy="54.512264"
inkscape:window-width="1920"
inkscape:window-height="1035"
inkscape:window-x="0"
inkscape:window-y="45"
inkscape:window-maximized="1"
inkscape:current-layer="layer1" />
<defs
id="defs2" />
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-106.33137,-119.64791)">
<rect
style="fill:#9f9f9f;fill-opacity:1;stroke:none;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:fill markers stroke;stop-color:#000000"
id="rect11523"
width="30"
height="30"
x="111.33137"
y="124.64791"
ry="2.4056475" />
<g
id="g12091"
transform="matrix(0.66666666,0,0,0.66666666,77.011931,48.318237)"
style="stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none">
<g
id="g12078"
style="stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none">
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:1.35;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 89.229326,149.75243 c 1.422876,1.97773 0.400592,5.02874 -3.539949,5.03091"
id="path10585-6"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:1.35;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 85.608172,141.34954 c -2.666757,-1.07007 -4.567397,-1.03074 -7.019236,-0.32613 -1.148282,0.32999 -2.049576,1.68227 -2.142569,2.8734 -0.428995,5.49489 2.903496,8.17341 6.263367,7.93085 2.05934,-0.14867 4.130587,-2.74489 4.627575,-5.01288 0.41816,-1.90826 0.08389,-4.73774 -1.729137,-5.46524 z"
id="path5256-7"
sodipodi:nodetypes="ssssss" />
<path
style="fill:none;stroke:#fcffff;stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 83.287036,138.80034 c -3.534371,-0.50931 -7.153563,0.99406 -8.625608,4.36799 -1.972926,4.52216 0.871682,11.86623 6.124093,12.64208 9.667201,1.42779 12.807218,-15.52506 2.501515,-17.01007"
id="path3567-5" />
</g>
<path
style="fill:none;stroke:#fcffff;stroke-width:1.35;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 81.17037,134.62224 c 1.528272,0.40147 2.479848,2.50023 3.65606,3.48042 1.57278,1.31064 3.329209,2.02976 4.365471,3.91113 0.788477,1.43151 0.572308,3.47576 1.409777,4.73562 0.43788,0.65873 1.309196,0.96445 1.803823,1.61735 1.540471,2.03338 1.370542,5.10243 -0.479425,6.88871 -1.219739,1.17764 -3.141402,1.6612 -4.790555,1.28077 -0.702868,-0.16221 -1.380432,-0.74583 -2.116667,-0.68541 -1.719445,0.14105 -2.786803,0.97944 -4.618181,0.50261 -6.467763,-1.6839 -8.890577,-9.24373 -7.458556,-15.10934 0.757382,-3.10205 4.540443,-7.59068 8.228253,-6.62186"
id="path3559-3" />
</g>
<path
style="fill:none;stroke:#fcffff;stroke-width:0.999996;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 122.30295,126.33466 c -1.01885,0.26765 -1.65323,1.66683 -2.43737,2.32029 -1.04852,0.87375 -2.21948,1.35316 -2.91032,2.60741 -0.52565,0.95434 -0.38154,2.31718 -0.93985,3.15709 -0.29192,0.43915 -0.8728,0.64296 -1.20255,1.07824 -1.02698,1.35557 -0.91369,3.40161 0.31962,4.59246 0.81316,0.78509 2.09427,1.10747 3.1937,0.85385 0.46858,-0.10813 0.92029,-0.49721 1.41111,-0.45694 1.1463,0.094 1.85787,0.65296 3.07879,0.33508 4.31184,-1.1226 5.92705,-6.16249 4.97237,-10.0729 -0.50492,-2.06804 -3.02696,-5.06045 -5.4855,-4.41458"
id="path3559" />
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:0.999996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 116.93031,136.42146 c -0.94858,1.31848 -0.26706,3.35249 2.35997,3.35394"
id="path10585"
sodipodi:nodetypes="cc" />
<path
style="fill:none;fill-rule:evenodd;stroke:#fcffff;stroke-width:0.999996;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 119.34442,130.81954 c 1.77783,-0.71339 3.04493,-0.68717 4.67949,-0.21743 0.76552,0.22 1.36638,1.12151 1.42838,1.9156 0.28599,3.66326 -1.93567,5.44894 -4.17558,5.28724 -1.3729,-0.0991 -2.75373,-1.82993 -3.08505,-3.34193 -0.27878,-1.27217 -0.0559,-3.1585 1.15276,-3.64348 z"
id="path5256"
sodipodi:nodetypes="ssssss" />
<path
style="fill:none;stroke:#fcffff;stroke-width:0.999996;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 120.89184,129.12006 c 2.35625,-0.33954 4.76904,0.66271 5.7504,2.912 1.31529,3.01478 -0.58112,7.91081 -4.08272,8.42805 -6.4448,0.95186 -8.53815,-10.35004 -1.66768,-11.34005"
id="path3567" />
<rect
style="fill:none;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;paint-order:fill markers stroke;stop-color:#000000"
id="rect14099"
width="40"
height="40"
x="106.33137"
y="119.64791" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -98,6 +98,17 @@ public class DeviceSettingsPreferenceConst {
public static final String PREF_NOTHING_EAR1_INEAR = "pref_nothing_inear_detection"; public static final String PREF_NOTHING_EAR1_INEAR = "pref_nothing_inear_detection";
public static final String PREF_NOTHING_EAR1_AUDIOMODE = "pref_nothing_audiomode"; public static final String PREF_NOTHING_EAR1_AUDIOMODE = "pref_nothing_audiomode";
public static final String PREF_GALAXY_BUDS_AMBIENT_MODE = "pref_galaxy_buds_ambient_mode";
public static final String PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS = "pref_galaxy_buds_ambient_voice_focus";
public static final String PREF_GALAXY_BUDS_AMBIENT_VOLUME = "pref_galaxy_buds_ambient_volume";
public static final String PREF_GALAXY_BUDS_LOCK_TOUCH = "pref_galaxy_buds_lock_touch";
public static final String PREF_GALAXY_BUDS_GAME_MODE = "pref_galaxy_buds_game_mode";
public static final String PREF_GALAXY_BUDS_EQUALIZER = "pref_galaxy_buds_equalizer";
public static final String PREF_GALAXY_BUDS_EQUALIZER_DOLBY = "pref_galaxy_buds_equalizer_dolby";
public static final String PREF_GALAXY_BUDS_EQUALIZER_MODE = "pref_galaxy_buds_equalizer_mode";
public static final String PREF_GALAXY_BUDS_TOUCH_LEFT = "pref_galaxy_buds_touch_left";
public static final String PREF_GALAXY_BUDS_TOUCH_RIGHT = "pref_galaxy_buds_touch_right";
public static final String PREF_SOUNDS = "sounds"; public static final String PREF_SOUNDS = "sounds";
public static final String PREF_AUTH_KEY = "authkey"; public static final String PREF_AUTH_KEY = "authkey";
} }

View File

@ -72,6 +72,16 @@ import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.Dev
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_DO_NOT_DISTURB_NOAUTO_START; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_DO_NOT_DISTURB_NOAUTO_START;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_FAKE_RING_DURATION; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_FAKE_RING_DURATION;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_FIND_PHONE_ENABLED; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_FIND_PHONE_ENABLED;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_MODE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOLUME;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER_DOLBY;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER_MODE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_GAME_MODE;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_LOCK_TOUCH;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_RIGHT;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_HYBRID_HR_DANGEROUS_EXTERNAL_INTENTS; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_HYBRID_HR_DANGEROUS_EXTERNAL_INTENTS;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_HYBRID_HR_DRAW_WIDGET_CIRCLES; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_HYBRID_HR_DRAW_WIDGET_CIRCLES;
import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_HYBRID_HR_FORCE_WHITE_COLOR; import static nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst.PREF_HYBRID_HR_FORCE_WHITE_COLOR;
@ -464,6 +474,17 @@ public class DeviceSpecificSettingsFragment extends PreferenceFragmentCompat {
addPreferenceHandlerFor(PREF_NOTHING_EAR1_INEAR); addPreferenceHandlerFor(PREF_NOTHING_EAR1_INEAR);
addPreferenceHandlerFor(PREF_NOTHING_EAR1_AUDIOMODE); addPreferenceHandlerFor(PREF_NOTHING_EAR1_AUDIOMODE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_MODE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_AMBIENT_VOLUME);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_LOCK_TOUCH);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_GAME_MODE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_EQUALIZER);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_EQUALIZER_DOLBY);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_EQUALIZER_MODE);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_TOUCH_LEFT);
addPreferenceHandlerFor(PREF_GALAXY_BUDS_TOUCH_RIGHT);
String sleepTimeState = prefs.getString(PREF_SLEEP_TIME, PREF_DO_NOT_DISTURB_OFF); String sleepTimeState = prefs.getString(PREF_SLEEP_TIME, PREF_DO_NOT_DISTURB_OFF);
boolean sleepTimeScheduled = sleepTimeState.equals(PREF_DO_NOT_DISTURB_SCHEDULED); boolean sleepTimeScheduled = sleepTimeState.equals(PREF_DO_NOT_DISTURB_SCHEDULED);

View File

@ -0,0 +1,142 @@
package nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds;
import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import nodomain.freeyourgadget.gadgetbridge.GBException;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.AbstractDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.InstallHandler;
import nodomain.freeyourgadget.gadgetbridge.devices.SampleProvider;
import nodomain.freeyourgadget.gadgetbridge.entities.DaoSession;
import nodomain.freeyourgadget.gadgetbridge.entities.Device;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDeviceCandidate;
import nodomain.freeyourgadget.gadgetbridge.model.ActivitySample;
import nodomain.freeyourgadget.gadgetbridge.model.DeviceType;
public class GalaxyBudsDeviceCoordinator extends AbstractDeviceCoordinator {
@NonNull
@Override
public DeviceType getSupportedType(GBDeviceCandidate candidate) {
String name = candidate.getName();
if (name != null && (
name.startsWith("Galaxy Buds")
)) {
return DeviceType.GALAXY_BUDS;
}
return DeviceType.UNKNOWN;
}
@Override
public DeviceType getDeviceType() {
return DeviceType.GALAXY_BUDS;
}
//@Override
//public int getBatteryCount() {
// return 2;
//}
@Nullable
@Override
public Class<? extends Activity> getPairingActivity() {
return null;
}
@Override
public boolean supportsActivityDataFetching() {
return false;
}
@Override
public boolean supportsActivityTracking() {
return false;
}
@Override
public SampleProvider<? extends ActivitySample> getSampleProvider(GBDevice
device, DaoSession session) {
return null;
}
@Override
public InstallHandler findInstallHandler(Uri uri, Context context) {
return null;
}
@Override
public boolean supportsScreenshots() {
return false;
}
@Override
public int getAlarmSlotCount() {
return 0;
}
@Override
public boolean supportsSmartWakeup(GBDevice device) {
return false;
}
@Override
public boolean supportsHeartRateMeasurement(GBDevice device) {
return false;
}
@Override
public String getManufacturer() {
return "Samsung";
}
@Override
public boolean supportsAppsManagement() {
return false;
}
@Override
public Class<? extends Activity> getAppsManagementActivity() {
return null;
}
@Override
public boolean supportsCalendarEvents() {
return false;
}
@Override
public boolean supportsRealtimeData() {
return false;
}
@Override
public boolean supportsWeather() {
return false;
}
@Override
public boolean supportsFindDevice() {
return true;
}
@Override
protected void deleteDevice(@NonNull GBDevice gbDevice, @NonNull Device
device, @NonNull DaoSession session) throws GBException {
}
@Override
public int[] getSupportedDeviceSpecificSettings(GBDevice device) {
return new int[]{
R.xml.devicesettings_galaxy_buds,
};
}
}

View File

@ -101,6 +101,7 @@ public enum DeviceType {
UM25(350, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_um25), UM25(350, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_um25),
DOMYOS_T540(400, R.drawable.ic_device_lovetoy, R.drawable.ic_device_lovetoy_disabled, R.string.devicetype_domyos_t540), DOMYOS_T540(400, R.drawable.ic_device_lovetoy, R.drawable.ic_device_lovetoy_disabled, R.string.devicetype_domyos_t540),
NOTHING_EAR1(410, R.drawable.ic_device_nothingear, R.drawable.ic_device_nothingear_disabled, R.string.devicetype_nothingear1), NOTHING_EAR1(410, R.drawable.ic_device_nothingear, R.drawable.ic_device_nothingear_disabled, R.string.devicetype_nothingear1),
GALAXY_BUDS(420, R.drawable.ic_device_galaxy_buds, R.drawable.ic_device_galaxy_buds_disabled, R.string.devicetype_galaxybuds),
TEST(1000, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_test); TEST(1000, R.drawable.ic_device_default, R.drawable.ic_device_default_disabled, R.string.devicetype_test);
private final int key; private final int key;

View File

@ -38,6 +38,7 @@ import nodomain.freeyourgadget.gadgetbridge.service.devices.banglejs.BangleJSDev
import nodomain.freeyourgadget.gadgetbridge.service.devices.casio.CasioGB6900DeviceSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.casio.CasioGB6900DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.casio.CasioGBX100DeviceSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.casio.CasioGBX100DeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.domyos.DomyosT540Support; import nodomain.freeyourgadget.gadgetbridge.service.devices.domyos.DomyosT540Support;
import nodomain.freeyourgadget.gadgetbridge.service.devices.galaxy_buds.GalaxyBudsDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.hplus.HPlusSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.hplus.HPlusSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSupport; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.HuamiSupport;
import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitband5.AmazfitBand5Support; import nodomain.freeyourgadget.gadgetbridge.service.devices.huami.amazfitband5.AmazfitBand5Support;
@ -362,6 +363,10 @@ public class DeviceSupportFactory {
case NOTHING_EAR1: case NOTHING_EAR1:
deviceSupport = new ServiceDeviceSupport(new Ear1Support(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING)); deviceSupport = new ServiceDeviceSupport(new Ear1Support(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break; break;
case GALAXY_BUDS:
deviceSupport = new ServiceDeviceSupport(new GalaxyBudsDeviceSupport(), EnumSet.of(ServiceDeviceSupport.Flags.BUSY_CHECKING));
break;
} }
if (deviceSupport != null) { if (deviceSupport != null) {
deviceSupport.setContext(gbDevice, mBtAdapter, mContext); deviceSupport.setContext(gbDevice, mBtAdapter, mContext);

View File

@ -0,0 +1,90 @@
package nodomain.freeyourgadget.gadgetbridge.service.devices.galaxy_buds;
import android.net.Uri;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.model.Alarm;
import nodomain.freeyourgadget.gadgetbridge.service.serial.AbstractSerialDeviceSupport;
import nodomain.freeyourgadget.gadgetbridge.service.serial.GBDeviceIoThread;
import nodomain.freeyourgadget.gadgetbridge.service.serial.GBDeviceProtocol;
public class GalaxyBudsDeviceSupport extends AbstractSerialDeviceSupport {
private static final Logger LOG = LoggerFactory.getLogger(GalaxyBudsDeviceSupport.class);
@Override
public void onSendConfiguration(String config) {
super.onSendConfiguration(config);
}
@Override
public void onSetAlarms(ArrayList<? extends Alarm> alarms) {
}
@Override
public void onInstallApp(Uri uri) {
}
@Override
public void onAppConfiguration(UUID appUuid, String config, Integer id) {
}
@Override
public void onHeartRateTest() {
}
@Override
public void onSetConstantVibration(int integer) {
}
@Override
public void onSetHeartRateMeasurementInterval(int seconds) {
}
@Override
public void onReadConfiguration(String config) {
}
@Override
public void onTestNewFunction() {
super.onTestNewFunction();
}
@Override
public boolean connect() {
getDeviceIOThread().start();
return true;
}
@Override
public synchronized GalaxyBudsIOThread getDeviceIOThread() {
return (GalaxyBudsIOThread) super.getDeviceIOThread();
}
@Override
public boolean useAutoConnect() {
return false;
}
protected GBDeviceProtocol createDeviceProtocol() {
return new GalaxyBudsProtocol(getDevice());
}
@Override
protected GBDeviceIoThread createDeviceIOThread() {
return new GalaxyBudsIOThread(getDevice(), getContext(), (GalaxyBudsProtocol) getDeviceProtocol(),
GalaxyBudsDeviceSupport.this, getBluetoothAdapter());
}
}

View File

@ -0,0 +1,46 @@
package nodomain.freeyourgadget.gadgetbridge.service.devices.galaxy_buds;
import static nodomain.freeyourgadget.gadgetbridge.util.GB.hexdump;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.os.ParcelUuid;
import androidx.annotation.NonNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.service.btclassic.BtClassicIoThread;
public class GalaxyBudsIOThread extends BtClassicIoThread {
private static final Logger LOG = LoggerFactory.getLogger(GalaxyBudsIOThread.class);
private final GalaxyBudsProtocol galaxyBudsProtocol;
@NonNull
protected UUID getUuidToConnect(@NonNull ParcelUuid[] uuids) {
return galaxyBudsProtocol.UUID_DEVICE_CTRL;
}
public GalaxyBudsIOThread(GBDevice device, Context context, GalaxyBudsProtocol deviceProtocol,
GalaxyBudsDeviceSupport galaxyBudsDeviceSupport, BluetoothAdapter bluetoothAdapter) {
super(device, context, deviceProtocol, galaxyBudsDeviceSupport, bluetoothAdapter);
galaxyBudsProtocol = deviceProtocol;
}
@Override
protected byte[] parseIncoming(InputStream inStream) throws IOException {
byte[] buffer = new byte[1048576]; //HUGE read
int bytes = inStream.read(buffer);
LOG.debug("read " + bytes + " bytes. " + hexdump(buffer, 0, bytes));
return Arrays.copyOf(buffer, bytes);
}
}

View File

@ -0,0 +1,248 @@
package nodomain.freeyourgadget.gadgetbridge.service.devices.galaxy_buds;
import static nodomain.freeyourgadget.gadgetbridge.util.CheckSums.crc16_ccitt;
import static nodomain.freeyourgadget.gadgetbridge.util.GB.hexdump;
import android.content.SharedPreferences;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
import nodomain.freeyourgadget.gadgetbridge.GBApplication;
import nodomain.freeyourgadget.gadgetbridge.activities.devicesettings.DeviceSettingsPreferenceConst;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEvent;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventBatteryInfo;
import nodomain.freeyourgadget.gadgetbridge.deviceevents.GBDeviceEventVersionInfo;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryState;
import nodomain.freeyourgadget.gadgetbridge.service.serial.GBDeviceProtocol;
public class GalaxyBudsProtocol extends GBDeviceProtocol {
private static final Logger LOG = LoggerFactory.getLogger(GalaxyBudsProtocol.class);
final UUID UUID_DEVICE_CTRL = UUID.fromString("00001102-0000-1000-8000-00805f9b34fd");
private static final byte SOM = (byte) 0xFE;
private static final byte EOM = (byte) 0xEE;
private boolean isFirstExchange = true;
//incoming
private static final byte battery_status = (byte) 0x60;
private static final byte battery_status2 = (byte) 0x61;
//outgoing
private static final byte find_device_start = (byte) 0xa0;
private static final byte find_device_stop = (byte) 0xa1;
private static final byte set_ambient_mode = (byte) 0x80; //0x0/0x1
private static final byte set_ambient_volume = (byte) 0x84; // 0x1-0x5
private static final byte set_ambient_voice_focus = (byte) 0x85; // 0x0/0x1
private static final byte set_lock_touch = (byte) 0x90; // 0x0/0x1
private static final byte set_game_mode = (byte) 0x87; // 0x0/0x2 no idea if this is doing anything
private static final byte set_equalizer = (byte) 0x86; // 0x0/0x1
private static final byte set_reset = (byte) 0x50;
private static final byte set_touchpad_options = (byte) 0x92;
private static final byte get_debug_build_info = (byte) 0x28;
private static final byte get_serial_number = (byte) 0x29;
private static final byte get_debug_get_all_data = (byte) 0x26;
private static final byte get_debug_get_version = (byte) 0x24;
@Override
public GBDeviceEvent[] decodeResponse(byte[] responseData) {
List<GBDeviceEvent> devEvts = new ArrayList<>();
LOG.debug("received data: " + hexdump(responseData));
LOG.debug("received data length: " + responseData.length);
if (isFirstExchange) {
isFirstExchange = false;
devEvts.add(new GBDeviceEventVersionInfo()); //TODO: this is a weird hack to make the DBHelper happy. Replace with proper + detection
}
ByteBuffer incoming = ByteBuffer.wrap(responseData);
incoming.order(ByteOrder.LITTLE_ENDIAN);
byte sof = incoming.get();
if (sof != SOM) {
LOG.error("Error in message, wrong start of frame: " + hexdump(responseData));
return null;
}
byte type = incoming.get();
int length = (int) (incoming.get() & 0xff);
byte message_id = incoming.get();
byte[] payload;
try {
payload = Arrays.copyOfRange(responseData, incoming.position(), incoming.position() + length);
} catch (Exception e) {
LOG.error("Error getting payload data: " + length + " , " + e);
return null;
}
switch (message_id) {
case battery_status:
devEvts.addAll(handleBatteryInfo(Arrays.copyOfRange(payload, 1, 3)));
break;
case battery_status2:
devEvts.addAll(handleBatteryInfo(Arrays.copyOfRange(payload, 2, 4)));
break;
default:
LOG.debug("Unhandled: " + hexdump(responseData));
}
return devEvts.toArray(new GBDeviceEvent[devEvts.size()]);
}
byte[] encodeMessage(byte command) {
ByteBuffer msgBuf = ByteBuffer.allocate(7);
msgBuf.order(ByteOrder.LITTLE_ENDIAN);
msgBuf.put(SOM);
msgBuf.put((byte) 0x0); //0x0 for sending
msgBuf.put((byte) 0x3); //size
msgBuf.put((byte) command); //command id
msgBuf.putShort((short) crc16_ccitt(new byte[]{command}));
msgBuf.put(EOM);
LOG.debug("DEBUG: " + hexdump(msgBuf.array()));
return msgBuf.array();
}
byte[] encodeMessage(byte command, byte parameter) {
ByteBuffer msgBuf = ByteBuffer.allocate(8);
msgBuf.order(ByteOrder.LITTLE_ENDIAN);
msgBuf.put(SOM);
msgBuf.put((byte) 0x0); //0x0 for sending
msgBuf.put((byte) 0x4); //size
msgBuf.put((byte) command); //command id
msgBuf.put((byte) parameter);
msgBuf.putShort((short) crc16_ccitt(new byte[]{command, parameter}));
msgBuf.put(EOM);
LOG.debug("DEBUG: " + hexdump(msgBuf.array()));
return msgBuf.array();
}
byte[] encodeMessage(byte command, byte parameter, byte value) {
ByteBuffer msgBuf = ByteBuffer.allocate(9);
msgBuf.order(ByteOrder.LITTLE_ENDIAN);
msgBuf.put(SOM);
msgBuf.put((byte) 0x0); //0x0 for sending
msgBuf.put((byte) 0x5); //size
msgBuf.put((byte) command);
msgBuf.put((byte) parameter);
msgBuf.put((byte) value);
msgBuf.putShort((short) crc16_ccitt(new byte[]{command, parameter, value}));
msgBuf.put(EOM);
LOG.debug("DEBUG: " + hexdump(msgBuf.array()));
return msgBuf.array();
}
@Override
public byte[] encodeFindDevice(boolean start) {
byte command = (byte) (start ? find_device_start : find_device_stop);
return encodeMessage(command);
}
@Override
public byte[] encodeReset(int reset) {
if (reset == RESET_FLAGS_FACTORY_RESET) {
return encodeMessage(set_reset);
}
return null;
}
@Override
public byte[] encodeTestNewFunction() {
//return encodeMessage(get_debug_build_info);
return null;
}
@Override
public byte[] encodeSendConfiguration(String config) {
SharedPreferences prefs = GBApplication.getDeviceSpecificSharedPrefs(getDevice().getAddress());
switch (config) {
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_MODE:
byte enable_ambient = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_MODE, false) ? 0x01 : 0x00);
return encodeMessage(set_ambient_mode, enable_ambient);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS:
byte enable_voice = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOICE_FOCUS, false) ? 0x01 : 0x00);
return encodeMessage(set_ambient_voice_focus, enable_voice);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOLUME:
String ambient_volume = prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_AMBIENT_VOLUME, "1");
byte ambient_volume_byte = (byte) Integer.parseInt(ambient_volume);
return encodeMessage(set_ambient_volume, ambient_volume_byte);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_LOCK_TOUCH:
byte set_lock = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_LOCK_TOUCH, false) ? 0x01 : 0x00);
return encodeMessage(set_lock_touch, set_lock);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_GAME_MODE:
byte game_mode = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_GAME_MODE, false) ? 0x2 : 0x00);
return encodeMessage(set_game_mode, game_mode);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER:
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER_DOLBY:
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER_MODE:
byte equalizer = (byte) (prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER, false) ? 0x1 : 0x00);
boolean equalizer_dolby = prefs.getBoolean(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER_DOLBY, false);
int dolby = 0;
if (equalizer_dolby) {
dolby = 5;
}
String equalizer_mode = prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_EQUALIZER_MODE, "0");
byte mode = (byte) (Integer.parseInt(equalizer_mode) + dolby);
return encodeMessage(set_equalizer, equalizer, mode);
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT:
case DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_RIGHT:
String touch_left = prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_LEFT, "1");
String touch_right = prefs.getString(DeviceSettingsPreferenceConst.PREF_GALAXY_BUDS_TOUCH_RIGHT, "1");
byte touchmode_left = (byte) Integer.parseInt(touch_left);
byte touchmode_right = (byte) Integer.parseInt(touch_right);
return encodeMessage(set_touchpad_options, touchmode_left, touchmode_right);
default:
LOG.debug("CONFIG: " + config);
}
return super.encodeSendConfiguration(config);
}
private List<GBDeviceEvent> handleBatteryInfo(byte[] payload) {
List<GBDeviceEvent> deviceEvents = new ArrayList<>();
LOG.debug("Battery payload: " + hexdump(payload));
LOG.debug("pl: " + payload.length);
LOG.debug("p0: " + payload[0]);
LOG.debug("p1: " + payload[1]);
int batteryLevel1 = payload[0];
int batteryLevel2 = payload[1];
GBDeviceEventBatteryInfo evBattery1 = new GBDeviceEventBatteryInfo();
//evBattery1.batteryIndex = 0;
evBattery1.level = GBDevice.BATTERY_UNKNOWN;
evBattery1.level = (batteryLevel1 > 0) ? (short) batteryLevel1 : GBDevice.BATTERY_UNKNOWN;
evBattery1.state = (batteryLevel1 > 0) ? BatteryState.BATTERY_NORMAL : BatteryState.UNKNOWN;
deviceEvents.add(evBattery1);
GBDeviceEventBatteryInfo evBattery2 = new GBDeviceEventBatteryInfo();
//evBattery2.batteryIndex = 1;
evBattery2.level = GBDevice.BATTERY_UNKNOWN;
evBattery2.level = (batteryLevel2 > 0) ? (short) batteryLevel2 : GBDevice.BATTERY_UNKNOWN;
evBattery2.state = (batteryLevel2 > 0) ? BatteryState.BATTERY_NORMAL : BatteryState.UNKNOWN;
//deviceEvents.add(evBattery2);
return deviceEvents;
}
protected GalaxyBudsProtocol(GBDevice device) {
super(device);
}
}

View File

@ -84,6 +84,7 @@ public class Ear1Support extends AbstractSerialDeviceSupport {
@Override @Override
protected GBDeviceIoThread createDeviceIOThread() { protected GBDeviceIoThread createDeviceIOThread() {
return new NothingIOThread(getDevice(), getContext(), (NothingProtocol) getDeviceProtocol(), Ear1Support.this, getBluetoothAdapter()); return new NothingIOThread(getDevice(), getContext(), (NothingProtocol) getDeviceProtocol(),
Ear1Support.this, getBluetoothAdapter());
} }
} }

View File

@ -29,7 +29,8 @@ public class NothingIOThread extends BtClassicIoThread {
return mNothingProtocol.UUID_DEVICE_CTRL; return mNothingProtocol.UUID_DEVICE_CTRL;
} }
public NothingIOThread(GBDevice device, Context context, NothingProtocol deviceProtocol, Ear1Support ear1Support, BluetoothAdapter bluetoothAdapter) { public NothingIOThread(GBDevice device, Context context, NothingProtocol deviceProtocol,
Ear1Support ear1Support, BluetoothAdapter bluetoothAdapter) {
super(device, context, deviceProtocol, ear1Support, bluetoothAdapter); super(device, context, deviceProtocol, ear1Support, bluetoothAdapter);
mNothingProtocol = deviceProtocol; mNothingProtocol = deviceProtocol;
} }

View File

@ -115,4 +115,39 @@ public class CheckSums {
} }
return out.toByteArray(); return out.toByteArray();
} }
// https://github.com/ThePBone/GalaxyBudsClient/blob/master/GalaxyBudsClient/Utils/CRC16.cs
private static int[] Crc16Tab =
{0, 4129, 8258, 12387, 16516, 20645, 24774, 28903, 33032, 37161, 41290,
45419, 49548, 53677, 57806, 61935, 4657, 528, 12915, 8786, 21173, 17044, 29431, 25302,
37689, 33560, 45947, 41818, 54205, 50076, 62463, 58334, 9314, 13379, 1056, 5121, 25830,
29895, 17572, 21637, 42346, 46411, 34088, 38153, 58862, 62927, 50604, 54669, 13907,
9842, 5649, 1584, 30423, 26358, 22165, 18100, 46939, 42874, 38681, 34616, 63455, 59390,
55197, 51132, 18628, 22757, 26758, 30887, 2112, 6241, 10242, 14371, 51660, 55789,
59790, 63919, 35144, 39273, 43274, 47403, 23285, 19156, 31415, 27286, 6769, 2640,
14899, 10770, 56317, 52188, 64447, 60318, 39801, 35672, 47931, 43802, 27814, 31879,
19684, 23749, 11298, 15363, 3168, 7233, 60846, 64911, 52716, 56781, 44330, 48395,
36200, 40265, 32407, 28342, 24277, 20212, 15891, 11826, 7761, 3696, 65439, 61374,
57309, 53244, 48923, 44858, 40793, 36728, 37256, 33193, 45514, 41451, 53516, 49453,
61774, 57711, 4224, 161, 12482, 8419, 20484, 16421, 28742, 24679, 33721, 37784, 41979,
46042, 49981, 54044, 58239, 62302, 689, 4752, 8947, 13010, 16949, 21012, 25207, 29270,
46570, 42443, 38312, 34185, 62830, 58703, 54572, 50445, 13538, 9411, 5280, 1153, 29798,
25671, 21540, 17413, 42971, 47098, 34713, 38840, 59231, 63358, 50973, 55100, 9939,
14066, 1681, 5808, 26199, 30326, 17941, 22068, 55628, 51565, 63758, 59695, 39368,
35305, 47498, 43435, 22596, 18533, 30726, 26663, 6336, 2273, 14466, 10403, 52093,
56156, 60223, 64286, 35833, 39896, 43963, 48026, 19061, 23124, 27191, 31254, 2801,
6864, 10931, 14994, 64814, 60687, 56684, 52557, 48554, 44427, 40424, 36297, 31782,
27655, 23652, 19525, 15522, 11395, 7392, 3265, 61215, 65342, 53085, 57212, 44955,
49082, 36825, 40952, 28183, 32310, 20053, 24180, 11923, 16050, 3793, 7920};
// // https://github.com/ThePBone/GalaxyBudsClient/blob/master/GalaxyBudsClient/Utils/CRC16.cs
public static int crc16_ccitt(byte[] data) {
int i2 = 0;
for (int i3 = 0; i3 < data.length; i3++)
i2 = Crc16Tab[((i2 >> 8) ^ data[i3]) & 255] ^ (i2 << 8);
return 65535 & i2;
}
} }

View File

@ -49,6 +49,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.banglejs.BangleJSCoordinator
import nodomain.freeyourgadget.gadgetbridge.devices.casio.gb6900.CasioGB6900DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.casio.gb6900.CasioGB6900DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.casio.gbx100.CasioGBX100DeviceCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.casio.gbx100.CasioGBX100DeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.domyos.DomyosT540Cooridnator; import nodomain.freeyourgadget.gadgetbridge.devices.domyos.DomyosT540Cooridnator;
import nodomain.freeyourgadget.gadgetbridge.devices.galaxy_buds.GalaxyBudsDeviceCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hplus.EXRIZUK8Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hplus.HPlusCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.hplus.MakibesF68Coordinator; import nodomain.freeyourgadget.gadgetbridge.devices.hplus.MakibesF68Coordinator;
@ -308,6 +309,7 @@ public class DeviceHelper {
result.add(new DomyosT540Cooridnator()); result.add(new DomyosT540Cooridnator());
result.add(new FitProDeviceCoordinator()); result.add(new FitProDeviceCoordinator());
result.add(new Ear1Coordinator()); result.add(new Ear1Coordinator());
result.add(new GalaxyBudsDeviceCoordinator());
return result; return result;
} }

View File

@ -0,0 +1,38 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="40dp"
android:height="40dp"
android:viewportWidth="40"
android:viewportHeight="40">
<path
android:fillColor="#4dabf5"
android:pathData="M7.406 5h25.188A2.406 2.406 0 0 1 35 7.406v25.188A2.406 2.406 0 0 1 32.594 35H7.406A2.406 2.406 0 0 1 5 32.594V7.406A2.406 2.406 0 0 1 7.406 5z"
android:strokeWidth="0.5"
android:strokeLineCap="round"
android:strokeLineJoin="round" />
<path
android:fillType="evenOdd"
android:pathData="M30.167 28.505c0.948 1.319 0.267 3.353-2.36 3.354m-0.054-8.956c-1.778-0.713-3.045-0.687-4.68-0.217-0.765 0.22-1.366 1.121-1.428 1.916-0.286 3.663 1.936 5.449 4.175 5.287 1.373-0.1 2.754-1.83 3.085-3.342 0.28-1.272 0.056-3.159-1.152-3.644z"
android:strokeWidth="0.90000004"
android:strokeColor="#fcffff" />
<path
android:pathData="M26.205 21.204c-2.356-0.34-4.769 0.663-5.75 2.912-1.315 3.015 0.581 7.91 4.083 8.428 6.444 0.952 8.538-10.35 1.667-11.34"
android:strokeWidth="0.90000004"
android:strokeColor="#fcffff" />
<path
android:pathData="M24.794 18.419c1.019 0.267 1.653 1.666 2.437 2.32 1.049 0.874 2.22 1.353 2.91 2.607 0.527 0.955 0.382 2.317 0.94 3.157 0.293 0.44 0.874 0.643 1.203 1.079 1.027 1.355 0.914 3.401-0.32 4.592-0.813 0.785-2.094 1.107-3.193 0.854-0.469-0.108-0.92-0.497-1.411-0.457-1.147 0.094-1.858 0.653-3.079 0.335-4.312-1.123-5.927-6.162-4.972-10.073 0.504-2.068 3.027-5.06 5.485-4.415"
android:strokeWidth="0.90000004"
android:strokeColor="#fcffff" />
<path
android:pathData="M15.972 6.687c-1.02 0.267-1.654 1.667-2.438 2.32-1.048 0.874-2.22 1.353-2.91 2.607-0.526 0.955-0.382 2.318-0.94 3.158-0.292 0.439-0.873 0.643-1.202 1.078-1.027 1.355-0.914 3.401 0.32 4.592 0.812 0.785 2.093 1.108 3.193 0.854 0.468-0.108 0.92-0.497 1.41-0.457 1.147 0.094 1.859 0.653 3.08 0.335 4.312-1.122 5.927-6.162 4.972-10.073-0.505-2.068-3.027-5.06-5.485-4.414"
android:strokeWidth="0.999996"
android:strokeColor="#fcffff" />
<path
android:fillType="evenOdd"
android:pathData="M10.599 16.774c-0.949 1.318-0.267 3.352 2.36 3.353m0.054-8.955c1.778-0.714 3.045-0.688 4.68-0.218 0.765 0.22 1.366 1.122 1.428 1.916 0.286 3.663-1.936 5.449-4.176 5.287-1.373-0.1-2.753-1.83-3.085-3.342-0.279-1.272-0.056-3.158 1.153-3.643z"
android:strokeWidth="0.999996"
android:strokeColor="#fcffff" />
<path
android:pathData="M14.56 9.472c2.357-0.34 4.77 0.663 5.75 2.912 1.316 3.015-0.58 7.91-4.082 8.428-6.445 0.952-8.538-10.35-1.668-11.34"
android:strokeWidth="0.999996"
android:strokeColor="#fcffff" />
</vector>

View File

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="40dp" android:height="40dp" android:viewportWidth="40" android:viewportHeight="40">
<path android:fillColor="#7a7a7a" android:pathData="M7.406 5h25.188A2.406 2.406 0 0 1 35 7.406v25.188A2.406 2.406 0 0 1 32.594 35H7.406A2.406 2.406 0 0 1 5 32.594V7.406A2.406 2.406 0 0 1 7.406 5z" android:strokeWidth="0.5" android:strokeLineCap="round" android:strokeLineJoin="round"/>
<path android:fillType="evenOdd" android:pathData="M30.167 28.505c0.948 1.319 0.267 3.353-2.36 3.354m-0.054-8.956c-1.778-0.713-3.045-0.687-4.68-0.217-0.765 0.22-1.366 1.121-1.428 1.916-0.286 3.663 1.936 5.449 4.175 5.287 1.373-0.1 2.754-1.83 3.085-3.342 0.28-1.272 0.056-3.159-1.152-3.644z" android:strokeWidth="0.90000004" android:strokeColor="#fcffff"/>
<path android:pathData="M26.205 21.204c-2.356-0.34-4.769 0.663-5.75 2.912-1.315 3.015 0.581 7.91 4.083 8.428 6.444 0.952 8.538-10.35 1.667-11.34" android:strokeWidth="0.90000004" android:strokeColor="#fcffff"/>
<path android:pathData="M24.794 18.419c1.019 0.267 1.653 1.666 2.437 2.32 1.049 0.874 2.22 1.353 2.91 2.607 0.527 0.955 0.382 2.317 0.94 3.157 0.293 0.44 0.874 0.643 1.203 1.079 1.027 1.355 0.914 3.401-0.32 4.592-0.813 0.785-2.094 1.107-3.193 0.854-0.469-0.108-0.92-0.497-1.411-0.457-1.147 0.094-1.858 0.653-3.079 0.335-4.312-1.123-5.927-6.162-4.972-10.073 0.504-2.068 3.027-5.06 5.485-4.415" android:strokeWidth="0.90000004" android:strokeColor="#fcffff"/>
<path android:pathData="M15.972 6.687c-1.02 0.267-1.654 1.667-2.438 2.32-1.048 0.874-2.22 1.353-2.91 2.607-0.526 0.955-0.382 2.318-0.94 3.158-0.292 0.439-0.873 0.643-1.202 1.078-1.027 1.355-0.914 3.401 0.32 4.592 0.812 0.785 2.093 1.108 3.193 0.854 0.468-0.108 0.92-0.497 1.41-0.457 1.147 0.094 1.859 0.653 3.08 0.335 4.312-1.122 5.927-6.162 4.972-10.073-0.505-2.068-3.027-5.06-5.485-4.414" android:strokeWidth="0.999996" android:strokeColor="#fcffff"/>
<path android:fillType="evenOdd" android:pathData="M10.599 16.774c-0.949 1.318-0.267 3.352 2.36 3.353m0.054-8.955c1.778-0.714 3.045-0.688 4.68-0.218 0.765 0.22 1.366 1.122 1.428 1.916 0.286 3.663-1.936 5.449-4.176 5.287-1.373-0.1-2.753-1.83-3.085-3.342-0.279-1.272-0.056-3.158 1.153-3.643z" android:strokeWidth="0.999996" android:strokeColor="#fcffff"/>
<path android:pathData="M14.56 9.472c2.357-0.34 4.77 0.663 5.75 2.912 1.316 3.015-0.58 7.91-4.082 8.428-6.445 0.952-8.538-10.35-1.668-11.34" android:strokeWidth="0.999996" android:strokeColor="#fcffff"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M7 18h2V6H7v12zm4 4h2V2h-2v20zm-8-8h2v-4H3v4zm12 4h2V6h-2v12zm4-8v4h2v-4h-2z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M17 20c-0.29 0-0.56-0.06-0.76-0.15-0.71-0.37-1.21-0.88-1.71-2.38-0.51-1.56-1.47-2.29-2.39-3-0.79-0.61-1.61-1.24-2.32-2.53C9.29 10.98 9 9.93 9 9c0-2.8 2.2-5 5-5s5 2.2 5 5h2c0-3.93-3.07-7-7-7S7 5.07 7 9c0 1.26 0.38 2.65 1.07 3.9 0.91 1.65 1.98 2.48 2.85 3.15 0.81 0.62 1.39 1.07 1.71 2.05 0.6 1.82 1.37 2.84 2.73 3.55C15.87 21.88 16.43 22 17 22c2.21 0 4-1.79 4-4h-2c0 1.1-0.9 2-2 2zM7.64 2.64L6.22 1.22C4.23 3.21 3 5.96 3 9s1.23 5.79 3.22 7.78l1.41-1.41C6.01 13.74 5 11.49 5 9s1.01-4.74 2.64-6.36zM11.5 9c0 1.38 1.12 2.5 2.5 2.5s2.5-1.12 2.5-2.5-1.12-2.5-2.5-2.5-2.5 1.12-2.5 2.5z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M12 3l0.01 10.55c-0.59-0.34-1.27-0.55-2-0.55C7.79 13 6 14.79 6 17s1.79 4 4.01 4S14 19.21 14 17V7h4V3h-6zm-1.99 16c-1.1 0-2-0.9-2-2s0.9-2 2-2 2 0.9 2 2-0.9 2-2 2z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M18.19 12.44l-3.24-1.62c1.29-1 2.12-2.56 2.12-4.32 0-3.03-2.47-5.5-5.5-5.5s-5.5 2.47-5.5 5.5c0 2.13 1.22 3.98 3 4.89v3.26c-2.15-0.46-2.02-0.44-2.26-0.44-0.53 0-1.03 0.21-1.41 0.59L4 16.22l5.09 5.09C9.52 21.75 10.12 22 10.74 22h6.3c0.98 0 1.81-0.7 1.97-1.67l0.8-4.71c0.22-1.3-0.43-2.58-1.62-3.18zm-0.35 2.85L17.04 20h-6.3c-0.09 0-0.17-0.04-0.24-0.1l-3.68-3.68 4.25 0.89V6.5c0-0.28 0.22-0.5 0.5-0.5s0.5 0.22 0.5 0.5v6h1.76l3.46 1.73c0.4 0.2 0.62 0.63 0.55 1.06zM8.07 6.5c0-1.93 1.57-3.5 3.5-3.5s3.5 1.57 3.5 3.5c0 0.95-0.38 1.81-1 2.44V6.5c0-1.38-1.12-2.5-2.5-2.5s-2.5 1.12-2.5 2.5v2.44c-0.62-0.63-1-1.49-1-2.44z"/>
</vector>

View File

@ -0,0 +1,4 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M21 6H3C1.9 6 1 6.9 1 8v8c0 1.1 0.9 2 2 2h18c1.1 0 2-0.9 2-2V8c0-1.1-0.9-2-2-2zm0 10H3V8h18v8zM6 15h2v-2h2v-2H8V9H6v2H4v2h2z"/>
<path android:fillColor="@android:color/white" android:pathData="M13 13.5a1.5 1.5 0 1 1 3 0 1.5 1.5 0 1 1-3 0m4-3a1.5 1.5 0 1 1 3 0 1.5 1.5 0 1 1-3 0"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M9 13c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0-6c1.1 0 2 0.9 2 2s-0.9 2-2 2-2-0.9-2-2 0.9-2 2-2zm0 8c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4zm-6 4c0.22-0.72 3.31-2 6-2 2.7 0 5.8 1.29 6 2H3zM15.08 7.05c0.84 1.18 0.84 2.71 0 3.89l1.68 1.69c2.02-2.02 2.02-5.07 0-7.27l-1.68 1.69zM20.07 2l-1.63 1.63c2.77 3.02 2.77 7.56 0 10.74L20.07 16c3.9-3.89 3.91-9.95 0-14z"/>
</vector>

View File

@ -0,0 +1,3 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:autoMirrored="true" android:tint="#7E7E7E" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="@android:color/white" android:pathData="M3 9v6h4l5 5V4L7 9H3zm7-0.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-0.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89 0.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-0.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"/>
</vector>

View File

@ -1601,6 +1601,13 @@
<string name="pref_media_forward_value" translatable="false">FORWARD</string> <string name="pref_media_forward_value" translatable="false">FORWARD</string>
<string name="pref_media_rewind_value" translatable="false">REWIND</string> <string name="pref_media_rewind_value" translatable="false">REWIND</string>
<string name="pref_device_action_broadcast_value" translatable="false">BROADCAST</string> <string name="pref_device_action_broadcast_value" translatable="false">BROADCAST</string>
<string name="pref_title_touch_voice_assistant">Voice Assistant</string>
<string name="pref_title_touch_quick_ambient">Quick Ambient Sound</string>
<string name="pref_title_touch_volume">Volume</string>
<string name="pref_title_touch_ambient">Ambient Sound</string>
<string name="pref_title_touch_spotify">Spotify</string>
<string name="pref_title_touch_other_l">Other Left</string>
<string name="pref_title_touch_other_r">Other Right</string>
<string-array name="device_action_options"> <string-array name="device_action_options">
<item>@string/pref_button_action_disabled</item> <item>@string/pref_button_action_disabled</item>
@ -1788,5 +1795,44 @@
<item>false</item> <item>false</item>
</string-array> </string-array>
<string-array name="ambient_volume_values">
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
<item>5</item>
</string-array>
<string-array name="galaxy_eqalizer_modes">
<item>@string/pref_title_equalizer_bass_boost</item>
<item>@string/pref_title_equalizer_soft</item>
<item>@string/pref_title_equalizer_dynamic</item>
<item>@string/pref_title_equalizer_clear</item>
<item>@string/pref_title_equalizer_trebble</item>
</string-array>
<string-array name="galaxy_eqalizer_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
<item>4</item>
</string-array>
<string-array name="galaxy_touch_options">
<!-- <item>@string/pref_title_touch_voice_assistant</item> -->
<item>@string/pref_title_touch_quick_ambient</item>
<!-- <item>@string/pref_title_touch_volume</item> -->
<item>@string/pref_title_touch_ambient</item>
</string-array>
<string-array name="galaxy_touch_options_values">
<!-- <item>0</item> -->
<item>1</item>
<!-- <item>2</item> -->
<item>3</item>
</string-array>
</resources> </resources>

View File

@ -1282,7 +1282,32 @@
<string name="prefs_autoheartrate_sleep">Take measurements during sleep</string> <string name="prefs_autoheartrate_sleep">Take measurements during sleep</string>
<string name="prefs_autoheartrate_interval">Frequency of measurements</string> <string name="prefs_autoheartrate_interval">Frequency of measurements</string>
<string name="devicetype_nothingear1">Nothing Ear (1)</string> <string name="devicetype_nothingear1">Nothing Ear (1)</string>
<string name="devicetype_galaxybuds">Galaxy Buds</string>
<string name="nothing_prefs_inear_summary">Play/pause the music depending if you wear the earbuds</string> <string name="nothing_prefs_inear_summary">Play/pause the music depending if you wear the earbuds</string>
<string name="nothing_prefs_inear_title">In-Ear detection</string> <string name="nothing_prefs_inear_title">In-Ear detection</string>
<string name="nothing_prefs_audiomode_title">Audio mode</string> <string name="nothing_prefs_audiomode_title">Audio mode</string>
<string name="prefs_equalizer_preset">Equalizer Preset</string>
<string name="pref_title_equalizer_bass_boost">Bass boost</string>
<string name="pref_title_equalizer_soft">Soft</string>
<string name="pref_title_equalizer_dynamic">Dynamic</string>
<string name="pref_title_equalizer_clear">Clear</string>
<string name="pref_title_equalizer_trebble">Treble boost</string>
<string name="prefs_dolby_mode">Dolby Mode</string>
<string name="prefs_equalizer">Equalizer</string>
<string name="prefs_equalizer_summary">Enable or disable equalizer</string>
<string name="prefs_dolby_summary">Dolby preset for equalizer</string>
<string name="prefs_game_mode">Game mode</string>
<string name="prefs_game_mode_summary">Only if your phone supports game mode</string>
<string name="prefs_touch_lock">Touch Lock</string>
<string name="prefs_touch_lock_summary">Disable touch events</string>
<string name="prefs_galaxy_buds_experimental">Experimental</string>
<string name="prefs_ambient_volume">Ambient volume</string>
<string name="prefs_ambient_volume_summary">pref_galaxy_buds_ambient_volume</string>
<string name="prefs_ambient_voice_focus">Voice Focus</string>
<string name="prefs_ambient_voice_summary">Make voice stand out</string>
<string name="prefs_ambient_sound">Ambient Sound</string>
<string name="prefs_ambient_mode">Ambient Mode</string>
<string name="prefs_left">Left</string>
<string name="prefs_right">Right</string>
<string name="prefs_galaxy_touch_options">Touch Options</string>
</resources> </resources>

View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
<PreferenceScreen
android:icon="@drawable/ic_hearing"
android:key="prefs_ambient_mode"
android:persistent="false"
android:title="@string/prefs_ambient_mode">
<PreferenceCategory android:title="@string/prefs_ambient_mode">
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_hearing"
android:key="pref_galaxy_buds_ambient_mode"
android:summary="Hear surrounding sounds"
android:title="@string/prefs_ambient_sound" />
<SwitchPreference
android:defaultValue="false"
android:dependency="pref_galaxy_buds_ambient_mode"
android:icon="@drawable/ic_voice"
android:key="pref_galaxy_buds_ambient_voice_focus"
android:summary="@string/prefs_ambient_voice_summary"
android:title="@string/prefs_ambient_voice_focus" />
<ListPreference
android:dependency="pref_galaxy_buds_ambient_mode"
android:entries="@array/ambient_volume_values"
android:entryValues="@array/ambient_volume_values"
android:icon="@drawable/ic_volume_up"
android:key="@string/prefs_ambient_volume_summary"
android:summary="%s"
android:title="@string/prefs_ambient_volume" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_graphic_eq"
android:key="prefs_equalizer"
android:persistent="false"
android:title="@string/prefs_equalizer">
<PreferenceCategory android:title="@string/prefs_equalizer">
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_graphic_eq"
android:key="pref_galaxy_buds_equalizer"
android:summary="@string/prefs_equalizer_summary"
android:title="@string/prefs_equalizer" />
<SwitchPreference
android:defaultValue="false"
android:dependency="pref_galaxy_buds_equalizer"
android:icon="@drawable/ic_music_note"
android:key="pref_galaxy_buds_equalizer_dolby"
android:summary="@string/prefs_dolby_summary"
android:title="@string/prefs_dolby_mode" />
<ListPreference
android:dependency="pref_galaxy_buds_equalizer"
android:entries="@array/galaxy_eqalizer_modes"
android:entryValues="@array/galaxy_eqalizer_values"
android:icon="@drawable/ic_equalizer"
android:key="pref_galaxy_buds_equalizer_mode"
android:summary="%s"
android:title="@string/prefs_equalizer_preset" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceScreen
android:icon="@drawable/ic_touch"
android:key="prefs_galaxy_touch_options"
android:persistent="false"
android:title="@string/prefs_galaxy_touch_options">
<PreferenceCategory android:title="@string/prefs_galaxy_touch_options">
<SwitchPreference
android:defaultValue="false"
android:disableDependentsState="true"
android:icon="@drawable/ic_lock_open"
android:key="pref_galaxy_buds_lock_touch"
android:summary="@string/prefs_touch_lock_summary"
android:title="@string/prefs_touch_lock" />
<ListPreference
android:dependency="pref_galaxy_buds_lock_touch"
android:entries="@array/galaxy_touch_options"
android:entryValues="@array/galaxy_touch_options_values"
android:icon="@drawable/ic_touch"
android:key="pref_galaxy_buds_touch_left"
android:summary="%s"
android:title="@string/prefs_left" />
<ListPreference
android:dependency="pref_galaxy_buds_lock_touch"
android:entries="@array/galaxy_touch_options"
android:entryValues="@array/galaxy_touch_options_values"
android:icon="@drawable/ic_touch"
android:key="pref_galaxy_buds_touch_right"
android:summary="%s"
android:title="@string/prefs_right" />
</PreferenceCategory>
</PreferenceScreen>
<PreferenceCategory android:title="@string/prefs_galaxy_buds_experimental">
<SwitchPreference
android:defaultValue="false"
android:icon="@drawable/ic_videogame"
android:key="pref_galaxy_buds_game_mode"
android:summary="@string/prefs_game_mode_summary"
android:title="@string/prefs_game_mode" />
</PreferenceCategory>
</androidx.preference.PreferenceScreen>