Starting March 27, 2025, we recommend using android-latest-release
instead of aosp-main
to build and contribute to AOSP. For more information, see Changes to AOSP.
Personalized settings
Stay organized with collections
Save and categorize content based on your preferences.
The Android Settings app provides a list of suggestions to the users in Android 8.0.
These suggestions typically promote features of the phone, and they are customizable
(e.g., "Set Do Not Disturb schedule" or "Turn on Wi-Fi Calling"). This feature provides
ranking for suggestions, based on any contextual signal or the user's past interactions
with suggestions.
The current default Android Open Source Project (AOSP) ranking model is based on
user's previous interactions with the suggestion, which is a simple linear model
trained with logistic regression to properly weight the interaction signals. The
default implementation uses suggestions shown, clicked or dismissed as
indicators along with the recency of these events to rank the suggestions and
increase the chance of predicting a user's interaction with these suggestions.
This model was built with a limited amount of logged user data. Device manufacturers
(OEMs) can develop their own ranking model based on any collected data and potentially
include contextual signals and calibrate the ranking.
Implementation
Find the default packages/apps/Settings/src/com/android/settings/dashboard/suggestions/SuggestionRanker.java
implementation in AOSP.
This feature is guarded by a flag, isSmartSuggestionEnabled
, which
is set to false by default. If enabled (set to true), the feature operates
without additional modification using the default AOSP implementation. OEMs can
either use the default implementation or introduce their own implementation to
enable this feature.
OEMs may customize the feature by implementing platform/packages/apps/Settings/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProvider.java
feature and Overriding the file's rankSuggestions
method.
This method gets two lists containing suggestion Tiles and the corresponding
suggestionIds. This method should reorder the tiles in the list only according
to the desired ranking score. The suggestionIds can be used to uniquely identify
suggestions and extract the required past information about the suggestion,
depending on the ranking implementation (e.g., recency of interaction with this
particular suggestion).
Validation
Implementers can ensure their version of the feature works as intended by
writing their own unit tests similar to packages/apps/Settings/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java
to verify the ranking.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2024-08-26 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-26 UTC."],[],[],null,["# Personalized settings\n\nThe Android Settings app provides a list of suggestions to the users in Android 8.0.\nThese suggestions typically promote features of the phone, and they are customizable\n(e.g., \"Set Do Not Disturb schedule\" or \"Turn on Wi-Fi Calling\"). This feature provides\nranking for suggestions, based on any contextual signal or the user's past interactions\nwith suggestions.\n\n\nThe current default Android Open Source Project (AOSP) ranking model is based on\nuser's previous interactions with the suggestion, which is a simple linear model\ntrained with logistic regression to properly weight the interaction signals. The\ndefault implementation uses suggestions shown, clicked or dismissed as\nindicators along with the recency of these events to rank the suggestions and\nincrease the chance of predicting a user's interaction with these suggestions.\nThis model was built with a limited amount of logged user data. Device manufacturers\n(OEMs) can develop their own ranking model based on any collected data and potentially\ninclude contextual signals and calibrate the ranking.\n\nImplementation\n--------------\n\n\nFind the default `packages/apps/Settings/src/com/android/settings/dashboard/suggestions/SuggestionRanker.java` implementation in AOSP.\n\n\nThis feature is guarded by a flag, `isSmartSuggestionEnabled`, which\nis set to false by default. If enabled (set to true), the feature operates\nwithout additional modification using the default AOSP implementation. OEMs can\neither use the default implementation or introduce their own implementation to\nenable this feature.\n\n\nOEMs may customize the feature by implementing `platform/packages/apps/Settings/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProvider.java\n` feature and Overriding the file's `rankSuggestions` method.\nThis method gets two lists containing suggestion Tiles and the corresponding\nsuggestionIds. This method should reorder the tiles in the list only according\nto the desired ranking score. The suggestionIds can be used to uniquely identify\nsuggestions and extract the required past information about the suggestion,\ndepending on the ranking implementation (e.g., recency of interaction with this\nparticular suggestion).\n\nValidation\n----------\n\n\nImplementers can ensure their version of the feature works as intended by\nwriting their own unit tests similar to `packages/apps/Settings/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java` to verify the ranking."]]