I'm trying to use the new APN api
The code looks like this
DevicePolicyManager dpm = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE);
ComponentName deviceAdmin = new ComponentName(getApplicationContext(), DeviceAdmin.class);
ApnSetting apn = (new ApnSetting.Builder())
.setApnTypeBitmask(ApnSetting.TYPE_DEFAULT)
.setApnName("sonme.real.apn.url")
.setEntryName("Some Entry")
.setCarrierEnabled(true)
.build();
int re = dpm.addOverrideApn(deviceAdmin, apn);
dpm.setOverrideApnsEnabled(deviceAdmin, true);
But except the fact that the APN menu becomes unavailable (locked to admin - which is OK) the APN is not working
p.s
I checked with dpm.getOverrideApns(deviceAdmin);
and the added apn is present...
And I also tried setting the setProtocol
and setRoamingProtocol
Any Ideas?