realme: add support for Realme Buds Air 6 Pro

This commit is contained in:
badcpp
2026-06-20 03:21:55 +03:00
committed by NTeditor
parent 6881bab143
commit 59d056f1f7
3 changed files with 115 additions and 0 deletions
@@ -0,0 +1,112 @@
/* Copyright (C) 2024 José Rebelo
This file is part of Gadgetbridge.
Gadgetbridge is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Gadgetbridge is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>. */
package nodomain.freeyourgadget.gadgetbridge.devices.realme;
import android.util.Pair;
import androidx.annotation.NonNull;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import nodomain.freeyourgadget.gadgetbridge.R;
import nodomain.freeyourgadget.gadgetbridge.devices.oppo.OppoHeadphonesCoordinator;
import nodomain.freeyourgadget.gadgetbridge.impl.GBDevice;
import nodomain.freeyourgadget.gadgetbridge.model.BatteryConfig;
import nodomain.freeyourgadget.gadgetbridge.service.devices.oppo.commands.TouchConfigSide;
import nodomain.freeyourgadget.gadgetbridge.service.devices.oppo.commands.TouchConfigType;
import nodomain.freeyourgadget.gadgetbridge.service.devices.oppo.commands.TouchConfigValue;
public class RealmeBudsAir6ProCoordinator extends OppoHeadphonesCoordinator {
@Override
protected Pattern getSupportedDeviceName() {
return Pattern.compile("realme Buds Air6 Pro", Pattern.LITERAL);
}
@Override
public String getManufacturer() {
return "Realme";
}
@Override
public int getDeviceNameResource() {
return R.string.devicetype_realme_buds_air_6_pro;
}
@Override
public BatteryConfig[] getBatteryConfig(final GBDevice device) {
final BatteryConfig battery1 = new BatteryConfig(0, R.drawable.ic_realme_buds_t300_l, R.string.left_earbud);
final BatteryConfig battery2 = new BatteryConfig(1, R.drawable.ic_realme_buds_t300_r, R.string.right_earbud);
final BatteryConfig battery3 = new BatteryConfig(2, R.drawable.ic_realme_buds_t300_case, R.string.battery_case);
return new BatteryConfig[]{battery1, battery2, battery3};
}
@Override
public int getDefaultIconResource() {
return R.drawable.ic_realme_buds_t300;
}
@Override
public boolean supportsFindDevice(@NonNull GBDevice device) {
return true;
}
@Override
public boolean supportsLdac(@NonNull GBDevice device) {
return true;
}
@Override
public boolean supportsMultipoint(@NonNull GBDevice device) {
return true;
}
@Override
public boolean supportsGameMode(@NonNull GBDevice device) {
return true;
}
@Override
public boolean supportsAnc(@NonNull GBDevice device) {
return true;
}
@Override
protected Map<Pair<TouchConfigSide, TouchConfigType>, List<TouchConfigValue>> getTouchOptions() {
return new LinkedHashMap<>() {{
final List<TouchConfigValue> options = Arrays.asList(
TouchConfigValue.OFF,
TouchConfigValue.PLAY_PAUSE,
TouchConfigValue.PREVIOUS,
TouchConfigValue.NEXT,
TouchConfigValue.VOLUME_UP,
TouchConfigValue.VOLUME_DOWN,
TouchConfigValue.VOICE_ASSISTANT_REALME,
TouchConfigValue.GAME_MODE,
TouchConfigValue.NOISE_CONTROL
);
put(Pair.create(TouchConfigSide.LEFT, TouchConfigType.TAP_2), options);
put(Pair.create(TouchConfigSide.LEFT, TouchConfigType.TAP_3), options);
put(Pair.create(TouchConfigSide.LEFT, TouchConfigType.HOLD), options);
put(Pair.create(TouchConfigSide.RIGHT, TouchConfigType.TAP_2), options);
put(Pair.create(TouchConfigSide.RIGHT, TouchConfigType.TAP_3), options);
put(Pair.create(TouchConfigSide.RIGHT, TouchConfigType.HOLD), options);
}};
}
}
@@ -399,6 +399,7 @@ import nodomain.freeyourgadget.gadgetbridge.devices.polar.PolarH9DeviceCoordinat
import nodomain.freeyourgadget.gadgetbridge.devices.qc35.QC35Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.qhybrid.QHybridCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsAir5ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsAir6ProCoordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsT100Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsT110Coordinator;
import nodomain.freeyourgadget.gadgetbridge.devices.realme.RealmeBudsT200Coordinator;
@@ -922,6 +923,7 @@ public enum DeviceType {
REALME_BUDS_T200(RealmeBudsT200Coordinator.class),
REALME_BUDS_T300(RealmeBudsT300Coordinator.class),
REALME_BUDS_AIR_5_PRO(RealmeBudsAir5ProCoordinator.class),
REALME_BUDS_AIR_6_PRO(RealmeBudsAir6ProCoordinator.class),
SOFLOW_SO6(SoFlowCoordinator.class),
WITHINGS_STEEL_HR(WithingsSteelHRDeviceCoordinator.class),
SONY_WENA_3(SonyWena3Coordinator.class),
+1
View File
@@ -3215,6 +3215,7 @@
<string name="devicetype_realme_buds_t200" translatable="false">Realme Buds T200</string>
<string name="devicetype_realme_buds_t300" translatable="false">Realme Buds T300</string>
<string name="devicetype_realme_buds_air_5_pro" translatable="false">Realme Buds Air 5 Pro</string>
<string name="devicetype_realme_buds_air_6_pro" translatable="false">Realme Buds Air 6 Pro</string>
<string name="devicetype_galaxybuds" translatable="false">Galaxy Buds</string>
<string name="devicetype_galaxybuds_live" translatable="false">Galaxy Buds Live</string>
<string name="devicetype_galaxybuds_pro" translatable="false">Galaxy Buds Pro</string>