資料和隱私權
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
Android Studio 中的 Gemini 始終將使用者隱私擺在第一位。
我們瞭解,確保程式碼隱私權是贏得並維持開發人員信任的關鍵要素。Android Studio 中的 Gemini 經過特別設計,未經您同意,程式碼絕不會離開電腦。如果您選擇提供程式碼脈絡,Gemini 會使用這些額外脈絡,更準確地回答問題。您可以完全掌控要分享的資料。
Google 認為唯有資訊公開化才能建立使用者的信賴。本頁面列出我們的 AI 承諾、訓練理念和技術控管措施,協助您管理資料的使用方式。
我們的保證
Gemini 的建構過程遵循 Google 的 AI 開發原則。這些原則說明瞭我們對妥善開發 AI 技術的承諾。
此外,在 Android Studio 中使用 Gemini 時,Google 會依據《隱私權政策》和《Gemini 隱私權聲明》處理您的資料。透過訂閱 Gemini Code Assist,在 Android Studio 中使用 Gemini 企業版時,Google 會依據《Google Cloud 隱私權聲明》處理您的資料。
資料收集和使用
未經您的明確同意,Gemini 不會與他人分享您的程式碼。您可以選擇與 Gemini 分享程式碼,啟用情境感知功能,讓 Gemini 提供專案專屬的回覆。
我們可能會透過下列方式收集及使用您的資料:
- 我們可能會使用「喜歡」和「不喜歡」等意見回饋資料訓練 Gemini。
- 如果您在 Android Studio 中使用 Gemini 個人版,系統可能會使用您在對話中明確輸入的程式碼訓練 Gemini。如果您選擇啟用情境感知功能,我們可能會使用收集到的資訊 (包括程式碼) 改良產品和服務,例如機器學習技術。詳情請參閱我們的《隱私權聲明》。
- 如果您在 Android Studio 中使用 Gemini for Business,系統絕不會將您在對話中輸入的程式碼用於訓練 Gemini。如果您選擇啟用情境感知功能,我們絕不會將收集到的資訊 (包括程式碼) 用於改良產品和服務,例如機器學習技術。詳情請參閱《Google Cloud 隱私權聲明》。
如果您選擇使用 AI 程式碼自動完成功能,我們會根據程式碼庫的內容提供更高品質的回覆。
您可以停用情境感知功能,但這樣一來,Gemini 的準確度會降低,且無法使用部分功能,例如機器學習輔助程式碼自動完成。Android Studio 提供內建的隱私權控制選項,可透過「File」(檔案) (macOS 上為「Android Studio」) >「Settings」(設定) >「Tools」(工具) >「Gemini」,調整要啟用的情境感知程度。如要禁止分享程式碼基底特定部分的脈絡資訊,請參閱「使用 .aiexclude 檔案設定脈絡資訊分享功能」。
系統會以 Google 無法辨識資料提供者身分的方式儲存資料,且無法應要求刪除資料。資料最多保留 18 個月。
詳情請參閱《Gemini 隱私權聲明》。
提交及收到的資料
以下是提交給 Gemini 和 Gemini 收到的不同類型資料:
- 使用情況統計資料:指定您如何使用 Android Studio 和相關工具的資料,例如您如何使用功能和資源用量。這包括 Studio 內部的軟體 ID,例如套件名稱、類別名稱和外掛程式設定。如要啟用或停用這項分享功能,請依序前往「File」 (macOS 上的「Android Studio」) >「Settings」 >「Appearance & Behavior」 >「Data Sharing」。
- 提示和回覆:您向 Gemini 提出的問題 (包括您提交給 Gemini 分析或完成的任何輸入資訊或程式碼) 稱為提示。您從 Gemini 收到的答案或程式碼自動完成建議稱為「回覆」。
- 意見回饋信號:你提供的任何意見回饋,包括按讚和倒讚。
- 背景資訊 (選用):Gemini 可能會傳送程式碼庫中的其他資訊,例如程式碼片段、檔案類型,以及為大型語言模型 (LLM) 提供背景資訊時可能需要的任何其他資訊。這樣 Gemini 就能提供更優質、更合適的回覆。這項設定也會讓 Gemini 提供其他實驗性功能,例如 AI 程式碼自動完成。
開發人員的選擇
根據預設,Gemini 無法查看編輯器視窗中的程式碼,只會使用聊天機器人中的提示和對話記錄來回覆。不過,您可以選擇分享程式碼集的脈絡,以取得更高品質的回覆,並使用 AI 程式碼自動完成等實驗性功能。
有三種機制可控制專案原始碼的分享方式,以便為 Gemini 提供背景資訊:

通用設定
Studio 在「File」(檔案) (macOS 上的「Android Studio」) >「Settings」(設定) >「Tools」(工具) >「Gemini」下方提供全域選擇加入偏好設定,可指定是否將原始碼傳送至 Gemini 伺服器,以提供情境感知功能。

為每個專案選擇不同選項
如果在 Studio 的 Gemini 設定中選取「要求為每個專案決定」,系統會在首次開啟每個專案時顯示對話方塊,詢問是否要為該專案啟用情境感知功能。這項設定會儲存在專案的 .idea
目錄中。

