環境の準備とユーザー登録
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
Android Management API(AMAPI)SDK は、新しいカスタム Device Policy Controller(DPC)登録フローで重要な役割を果たします。EMM カスタム DPC アプリと Android Device Policy(ADP)間の通信を容易にし、主要な登録機能について Play EMM API と連携することで、デバイス登録を効率化します。
AMAPI SDK の主な機能は次のとおりです。
- EMM DPC アプリと Android デバイス ポリシー間の通信を有効にします。
- コマンドのローカル実行を容易にします。
- 管理対象の Google アカウントを追加するための新しいデバイス登録フローをサポート。
- 必要に応じて Android Device Policy のインストールまたは更新を管理します。
カスタム DPC 登録フローでは、主に次の 2 つの理由から SDK が不可欠です。
デバイスに Android Device Policy を正しくインストールして更新することで、環境を設定します。
これは、Android Device Policy をローカルで呼び出すために使用され、デバイスでユーザー ログイン シーケンスを開始します。
これらの基本的な関数は、デバイスを管理用に準備し、後続の登録手順を可能にします。
環境
AMAPI SDK の EnvironmentClient
は、環境関連の API へのアクセスを可能にするインターフェースです。EnvironmentClientFactory
を使用してインスタンスを作成できます。
EnvironmentClient
の主な機能:
- SDK API レベルが最小要件を満たしていることを確認します。
- 必要に応じて、Google Play 開発者サービスの更新を確認して開始します。
- Android Device Policy がインストールされ、更新されていることを確認します。インストールや更新を伴う場合があるため、このプロセスには時間がかかることがあります。
EnvironmentClient
インターフェースの詳細については、リファレンス ドキュメントをご覧ください。
AccountSetup
AMAPI SDK 内の AccountSetup
クラスは、管理対象の Android デバイスで Google アカウントを設定するプロセスを管理します。
AccountSetup の主な機能は次のとおりです。
AccountSetupClient
と登録トークンを使用してアカウント設定プロセスを開始します。
- EMM によって生成され、AMAPI SDK に渡される登録トークンを処理します。このトークンは、ユーザー認証が必要かどうかを判断します。
- 必要に応じて認証アクティビティを起動し、Google 認証情報でログインするようユーザーに促します。
- ログインが成功すると、ユーザーのメールアドレスとユーザー ID を含むコールバックを受け取ります。
- EMM は、受信したユーザー ID を使用して、
Devices.update
メソッドでデバイス ポリシーを設定します。
- EMM は
Devices.setState
を呼び出して、デバイスを準拠としてマークし、Google サービスへのアクセスを許可します。
この機能は、DPC サポート ライブラリではなく AMAPI SDK を活用する新しいデバイス登録方法の一部です。AccountSetup
の詳細については、AMAPI リファレンス ドキュメントとユーザー アカウントの実装ガイドをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-08-25 UTC。
[null,null,["最終更新日 2025-08-25 UTC。"],[],[],null,["# Environment preparation and user enrollment\n\nThe Android Management API (AMAPI) SDK plays a important role in the new custom\nDevice Policy Controller (DPC) enrollment flow. It facilitates communication\nbetween EMM custom DPC apps and Android Device Policy (ADP) and streamlines\ndevice enrollment by interacting with the Play EMM API for key enrollment\nfunctions.\n\nKey functions of the AMAPI SDK:\n-------------------------------\n\n- Enables communication between EMM DPC apps and Android Device Policy.\n- Facilitates local execution of commands.\n- Supports the new device enrollment flow for adding managed Google Accounts.\n- Manages the installation or updates of Android Device Policy when needed.\n\nThe SDK is essential for two primary reasons in the custom DPC enrollment flow:\n\n1. It sets the environment by helping to install and update Android Device\n Policy correctly on the device.\n\n2. It is used to call Android Device Policy locally, which initiates the user\n login sequence on the device.\n\nThese foundational functions prepare the device for management and make the\nsubsequent enrollment steps possible.\n\n*** ** * ** ***\n\nEnvironment\n-----------\n\nThe AMAPI SDK's `EnvironmentClient` is an interface that allows access to\nenvironment-related APIs. You can create an instance using\n`EnvironmentClientFactory`.\n\n### Key features of the `EnvironmentClient`:\n\n- Makes sure the SDK API level meets the minimum requirement.\n- Checks for and initiates an update for Google Play services if needed.\n- Verifies that Android Device Policy is installed and updated. Be aware that this process can take some time as it may involve an installation or update.\n\nFor more details on the `EnvironmentClient` interface, see the [reference\ndocumentation](/android/management/reference/amapi/com/google/android/managementapi/environment/EnvironmentClient).\n\n*** ** * ** ***\n\nAccountSetup\n------------\n\nThe `AccountSetup` class within the AMAPI SDK is responsible for managing the\nprocess of setting up a Google Account on a managed Android device.\n\n### Key features of the AccountSetup:\n\n- Starts the account setup process using the `AccountSetupClient` and an enrollment token.\n- Handles the enrollment token, which is generated by the EMM and passed to the AMAPI SDK. This token determines whether user authentication is required.\n- Launches an authentication activity if needed, prompting the user to sign in with their Google credentials.\n- Receives a callback with the user's email and user ID upon successful sign-in.\n- The EMM uses the received user identifiers to set the device policy with the [`Devices.update`](/android/work/play/emm-api/v1/devices/update) method.\n- The EMM calls [`Devices.setState`](/android/work/play/emm-api/v1/devices/setState) to mark the device as compliant and allow access to Google services.\n\nThis functionality is part of a new device enrollment method that leverages the\nAMAPI SDK instead of the DPC support library. For more details on `AccountSetup`\nsee [AMAPI reference\ndocumentation](/android/management/reference/amapi/com/google/android/managementapi/accountsetup/package-summary)\nand [Implement the user accounts\nguide](/android/work/play/emm-api/implement-user-accounts)."]]