---
title: "Verify Android account switching clears private views"
description: "Check Android account switching with preserved app data to detect private records, stale avatars, and cached search results leaking across test accounts."
canonical_url: "https://vostride.com/agent-library/android-flows/account-switch-clears-private-cache.md"
md_url: "https://vostride.com/agent-library/android-flows/account-switch-clears-private-cache.md"
content_kind: "recipe"
topic: "android-flows"
---

# Verify Android account switching clears private views

Check Android account switching with preserved app data to detect private records, stale avatars, and cached search results leaking across test accounts.

## Risk

Preserved app state intentionally includes more than authentication. Use account-distinct private content to detect a cache boundary failure that a simple welcome-label check would miss.

## Fixtures

- An Android sandbox target using use.mobile.appState: preserve and two disposable accounts with disjoint private workspaces.
- Account A has a uniquely named private task and avatar; account B has a different task and no permission to A data.
- A sandbox access oracle confirming the intended account memberships before the UI run; authentication is performed through the product-supported flow.

## Steps

1. Sign in as account A, open its private task, and verify the unique title, identifier, and account avatar are visible.
2. Use the product sign-out control and verify the signed-out screen appears without a remaining private-detail panel.
3. Sign in as account B and verify its workspace, avatar, and private task match the B fixture.
4. Search for the exact A-only title and verify no matching private result, preview, or recent-item entry appears in B views.
5. Reopen the app through its supported navigation lifecycle and verify B remains active; inspect the access oracle and verify B has acquired no A membership or record grant.

## Expected results

- Account B navigation and search contain only its authorized fixture records.
- The signed-out surface does not retain A private detail text.
- Independent permissions remain disjoint after both sign-in flows.

## False-pass traps

- The account menu can update while a cached task list still belongs to A.
- An empty first page does not prove the recent-search or detail cache was cleared.

## Cleanup

- Sign out the disposable account and remove fixture-specific recent searches if the product persists them.

## Use with agent-qa

Adapt this test design to your application's acceptance criteria and configured target using the [recipe execution guide](/agent-library/software-factory/turn-a-recipe-into-an-agent-qa-test.md). External fixture setup and non-UI checks require your own supported hooks or test tooling. Validate the authored test, execute it, and inspect the completed evidence; this recipe is not a recorded test result.

## References

- [agent-qa mobile testing](/docs/agent-qa/guides/mobile-testing.md)
- [agent-qa test](/docs/agent-qa/configuration/test.md)
- [agent-qa hooks](/docs/agent-qa/guides/hooks.md)

- [Android application QA recipes](/agent-library/android-flows.md)
- [Software factory QA library](/agent-library.md)