原始碼層級限制
在專案的原始碼目錄中新增 .aiexclude
檔案,可更精細地控管哪些檔案可做為 AI 模型的背景資訊。
進一步瞭解 .aiexclude 格式。
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-31 (世界標準時間)。
[null,null,["上次更新時間:2025-07-31 (世界標準時間)。"],[],[],null,["# Data and privacy\n\n**Gemini in Android Studio is built with your privacy in mind.**\n\nWe know that ensuring the privacy of your code is critical to earning and\nmaintaining the trust of our developers. Gemini in Android Studio is designed\nso that your code never leaves your computer without your consent. If you choose\nto provide code context, Gemini uses that additional context to better\nanswer your questions. You have full control over what data is shared.\n\nAt Google, we believe that trust comes from transparency. This page outlines our\nAI commitments, training philosophy, and technical controls to manage how your\ndata is used.\n\u003e **Our assurances**\n\u003e\n\u003e Gemini is built with Google's\n\u003e [AI Principles](https://ai.google/responsibility/principles/)\n\u003e in mind. These principles describe our commitment to developing AI technology\n\u003e responsibly.\n\u003e\n\u003e Additionally, when you use Gemini in Android Studio, Google handles your\n\u003e data in accordance with our\n\u003e [Privacy Policy](https://policies.google.com/privacy) and the [Gemini\n\u003e Privacy Notice](/studio/gemini/privacy-notice). When you use Gemini in\n\u003e Android Studio for businesses by subscribing to Gemini Code Assist, Google\n\u003e handles your data in accordance with the\n\u003e [Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-notice).\n\nData collection and use\n-----------------------\n\nYour code isn't shared with Gemini without your explicit consent. You have the\noption to share your code with Gemini in order to enable context awareness\nfeatures, providing Gemini with the ability to offer project-specific\nresponses.\n\nHere's how your data may be collected and used:\n\n- Your feedback data, such as thumbs up and thumbs down signals, may be used to train Gemini.\n- If you're using Gemini in Android Studio for individuals, the code you explicitly enter into the chat experience may be used to train Gemini. If you opt in to context awareness, the information collected---including code---may be used to improve our products and services, such as machine learning technologies. See our [privacy notice](/studio/gemini/privacy-notice) for more details.\n- If you're using Gemini in Android Studio for businesses, the code you enter into the chat experience is never used to train Gemini. If you opt in to context awareness, the information collected---including code---is never used to improve our products and services, such as machine learning technologies. See the [Google Cloud Privacy Notice](https://cloud.google.com/terms/cloud-privacy-notice) for more details.\n\nIf you opt in to use the AI code completion feature, we use context from your\ncodebase to provide higher quality responses.\n\nYou can use Gemini with context awareness features disabled, with the trade-off\nof less accurate features, and some features disabled such as ML powered code\ncompletion. Android Studio provides built-in privacy controls to adjust the\nlevel of context awareness you want to enable, using **File**\n(**Android Studio** on macOS) \\\u003e **Settings \\\u003e Tools \\\u003e Gemini** . To block context\nsharing for certain portions of your codebase, see [Configure context sharing\nwith .aiexclude files](/studio/gemini/aiexclude).\n\nThe data is stored in a way where Google can't tell who provided it, and it's\nnot possible to delete upon request. The data is retained for up to 18 months.\nFor more information, see the [Gemini Privacy\nNotice](/studio/gemini/privacy-notice).\n\nData submitted and received\n---------------------------\n\nHere are the different types of data submitted to and received from Gemini:\n\n- **Usage statistics:** Data specifying how you use Android Studio and its related tools, such as how you use features and resource usage. This includes software identifiers internal to Studio such as package names, class names, and plugin configuration. You can enable or disable this sharing from **File** (**Android Studio** on macOS) \\\u003e **Settings** \\\u003e **Appearance \\& Behavior** \\\u003e **Data Sharing**.\n- **Prompts and responses:** The questions that you ask Gemini, including any input information or code that you submit to Gemini to analyze or complete, are called prompts. The answers or code completions that you receive from Gemini are called responses.\n- **Feedback signals:** Thumbs up and down votes and any other feedback that you provide.\n- **Context (optional):** Gemini might send additional information from your codebase such as pieces of your code, file types, and any other information that might be necessary to provide context to the Large language Model (LLM). This helps Gemini provide higher quality and relevant responses. This also lets Gemini provide additional experimental capabilities such as AI code completion.\n\nDeveloper choice\n----------------\n\nBy default, Gemini can't see the code in the editor window and only uses the\nprompts and conversation history in the chatbot to respond. However, you can opt\nin to sharing context from your codebase to enable higher quality responses and\naccess to experimental features such as AI code completion.\n\nThere are three mechanisms used to control sharing your project's source code\nfor the purposes of providing context to Gemini:\n\n**Global settings**\n\nStudio's provides a global opt in preference under\n**File** (**Android Studio** on macOS) \\\u003e **Settings \\\u003e Tools \\\u003e Gemini**,\nspecifying whether source code may sent to Gemini servers in order to provide\ncontext awareness.\n\n\u003cbr /\u003e\n\n**Choose different options for each project**\n\nIf \"Ask to decide per project\" is selected in Studio's Gemini settings, a dialog\nis displayed the first time each project is opened asking whether context\nawareness should be enabled for that project. This setting is saved in the\nproject's `.idea` directory.\n\n\u003cbr /\u003e\n\n**Source-code level restrictions**\n\nAdding an `.aiexclude` file into your project's source code directory provides\nmore granular control over which files are eligible to be used as context for AI\nmodels.\n\n[Learn more about the .aiexclude\nformat.](/studio/gemini/aiexclude)\n\n\u003cbr /\u003e"]]