diff --git a/client/client/src/main/java/org/wso2/emm/agent/services/DeviceInfoPayload.java b/client/client/src/main/java/org/wso2/emm/agent/services/DeviceInfoPayload.java index 15c5c8ff..2cbde30c 100644 --- a/client/client/src/main/java/org/wso2/emm/agent/services/DeviceInfoPayload.java +++ b/client/client/src/main/java/org/wso2/emm/agent/services/DeviceInfoPayload.java @@ -99,6 +99,7 @@ public void build() throws AndroidAgentException { private void getInfo() throws AndroidAgentException { TelephonyManager telephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); + Location deviceLocation = locationService.getLastKnownLocation(); if (device == null) { device = new Device(); @@ -225,6 +226,12 @@ private void getInfo() throws AndroidAgentException { property.setValue(String.valueOf(deviceInfo.getNetworkOperatorName())); deviceInfoProperties.add(property); + property = new Device.Property(); + property.setName(Constants.Device.PHONE_NUMBER); + String mPhoneNumber = telephonyManager.getLine1Number(); + property.setValue(mPhoneNumber); + deviceInfoProperties.add(property); + DeviceNetworkStatus deviceNetworkStatus = DeviceNetworkStatus.getInstance(context); if (deviceNetworkStatus.isConnectedMobile()) { telephonyManager.listen(deviceNetworkStatus, PhoneStateListener.LISTEN_SIGNAL_STRENGTHS); diff --git a/client/client/src/main/java/org/wso2/emm/agent/utils/Constants.java b/client/client/src/main/java/org/wso2/emm/agent/utils/Constants.java index 11df57be..749d1ea7 100644 --- a/client/client/src/main/java/org/wso2/emm/agent/utils/Constants.java +++ b/client/client/src/main/java/org/wso2/emm/agent/utils/Constants.java @@ -383,6 +383,7 @@ private Device() { public static final String PACKAGE = "PACKAGE"; public static final String PID = "PID"; public static final String SHARED_DIRTY = "SHARED_DIRTY"; + public static final String PHONE_NUMBER = "PHONE_NUMBER"; } // sqlite database related tables