title: Neither user 10085 nor current process has android.permission.READ_PHONE_STATE
body: <p>I have updated target sdk version 27 and i have given permission in <code>manifest</code> of <code>READ_PHONE_STATE.</code> Still my app is crashing on <code>utils.java</code> </p>
  
  <pre><code> deviceId = TelephonyMgr.getDeviceId(); 
  </code></pre>
  
  <p>on this line and i also ask for run time permission for this still the issue is same</p>
  
  <pre><code>private void RequestMultiplePermission() {
  
          // Creating String Array with Permissions.
          ActivityCompat.requestPermissions(LoginActivity.this, new String[]
                  {
                          CALL_PHONE,
                          READ_PHONE_STATE
                  }, RequestPermissionCode);
  
      }
      public void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults) {
          switch (requestCode) {
  
              case RequestPermissionCode:
  
                  if (grantResults.length &gt; 0) {
  
                      boolean GetCallPermission = grantResults[0] == PackageManager.PERMISSION_GRANTED;
                      boolean GetReadphoneper = grantResults[1] == PackageManager.PERMISSION_GRANTED;
  
                      if (GetCallPermission &amp;&amp; GetReadphoneper) {
  
                          Toast.makeText(LoginActivity.this, "Permission Granted", Toast.LENGTH_LONG).show();
                      }
                      else {
                          ///Toast.makeText(Login.this,"Permission Granted",Toast.LENGTH_LONG).show();
                      }
                  }
                  break;
          }
      }
  </code></pre>
  
  <p>here in this line it will crash
   deviceId = TelephonyMgr.getDeviceId(); </p>
  
  <pre><code>public static String getUniqueDeviceId(Context context) {
          String deviceId;
          // 1 compute IMEI
          final TelephonyManager TelephonyMgr = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
          if (ActivityCompat.checkSelfPermission(context, Manifest.permission.READ_PHONE_STATE) != PackageManager.PERMISSION_GRANTED) {
  
          }
          deviceId = TelephonyMgr.getDeviceId(); // Requires // READ_PHONE_STATE
          if (deviceId == null) {
              // 2 android ID - unreliable
              deviceId = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
          }
          if (deviceId == null) {
              Random r = new Random();
              deviceId = String.valueOf((r.nextInt() + r.nextInt()));
          }
  
          e(deviceId);
          return deviceId;
      }
  </code></pre>