// See the License for the specific language governing permissions and
// limitations under the License.
+soong_config_module_type {
+ name: "gadget_name",
+ module_type: "cc_defaults",
+ config_namespace: "samsungUsbGadgetVars",
+ value_variables: ["gadget_name"],
+ properties: ["cppflags"],
+}
+
+gadget_name {
+ name: "gadget_name_defaults",
+ soong_config_variables: {
+ gadget_name: {
+ cppflags: ["-DGADGET_NAME=\"%s\""],
+ },
+ },
+}
+
cc_binary {
name: "android.hardware.usb.gadget-service.samsung",
+ defaults: ["gadget_name_defaults"],
relative_install_path: "hw",
init_rc: ["android.hardware.usb.gadget-service.samsung.rc"],
vintf_fragments: [
using ::std::shared_ptr;
using ::std::string;
-constexpr char kGadgetName[] = "10c00000.dwc3";
+constexpr char kGadgetName[] = GADGET_NAME;
#ifndef UDC_PATH
-#define UDC_PATH "/sys/class/udc/10c00000.dwc3/"
+#define UDC_PATH "/sys/class/udc/" GADGET_NAME "/"
#endif
static MonitorFfs monitorFfs(kGadgetName);