> 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 Wallet 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
