2025 年 3 月 27 日より、AOSP のビルドとコントリビューションには aosp-main
ではなく android-latest-release
を使用することをおすすめします。詳細については、AOSP の変更をご覧ください。
パーソナライズ設定
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android 8.0 では、Android 設定アプリによって候補のリストが提供されます。
通常、これらの候補はスマートフォンの機能を活かすもので、カスタマイズ可能です(「サイレント モード スケジュールの設定」や「Wi-Fi 通話の有効化」など)。この機能では、任意のコンテキスト シグナル、または候補に対するユーザーの過去の操作に基づいて候補のランク付けが行われます。
現在のデフォルトの Android オープンソース プロジェクト(AOSP)ランキング モデルは、候補に対するユーザーの以前の操作に基づいています。これは、インタラクション シグナルに適切に重み付けするロジスティック回帰を使用してトレーニングされる、単純な線形モデルです。デフォルトの実装では、候補をランク付けして、候補に対するユーザーの操作の予測性を高めるために、表示された候補、クリックされた候補、拒否された候補をそれらのイベントの最新性とともに指標として使用します。このモデルは、ログに記録されたユーザーデータの一部で構築されています。デバイス メーカー(OEM)は、収集したデータに基づいて独自のランキング モデルを開発することができ、場合によってはコンテキスト シグナルを追加してランキングを調整できます。
実装
AOSP でデフォルトの packages/apps/Settings/src/com/android/settings/dashboard/suggestions/SuggestionRanker.java
の実装を確認できます。
この機能はフラグ isSmartSuggestionEnabled
(デフォルトで false に設定されている)によって保護されています。有効にする(true に設定する)と、デフォルトの AOSP 実装を使用して追加の変更を行わなくても動作します。OEM は、デフォルトの実装を使用するか、独自の実装を導入してこの機能を有効にできます。
OEM が機能をカスタマイズするには、platform/packages/apps/Settings/src/com/android/settings/dashboard/suggestions/SuggestionFeatureProvider.java
機能を実装してファイルの rankSuggestions
メソッドをオーバーライドします。
このメソッドは、候補タイルおよび対応する suggestionId を含む 2 つのリストを取得します。このメソッドでは、目的のランキング スコアのみに従ってリスト内のタイルが並べ替えられます。suggestionId を使用して候補を一意に識別し、ランキングの実施(特定の候補に対する操作の最新性など)に応じて、候補に関する必要な過去の情報を抽出できます。
検証
実装者は、packages/apps/Settings/tests/robotests/src/com/android/settings/dashboard/suggestions/SuggestionRankerTest.java
に似た単体テストを作成してランキングを検証し、機能バージョンが意図したとおりに動作することを確認できます。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2025-07-27 UTC。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-07-27 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."]]