title: Weird behaviour of CameraPreview in flutter
body: <p>I followed the <em>Take a picture using camera</em> tutorial in flutter cookbook. I'm not getting any build errors, everything is running fine in app but I get this message when I navigate to my <code>CameraHandler</code> widget. It asks for permission for using camera and recording audio, but after that all I see is the progress indicator.</p>
  
  <pre><code>E/libc    (32251): Access denied finding property 
  "persist.vendor.camera.privapp.list"
  W/gmess.pg_survey(32251): type=1400 audit(0.0:203606): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=18586 scontext=u:r:untrusted_app:s0:c13,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
  W/Binder:32251_3(32251): type=1400 audit(0.0:203607): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=18586 scontext=u:r:untrusted_app:s0:c13,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
  E/libc    (32251): Access denied finding property "vendor.camera.aux.packagelist"
  E/libc    (32251): Access denied finding property "vendor.camera.aux.packagelist"
  W/Binder:32251_3(32251): type=1400 audit(0.0:203608): avc: denied { read } for name="u:object_r:vendor_camera_prop:s0" dev="tmpfs" ino=18586 scontext=u:r:untrusted_app:s0:c13,c257,c512,c768 tcontext=u:object_r:vendor_camera_prop:s0 tclass=file permissive=0
  </code></pre>
  
  <p>Here's my <code>CameraHandler</code> widget:</p>
  
  <pre><code>import 'package:camera/camera.dart';
  import 'package:flutter/material.dart';
  import 'package:path/path.dart' show join;
  import 'package:path_provider/path_provider.dart';
  
  class CameraHandler extends StatefulWidget {
    final CameraDescription camera;
  
    const CameraHandler({
      Key key,
      @required this.camera,
    }) : super(key: key);
  
    @override
    _CameraHandlerState createState() =&gt; _CameraHandlerState();
  }
  
  class _CameraHandlerState extends State&lt;CameraHandler&gt; {
    CameraController _controller;
    Future&lt;void&gt; _initControllerFuture;
  
    @override
    void initState() {
      super.initState();
  
      _controller = CameraController(widget.camera, ResolutionPreset.medium);
      _initControllerFuture = _controller.initialize();
    }
  
    @override
    void dispose() {
      _controller.dispose();
      super.dispose();
    }
  
    @override
    Widget build(BuildContext context) {
      return Scaffold(
        appBar: AppBar(title: Text('Take pictures of PG')),
        body: FutureBuilder&lt;void&gt;(
          builder: (context, snapshot) {
            if (snapshot.connectionState == ConnectionState.done) {
              return CameraPreview(_controller);
            } else {
              return Center(
                child: CircularProgressIndicator(),
              );
            }
          },
        ),
        floatingActionButton: FloatingActionButton(
          child: Icon(Icons.camera_alt),
          onPressed: () async {
            try {
              await _initControllerFuture;
  
              final path = join(
                (await getTemporaryDirectory()).path,
                '${DateTime.now()}.png',
              );
  
              await _controller.takePicture(path);
              print('Took a picture from Camera!!');
            } catch (e) {
              print('Camera Error: ' + e);
            }
          },
        ),
      );
    }
  }
  </code></pre>
  
  <p>And here is my <code>AndroidManifest.xml</code> with all the required permissions:
  </p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.CAMERA" /&gt;
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"    /&gt;
  
  &lt;uses-feature android:name="android.hardware.camera" /&gt;
  &lt;uses-feature android:name="android.hardware.camera.autofocus" /&gt;
  &lt;application
      android:name="io.flutter.app.FlutterApplication"
      android:label="pg_survey"
      android:icon="@mipmap/ic_launcher"&gt;
      &lt;activity
          android:name=".MainActivity"
          android:launchMode="singleTop"
          android:theme="@style/LaunchTheme"
          android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
          android:hardwareAccelerated="true"
          android:windowSoftInputMode="adjustResize"&gt;
          &lt;!-- This keeps the window background of the activity showing
               until Flutter renders its first frame. It can be removed if
               there is no splash screen (such as the default splash screen
               defined in @style/LaunchTheme). --&gt;
          &lt;meta-data
              android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
              android:value="true" /&gt;
          &lt;intent-filter&gt;
              &lt;action android:name="android.intent.action.MAIN" /&gt;
              &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
          &lt;/intent-filter&gt;
      &lt;/activity&gt;
  &lt;/application&gt;
  </code></pre>
  
  <p>
  Where am I going wrong, please help!</p>