The availability of powerful smartphones and the necessity of security in mobile devices have made researchers propose multiple security modes (e.g., home, office, outdoor, and financial) for such devices. In each mode, a user can install a different set of apps. However, in most of the cases, the user has to select the mode manually. If we can sense the smartphone’s security context accurately, then it is possible to switch between different security modes automatically. Also, smartphone operating systems are becoming ubiquitous. As a result, mobile apps need to behave differently based on the security context (e.g., not sending the data if the network is insecure). There exist other research work that may detect the physical context of a smartphone. However, we focus on sensing different security parameters (e.g., location, is-network-encrypted) and calculating the security context from the parameters. In this paper, we propose Flamingo, a security context management framework that maintains a cache of security contexts and parameters to be used by the operating system and third-party applications. As detecting contexts requires the use of power-hungry smartphone sensors, a comprehensive framework for sharing security parameters among various applications can be beneficial in terms of energy and other resource expenses. The implementation of Flamingo as a part of the Android operating system shows that it is effective in managing security contexts and parameters.