title: WebRTC with android WebView GRALLOC error
body: <p>I am trying to implement WebRTC in android WebView and it works fine but on some devices, I keep receiving this error:</p>
  <pre><code>I/GRALLOC: LockFlexLayout: baseFormat: 11, uOffset: 307200, vOffset: 307200,uStride: 640
  </code></pre>
  <p>In devices that receive this error (Huawei), the camera won't be available in other activities even after closing WebView and the error keeps showing endlessly.</p>
  <p>Manifest file</p>
  <pre><code> &lt;uses-permission android:name=&quot;android.permission.CAMERA&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.CAPTURE_SECURE_VIDEO_OUTPUT&quot;
          tools:ignore=&quot;ProtectedPermissions&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.CAPTURE_VIDEO_OUTPUT&quot;
          tools:ignore=&quot;ProtectedPermissions&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.INTERNET&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.RECORD_AUDIO&quot; /&gt;
  
      &lt;uses-permission android:name=&quot;android.permission.MODIFY_AUDIO_SETTINGS&quot; /&gt;
      &lt;uses-permission android:name=&quot;android.permission.CAPTURE_AUDIO_OUTPUT&quot;
          tools:ignore=&quot;ProtectedPermissions&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera.autofocus&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera.front&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera.level.full&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera.capability.raw&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera.any&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.microphone&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature android:name=&quot;android.hardware.camera2&quot; android:required=&quot;true&quot; /&gt;
      &lt;uses-feature
          android:name=&quot;android.hardware.camera&quot;
          android:required=&quot;true&quot; /&gt;
  </code></pre>
  <p>MainActivity.java</p>
  <pre><code>public class MainActivity extends AppCompatActivity {
  
      WebView webView;
      @SuppressLint(&quot;SetJavaScriptEnabled&quot;)
      @RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN_MR1)
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          webView = new WebView(this);
          setContentView(webView);
  //        webView = findViewById(R.id.webView);
  
          WebSettings MyWebviewSettings = webView.getSettings();
          MyWebviewSettings.setAllowFileAccessFromFileURLs(true);
          MyWebviewSettings.setAllowUniversalAccessFromFileURLs(true);
          MyWebviewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
          MyWebviewSettings.setJavaScriptEnabled(true);
          MyWebviewSettings.setDomStorageEnabled(true);
          MyWebviewSettings.setJavaScriptCanOpenWindowsAutomatically(true);
          MyWebviewSettings.setBuiltInZoomControls(true);
          MyWebviewSettings.setAllowFileAccess(true);
          MyWebviewSettings.setMediaPlaybackRequiresUserGesture(false);
  
          MyWebviewSettings.setSupportZoom(true);
  
          webView.setWebChromeClient(new WebChromeClient(){
              @RequiresApi(api = Build.VERSION_CODES.M)
              @Override
              public void onPermissionRequest(PermissionRequest request) {
                  request.grant(request.getResources());
              }
          });
  
          webView.loadUrl(&quot;file:///android_asset/test.html&quot;);
  
  
          ActivityCompat.requestPermissions(MainActivity.this,
                  new String[]{Manifest.permission.READ_EXTERNAL_STORAGE, Manifest.permission.CAMERA, Manifest.permission.RECORD_AUDIO},
                  1);
  
      }
  
      @Override
      public void onRequestPermissionsResult(int requestCode, @NonNull  String[] permissions, @NonNull int[] grantResults) {
          super.onRequestPermissionsResult(requestCode, permissions, grantResults);
          switch (requestCode) {
              case 1: {
  
                  // If request is cancelled, the result arrays are empty.
                  if (grantResults.length &gt; 0
                          &amp;&amp; grantResults[0] == PackageManager.PERMISSION_GRANTED) {
  
                      Toast.makeText(this, &quot;Granted&quot;, Toast.LENGTH_SHORT).show();
                  } else {
  
                      // permission denied, boo! Disable the
                      // functionality that depends on this permission.
                      Toast.makeText(MainActivity.this, &quot;Permission denied to read your External storage&quot;, Toast.LENGTH_SHORT).show();
                  }
                  return;
              }
  
              // other 'case' lines to check for other
              // permissions this app might request
          }
      }
  }
  </code></pre>