Revert "ipacm: Add support for DataWarning limit"
This reverts commit 2e035f7ce11fd7f4fca5e8b2ab36165664b2f4bd.
Change-Id: Ia0abf7497b1d57c3a6e224540732369b50c44283
diff --git a/ipacm/Android.bp b/ipacm/Android.bp
index a237e7c..fbb69e3 100644
--- a/ipacm/Android.bp
+++ b/ipacm/Android.bp
@@ -57,7 +57,6 @@
"libhardware",
"android.hardware.tetheroffload.config@1.0",
"android.hardware.tetheroffload.control@1.0",
- "android.hardware.tetheroffload.control@1.1",
],
}
diff --git a/ipacm/inc/IPACM_OffloadManager.h b/ipacm/inc/IPACM_OffloadManager.h
index 146fde8..8ac904f 100644
--- a/ipacm/inc/IPACM_OffloadManager.h
+++ b/ipacm/inc/IPACM_OffloadManager.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -83,10 +83,8 @@
/* ------------------------- STATS/POLICY --------------------------- */
virtual RET setQuota(const char * /* upstream */, uint64_t /* limit */);
- virtual RET setQuotaWarning(const char * /* upstream */,
- uint64_t /* quota limit */, uint64_t /* warning limit */);
virtual RET getStats(const char * /* upstream */, bool /* reset */,
- OffloadStatistics& /* ret */);
+ OffloadStatistics& /* ret */);
static IPACM_OffloadManager *pInstance;
diff --git a/ipacm/src/IPACM_Main.cpp b/ipacm/src/IPACM_Main.cpp
index 8166329..e29289d 100644
--- a/ipacm/src/IPACM_Main.cpp
+++ b/ipacm/src/IPACM_Main.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2013-2021, The Linux Foundation. All rights reserved.
+Copyright (c) 2013-2019, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -783,18 +783,6 @@
OffloadMng->elrInstance->onLimitReached();
}
continue;
-#ifdef IPA_WARNING_LIMIT_EVENT_MAX
- case IPA_WARNING_LIMIT_REACHED:
- IPACMDBG_H("Received IPA_WARNING_LIMIT_REACHED\n");
- OffloadMng = IPACM_OffloadManager::GetInstance();
- if (OffloadMng->elrInstance == NULL) {
- IPACMERR("OffloadMng->elrInstance is NULL, can't forward to framework!\n");
- } else {
- IPACMERR("calling OffloadMng->elrInstance->onWarningReached \n");
- OffloadMng->elrInstance->onWarningReached();
- }
- continue;
-#endif
case IPA_SSR_BEFORE_SHUTDOWN:
IPACMDBG_H("Received IPA_SSR_BEFORE_SHUTDOWN\n");
IPACM_Wan::clearExtProp();
diff --git a/ipacm/src/IPACM_OffloadManager.cpp b/ipacm/src/IPACM_OffloadManager.cpp
index 2b8012d..708725b 100644
--- a/ipacm/src/IPACM_OffloadManager.cpp
+++ b/ipacm/src/IPACM_OffloadManager.cpp
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
+Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -651,63 +651,6 @@
return SUCCESS;
}
-RET IPACM_OffloadManager::setQuotaWarning(const char * upstream_name /* upstream */,
-uint64_t quota_mb/* quota limit */, uint64_t warning_mb/* warning limit */)
-{
-#ifdef WAN_IOC_SET_DATA_QUOTA_WARNING
- wan_ioctl_set_data_quota_warning ioctl_data;
- int fd = -1, rc = 0, err_type = 0;
-
- if ((fd = open(DEVICE_NAME, O_RDWR)) < 0)
- {
- IPACMERR("Failed opening %s.\n", DEVICE_NAME);
- return FAIL_HARDWARE;
- }
-
- memset(&ioctl_data, 0, sizeof(ioctl_data));
-
- if (quota_mb != 0)
- {
- ioctl_data.quota_mbytes = quota_mb;
- ioctl_data.set_quota = true;
- }
-
- if (warning_mb != 0)
- {
- ioctl_data.warning_mbytes = warning_mb;
- ioctl_data.set_warning = true;
- }
-
-
- if (strlcpy(ioctl_data.interface_name, upstream_name, IFNAMSIZ) >= IFNAMSIZ) {
- IPACMERR("String truncation occurred on upstream");
- close(fd);
- return FAIL_INPUT_CHECK;
- }
-
- IPACMDBG_H("SET_DATA_QUOTA_WARNING: Dev: %s, Quota: %llu, Warning: %llu\n",
- ioctl_data.interface_name, (long long)quota_mb,
- (long long)warning_mb);
-
- rc = ioctl(fd, WAN_IOC_SET_DATA_QUOTA_WARNING, &ioctl_data);
- close(fd);
- if(rc != 0)
- {
- err_type = errno;
- IPACMERR("IOCTL WAN_IOC_SET_DATA_QUOTA_WARNING call failed: %s err_type: %d\n", strerror(err_type), err_type);
- if (err_type == ENODEV) {
- IPACMDBG_H("Invalid argument.\n");
- return FAIL_UNSUPPORTED;
- }
- else {
- return FAIL_TRY_AGAIN;
- }
- }
-#endif
- return SUCCESS;
-}
-
-
RET IPACM_OffloadManager::getStats(const char * upstream_name /* upstream */,
bool reset /* reset */, OffloadStatistics& offload_stats/* ret */)
{