Problem:
Some of the Huawei USB USB keys are not recognized by Android JellyBean4.1.2 in Beaglebone.
In detail:
I am working with BeagleBone running Android JellyBean4.1.2.
Huawei - E1731 [Locked] , Huawei - E303D [Locked] work perfectly on this platform.
Huawei E303F , Huawei E303F (Both Factory Unlocked) not recognized by the operating system (Communication files are not generated)
Work-around done by me
- Change Dongle Mode to Modem Only Mode with AT Command

- Add the vendor identifier and product identifier to the init.devicename.sh file (make the kernel recognize the USB key).

- Modify USB-Modeswitch File with VID and PID

Now the mentioned USB keys work fine.

But I want to find the root cause and have to fix it.
Is there any way to fix this by creating an Android OS from a source? If so, how? What files need to be changed?
Why were some keys recognized without the mentioned work?
UPDATE
As skoperst said, I checked option.c in kernel_dir/drivers/usb/serial/option.c

Is there any other than hard-coding Device VID & PID solution other than hard-coding Device VID & PID .
I need one more general solution to facilitate the Plug & Play mechanism.
Like Plug & Play works in linux . If this is possible with linux kernal , is it also possible with Android?
Your wonderful suggestions have been appreciated. Thank you very much in advance.
source share