title: ANDROID_ID still available with Android 10
body: <p>According to Google, the ANDROID_ID (also known as SSAID) should not be accessible on Android 10 systems, without some preconditions (see: <a href="https://developer.android.com/about/versions/10/privacy/changes" rel="noreferrer">https://developer.android.com/about/versions/10/privacy/changes</a>)</p>
  
  <pre><code>• If your app targets Android 10 or higher, a SecurityException occurs.
  
  • If your app targets Android 9 (API level 28) or lower, the method
    returns null or placeholder data if the app has the READ_PHONE_STATE
    permission. Otherwise, a SecurityException occurs.
  </code></pre>
  
  <p>My problem here is, that I am still able to access the ANDROID_ID without any of above mentioned preconditions.</p>
  
  <p>I created a Kotlin project with target platform Android 10 API level 29.</p>
  
  <p>In this project I ran this code:</p>
  
  <pre class="lang-java prettyprint-override"><code>import androidx.appcompat.app.AppCompatActivity
  import android.os.Bundle
  import android.provider.Settings
  import android.util.Log
  
  
  class MainActivity : AppCompatActivity() {
  
      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
          Log.i("ANDROID ID", "##### READ Android ID ######")
  
          try {
              val my_android_id = Settings.Secure.getString(this.contentResolver, Settings.Secure.ANDROID_ID)
              Log.i("ANDROID ID", my_android_id)
  
          }
          catch (e: SecurityException){
              Log.i("ANDROID ID", "Secure Exception!")
          }
  
      }
  }
  </code></pre>
  
  <p>The result is, that the ANDROID_ID gets written to the logcat without any problem. The value is no dummy value but the actual ANDROID_ID. 
  This has been tested on a simulator and on a real device (Pixel 2).</p>