Hash :
cfa03e75
Author :
Date :
2025-02-03T11:56:01
Replace .toList() with .collect()
.toList() was introduced to android in api level 34, which is newer
than angle's min_sdk_version. This was found during an android lint
update.
Replace it with .collect(Collectors.joining(",")).
Bug: b/394096385
Test: Presubmits
Change-Id: I053adfa7f8e1d6d9758413f789115eee7d66fd7a
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6226327
Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com>
Reviewed-by: Cody Northrop <cnorthrop@google.com>
Commit-Queue: Cody Northrop <cnorthrop@google.com>
ANGLE Settings UI is a UI shipped as part of the ANGLE apk. The ANGLE apk can ship with a list rules of applications using different OpenGL ES driver. The UI provides two functionalities:
Currently the ANGLE apk supports two rules: ANGLE and native OpenGL ES driver.
The rule file is a file that contains a JSON string, the format is shown below:
{
"rules":[
{
"description": "Applications in this list will use ANGLE",
"choice": "angle",
"apps": [
{
"packageName": "com.android.example.a"
},
{
"packageName": "com.android.example.b"
}
]
},
{
"description": "Applications in this list will not use ANGLE",
"choice": "native",
"apps":[
{
"packageName": "com.android.example.c"
}
]
}
]
}
The ANGLE JSON rules are parsed only when ACTION_BOOT_COMPLETED or ACTION_MY_PACKAGE_REPLACED is
received. After the JSON rules are parsed, the result will be stored in SharedPreferences as
key-value pair, with the key being the package name and the value being the driver selection choice.
The JSON parsing code is in AngleRuleHelper.
After parsing, the rules are converted to global settings variables and applied to the system. This
is done in Receiver.
The UI logic is mainly in MainFragment, and the GlobalSettings is merely for manipulating
settings global variables and updating SharedPreferences. When a user changes the driver choice
of an application, the update will go into GlobalSettings and SharedPreferences respectively.
The SharedPreferences is the source of truth and the code should always query the driver choice
from it with the package name. The SharedPreferences should only be updated within
GlobalSettings and AngleRuleHelper.
The settings global variables may also be changed via adb command by the users, often time ANGLE
for Android developers. Note that every time a boot event happens, it is expected that all previous
values in settings global variables will be cleared and only values from the ANGLE JSON rule file
will take effect.
The ANGLE Settings UI is registered as a dynamic setting entry in the development component via
<intent-filter>
<action android:name="com.android.settings.action.IA_SETTINGS" />
</intent-filter>
<meta-data android:name="com.android.settings.category"
android:value="com.android.settings.category.ia.development" />
And hence the UI shows up in Developer options. If the Developer options are disabled, all settings global variables will be cleared.