Question: I need to parse the time according to the phone settings(both android and IOS). If I select 24 hours in the device, need to show the 24 hour date in application and for the 12 hours selection, need to show the 12 hour time format in application. How can I find which time format is I selected in the device through the code.

Answer: 
I learned about [package visibility privacy updates on Android 11](https://developer.android.com/about/versions/11/privacy/package-visibility). Which says,

> 
> Android 11 changes how apps can query and interact with other apps that the user has installed on a device. Using the element, apps can define the set of other packages that they can access. This element helps encourage the principle of least privilege by telling the system which other packages to make visible to your app, and it helps app stores like Google Play assess the privacy and security that your app provides for users.
> 
> 
> If your app targets Android 11 or higher, you might need to add the element in your app's manifest file. Within the element, you can specify packages by name, by intent signature, or by provider authority.
> 
> 
> 

So, I added the following tags in my manifest file:

```
<queries>
    <intent>
        <action android:name="android.intent.action.GET_CONTENT" />
        <data android:mimeType="image/*"/>
    </intent>
</queries>

```

And that's it!
As per the [`ACTION_GET_CONTENT` documentation](https://developer.android.com/reference/android/content/Intent#ACTION_GET_CONTENT), the actual string is `android.intent.action.GET_CONTENT` and **not** `android.media.action.GET_CONTENT` that you have in your code. Therefore the correct package visibility query is

```
<queries>
    <intent>
        <action android:name="android.intent.action.GET_CONTENT" />
        <data android:mimeType="image/*"/>
    </intent>
</queries>

```

As an alternative, you can also catch the `ActivityNotFoundException` which occurs in the rare case where the [Storage Access Framework](https://developer.android.com/guide/topics/providers/document-provider) (which is what handles `ACTION_GET_CONTENT`) was disabled as part of a custom ROM. This approach requires no package visibility tags:

```
val intentForLoadingImage = Intent(Intent.ACTION_GET_CONTENT)
intentForLoadingImage.type = "image/*"
try {
    startActivityForResult(intentForLoadingImage, IMAGE_REQUEST_CODE)
} catch (e: ActivityNotFoundException) {
}

```