[res] Store the number of types in typeSpec

Bug: 282215580
Test: build + boot + perf record

Change-Id: Ide34e48f8ba63a38a93f0a15618d601857498683
3 files changed