[res] Fix the cookie index in OpenNonAsset()
Previous change incorrectly set the output cookie index,
forgetting to account for the -1 offset
Bug: 312057285
Test: manual
Change-Id: Ib4ce95a3084f7faf83ac4875184f331407a1bd50
diff --git a/libs/androidfw/AssetManager2.cpp b/libs/androidfw/AssetManager2.cpp
index d056248..8748dab 100644
--- a/libs/androidfw/AssetManager2.cpp
+++ b/libs/androidfw/AssetManager2.cpp
@@ -603,7 +603,7 @@
std::unique_ptr<Asset> asset = assets->GetAssetsProvider()->Open(filename, mode);
if (asset) {
if (out_cookie != nullptr) {
- *out_cookie = i;
+ *out_cookie = i - 1;
}
return asset;
}