> For the complete documentation index, see [llms.txt](https://docs.payments.thalescloud.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/additional-features/handle-visa-multiple-aids.md).

# Visa の複数 AID を処理する

## 概要

NFCウォレットSDKを使用して、デジタルカード上の複数のVisa AIDを管理します。

できること：

* デジタルカードが複数のAIDを公開しているかどうかを検出します。
* AIDリスト（優先度順）を読み取ります。
* AIDの優先度を更新します。
* AIDをロックまたはアンロックします。

## SDK の統合

### 複数のAIDを検出する

使用する `DigitalizedCard.isMultiAids()`.

### AIDを読み取る

使用する `DigitalizedCard.getAllAids()` がリストを返します `Aid` オブジェクト。

リストは優先度でソートされています（優先度の高いものが先）。

それぞれの `Aid` には次が含まれます：

* `Aid.getAid()`：AIDをとして返します `String`.
* `Aid.getLabel()`：ラベルをとして返します `String`.
* `Aid.getLockStatus()`：を返します `true` AIDがロックされている場合。
* `Aid.setLockStatus(boolean locked)`：AIDをロックまたはアンロックします。

{% hint style="info" %}
端末はステータスワードを返します `6A81` を送信したときに **SELECT** ロックされたAIDに対して。
{% endhint %}

### 優先度とロック状態を更新する

優先度（および必要に応じてロック状態）を更新するには、望ましい優先度順で **すべてのAID** を含むリストを再構築します。次に呼び出します `DigitalizedCard.updateAidList(...)`.

```java
// tokenIdを使ってデジタルカードへの参照を取得します。
DigitalizedCard digitalizedCard = DigitalizedCardManager.getDigitalizedCard(tokenId);

// このデジタルカードが複数のAIDを公開しているかどうかを確認します。
if (digitalizedCard.isMultiAids()) {

    // すべてのAIDを読み取ります。リストは優先度順（高いものが先）にソートされています。
    List<Aid> aids = digitalizedCard.getAllAids();

    // 最も優先度の高いAIDをロックします。
    aids.get(0).setLockStatus(true);

    // 望ましい優先度順にリストを再構築します。
    // 重要：更新されたリストにはすべてのAIDを含める必要があります。
    List<Aid> updatedAids = new ArrayList<>();
    updatedAids.add(aids.get(1));
    updatedAids.add(aids.get(0));
    // 残りのAIDを必要な順序で追加します。

    // 新しい優先度とロック状態の変更の両方を適用します。
    digitalizedCard.updateAidList(updatedAids);
}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.payments.thalescloud.io/nfc-wallet-sdk-android/ja/additional-features/handle-visa-multiple-aids.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
