| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
public static String getProcessName() {I've added it here because `SystemStateUtil` already contains static methods for system state queries, making it seem like a reasonable and simple place for this functionality.
I considered creating a new dedicated utility class, but that felt like overkill for a single method. However, I'm open to moving it to a more appropriate location if you think it should be moved.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
+beverloo to review from the AW side
Bug: 466315206Use: b:466315206 syntax since it's an internal bug.
AgsaProcessName GetAgsaProcessNameEnum(const std::string& process_name);Add a comment.
Pass param by string_view.
std::string GetProcessName();Add a comment.
Maybe explain where this is coming from.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
"com.google.android.googlequicksearchbox") {It seems a bit weird to have this logic here, while GetAgsaProcessNameEnum() is implemented elsewhere.
I think it would make sense for both of them to be implemented together.
Perhaps the API should be GetAgsaProcessNameEnum() without a param, which would return an empty string if the package name is not AGSA.
For testing, you can have an GetAgsaProcessNameEnumImpl() in an "internal" namespace that still takes the param.
| Commit-Queue | +1 |
Use: b:466315206 syntax since it's an internal bug.
Done
It seems a bit weird to have this logic here, while GetAgsaProcessNameEnum() is implemented elsewhere.
I think it would make sense for both of them to be implemented together.
Perhaps the API should be GetAgsaProcessNameEnum() without a param, which would return an empty string if the package name is not AGSA.
For testing, you can have an GetAgsaProcessNameEnumImpl() in an "internal" namespace that still takes the param.
Done
AgsaProcessName GetAgsaProcessNameEnum(const std::string& process_name);Add a comment.
Pass param by string_view.
Done
Add a comment.
Maybe explain where this is coming from.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
histogram_tester_.ExpectTotalCount("Android.WebView.PrimaryCpuAbiBitness", 1);nit: add this line to keep the listed histograms in these three tests in sync:
```
histogram_tester_.ExpectTotalCount("Android.WebView.AgsaProcessName", 0);
```
kUnknown = 0,When do we emit `kUnknown`? Since we don't emit this histogram at all in the non-AGA case, can we merge `kOther` into it?
AgsaProcessName GetAgsaProcessNameEnumImpl(std::string_view process_name) {Do we need all of these? If the list is currently exhaustive, what's the plan for keeping it up-to-date?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
histogram_tester_.ExpectTotalCount("Android.WebView.PrimaryCpuAbiBitness", 1);nit: add this line to keep the listed histograms in these three tests in sync:
```
histogram_tester_.ExpectTotalCount("Android.WebView.AgsaProcessName", 0);
```
Done
When do we emit `kUnknown`? Since we don't emit this histogram at all in the non-AGA case, can we merge `kOther` into it?
Done
AgsaProcessName GetAgsaProcessNameEnumImpl(std::string_view process_name) {Do we need all of these? If the list is currently exhaustive, what's the plan for keeping it up-to-date?
I had a chat with jinbo@ and we are primarily interested in `:googleapp`, `:search`, and `:interactor`. I’ve kept those and omitted the others. We can always revisit this list later if need be.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
std::string GetProcessName();Please remove this from the header file, in fact, just merge the call it makes into `GetAgsaProcessNameEnum()`?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
#include <string>When you address Peter's comment below, this include can also be removed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Please remove this from the header file, in fact, just merge the call it makes into `GetAgsaProcessNameEnum()`?
Done
When you address Peter's comment below, this include can also be removed.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
10 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: android_webview/browser/metrics/system_state_util.cc
Insertions: 5, Deletions: 6.
@@ -4,6 +4,8 @@
#include "android_webview/browser/metrics/system_state_util.h"
+#include <string>
+
#include "base/android/apk_info.h"
#include "base/android/jni_string.h"
@@ -28,17 +30,14 @@
return primary_cpu_abi_bitness;
}
-std::string GetProcessName() {
- return base::android::ConvertJavaStringToUTF8(
- Java_SystemStateUtil_getProcessName(jni_zero::AttachCurrentThread()));
-}
-
std::optional<AgsaProcessName> GetAgsaProcessNameEnum() {
if (base::android::apk_info::host_package_name() !=
"com.google.android.googlequicksearchbox") {
return std::nullopt;
}
- return internal::GetAgsaProcessNameEnumImpl(GetProcessName());
+ std::string process_name = base::android::ConvertJavaStringToUTF8(
+ Java_SystemStateUtil_getProcessName(jni_zero::AttachCurrentThread()));
+ return internal::GetAgsaProcessNameEnumImpl(process_name);
}
namespace internal {
```
```
The name of the file: android_webview/browser/metrics/system_state_util.h
Insertions: 0, Deletions: 5.
@@ -6,7 +6,6 @@
#define ANDROID_WEBVIEW_BROWSER_METRICS_SYSTEM_STATE_UTIL_H_
#include <optional>
-#include <string>
#include <string_view>
namespace android_webview {
@@ -49,10 +48,6 @@
kMaxValue = kOther,
};
-// Returns the name of the current process, retrieved from the Java
-// ActivityThread via ContextUtils.
-std::string GetProcessName();
-
// Returns the AGSA process name enum if the host app is AGSA, otherwise
// nullopt.
std::optional<AgsaProcessName> GetAgsaProcessNameEnum();
```
[WebView] Update AGSA process name UMA histogram enums
This CL updates the enumerated histogram used to record the process name
for AGSA in WebView UMA metrics.
The enum values in the histogram definition (histograms.xml) have been
updated to include the key processes used by AGSA, such as :googleapp,
:search, :interactor, and others.
The client code in android_metrics_provider.cc is also updated to map
the process strings to these new enum values.
This ensures more accurate and comprehensive filtering of UMA data
based on the specific AGSA process.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |