Both are different from the kind of self awareness involved in knowing that one is selfish, clever, easily embarrassed, etc. Or knowing where one is in a pecking order. Maybe there are other kinds of self-awareness. I suspect only the former. All sorts of homeostasis involve a very simple kind of self-awareness.
Biological evolution is a damn good engineer.
As information processing capabilities of organisms evolved and analog feedback loops were supplemented with many other kinds of control mechanisms, it is likely that organisms developed many different ways of acquiring, storing and using diverse kinds of information about themselves. My guess is that there are MANY different kinds of self-awareness, and when we have distinguished them clearly we'll be surprised to find how many of them occur in all sorts of animals. And in things like computer operating systems, word processors, compilers, spreadsheets, etc.