The way ping is implemented for every OEM (Original Equipment Manufacturer) may be different. This is not only limited to ping. For example, try running the linux du command on old Samsung devices (S3) and newer devices (Motorola G) on adb shell.
The S3 does support du, but it does not take some parameters such as -m (display in megabytes), while newer devices such as Moto G or even Samsung devices (past Galaxy S5) does support it. Try running ping -c 1 8.8.8.8 on adb shell within S3, and you'll note that it's not your Java code, it's the OEM.
Again, even commands such as dumpsys have differently formatted output depending on Android Version and device. Because of this, it would be best if you can use a completely different method to try pinging the desired IP using APIs provided in Android instead of using a process with parameters that might be differently supported per OEM.
It can also be that the permissions are different per device.
When you run a process within your app, you only are granting the app's limited permissions to the process. So if ping requires root level permission (on the specific device), that may also be the reason why it does not work. It is ultimately up to the OEM of how they customized Android.
Source: I work at an OEM.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…