Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b2852f02 authored by Aalique Grahame's avatar Aalique Grahame Committed by Łukasz Patron
Browse files

WiredAccessoryManager: update extcon file paths

Update the file paths used in WAM to reflect the new location
of the extcon files.

CRs-Fixed: 2232066
Change-Id: I3884074e71ea9fe974b4b2de7161dce8e5d08e76
parent 1ac5d4f8
Loading
Loading
Loading
Loading
+6 −6
Original line number Original line Diff line number Diff line
@@ -536,8 +536,8 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {


                while (true) {
                while (true) {
                    String devPath = String.format(Locale.US,
                    String devPath = String.format(Locale.US,
                            "/sys/class/switch/extcon%d/name",
                            "/sys/devices/platform/soc/%s/extcon/extcon%d/name",
                            index);
                            mDevName, index);


                    try {
                    try {
                        FileReader file = new FileReader(devPath);
                        FileReader file = new FileReader(devPath);
@@ -566,8 +566,8 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {


                while (true) {
                while (true) {
                    String cablePath = String.format(Locale.US,
                    String cablePath = String.format(Locale.US,
                            "/sys/class/switch/extcon%d/cable.%d/name",
                            "/sys/devices/platform/soc/%s/extcon/extcon%d/cable.%d/name",
                            mDevIndex, index);
                            mDevName, mDevIndex, index);


                    try {
                    try {
                        FileReader file = new FileReader(cablePath);
                        FileReader file = new FileReader(cablePath);
@@ -606,8 +606,8 @@ final class WiredAccessoryManager implements WiredAccessoryCallbacks {
            public String getSwitchStatePath() {
            public String getSwitchStatePath() {
                if (mDevName.equals(NAME_DP_AUDIO)) {
                if (mDevName.equals(NAME_DP_AUDIO)) {
                    return String.format(Locale.US,
                    return String.format(Locale.US,
                            "/sys/class/switch/extcon%d/cable.%d/state",
                            "/sys/devices/platform/soc/%s/extcon/extcon%d/cable.%d/state",
                            mDevIndex, mCableIndex);
                            mDevName, mDevIndex, mCableIndex);
                }
                }
                return String.format(Locale.US, "/sys/class/switch/%s/state", mDevName);
                return String.format(Locale.US, "/sys/class/switch/%s/state", mDevName);
            }
            }