Skip to content

Commit

Permalink
Add support for CIWLAN data usage
Browse files Browse the repository at this point in the history
Add an API for clients to get CIWLAN data usage.
This will be used to collect CIWLAN data usage to add
to the overall data usage count.

Change-Id: Ifcdffbac8d9cef111f6ac8d3b70e025a08d6e4b0
CRs-Fixed: 3656113
  • Loading branch information
Akshay Sundaram committed Nov 8, 2023
1 parent 645433a commit c6c474c
Showing 1 changed file with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Changes from Qualcomm Innovation Center are provided under the following license:
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
* SPDX-License_Identifier: BSD-3-Clause-Clear
*/

package org.codeaurora.ims;
Expand All @@ -40,10 +44,12 @@
public class QtiVideoCallDataUsage implements Parcelable {

private long[] mDataUsage;
public static final int DATA_USAGE_LTE = 0;
public static final int DATA_USAGE_WWAN = 0;
public static final int DATA_USAGE_WLAN = 1;
public static final int DATA_USAGE_C_IWLAN = 2;
public static final int DATA_USAGE_INVALID_VALUE = -1;
private static final String[] TEXT = {"LteDataUsage = "," WlanDataUsage = "};
private static final String[] TEXT =
{"WwanDataUsage = "," WlanDataUsage = ", " CIWlanDataUsage = "};

public QtiVideoCallDataUsage(long[] dUsage) {
if (dUsage == null || dUsage.length == 0 ) {
Expand All @@ -57,10 +63,10 @@ public QtiVideoCallDataUsage(Parcel in) {
}

/*
* This method returns LTE Data Usage
* This method returns WWAN Data Usage
*/
public long getLteDataUsage() {
return mDataUsage.length > DATA_USAGE_LTE ? mDataUsage[DATA_USAGE_LTE] :
public long getWwanDataUsage() {
return mDataUsage.length > DATA_USAGE_WWAN ? mDataUsage[DATA_USAGE_WWAN] :
DATA_USAGE_INVALID_VALUE;
}

Expand All @@ -72,6 +78,14 @@ public long getWlanDataUsage() {
DATA_USAGE_INVALID_VALUE;
}

/*
* This method returns C_IWLAN Data Usage
*/
public long getCiwlanDataUsage() {
return mDataUsage.length > DATA_USAGE_C_IWLAN ? mDataUsage[DATA_USAGE_C_IWLAN] :
DATA_USAGE_INVALID_VALUE;
}

@Override
public void writeToParcel(Parcel dest, int flag) {
dest.writeLongArray(mDataUsage);
Expand Down

0 comments on commit c6c474c

Please sign in to comment.