Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Android SDK 34 - Photo and Video permission return Granted when user only allow selected #1438

Open
4 of 5 tasks
suesitran opened this issue Feb 2, 2025 · 0 comments

Comments

@suesitran
Copy link

Please check the following before submitting a new issue.

Please select affected platform(s)

  • Android
  • iOS
  • Windows

Steps to reproduce

  1. Launch app
  2. Tap on 'Request permission'
  3. In Permission prompt, select 'Allow limited access'
  4. select a photo, then tap on 'Allow' button to return to app
  5. check permission status

Expected results

Log shows permission as 'Limited' because in step 3, I selected 'Allow limited access'

Actual results

Log shows permission as Granted

Code sample

Code sample
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';

class SamplePermissionIssue extends StatefulWidget {
  const SamplePermissionIssue({super.key});

  @override
  State<SamplePermissionIssue> createState() => _SamplePermissionIssueState();
}

class _SamplePermissionIssueState extends State<SamplePermissionIssue> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.center,
          mainAxisAlignment: MainAxisAlignment.center,
          children: [
            FutureBuilder<PermissionStatus>(
              future: Permission.photos.status,
              builder: (context, snapshot) =>
                  Text('Permission: ${snapshot.data ?? 'Unknown'}'),
            ),
            TextButton(
                onPressed: () {
                  Permission.photos.request().then(
                        (value) => setState(() {}),
                      );
                },
                child: const Text('Request permission'))
          ],
        ),
      ),
    );
  }
}

Screenshots or video

Screenshots or video demonstration
permission_issue.mp4

Version

11.3.1

Flutter Doctor output

Doctor output
suesi $ flutter doctor -v
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.0 23A344 darwin-arm64, locale en-AU)
    • Flutter version 3.24.3 on channel stable at /Users/thuytran/fvm/versions/3.24.3
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 2663184aa7 (5 months ago), 2024-09-11 16:27:48 -0500
    • Engine revision 36335019a8
    • Dart version 3.5.3
    • DevTools version 2.37.3

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/thuytran/Library/Android/sdk
    • Platform android-35, build-tools 34.0.0
    • Java binary at: /opt/homebrew/Cellar/openjdk@17/17.0.14/libexec/openjdk.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Homebrew (build 17.0.14+0)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15F31d
    • CocoaPods version 1.16.2

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2024.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 21.0.4+-12422083-b607.1)

[✓] VS Code (version 1.95.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (6 available)
    • Pixel 9 Pro Fold (mobile)       • 48271FDKD000SE            • android-arm64  • Android 14 (API 34)
    • Suesi 15 (mobile)               • 00008130-001135D93883401C • ios            • iOS 18.1.1 22B91
    • iPad (3) (mobile)               • 00008101-00180D221EB9001E • ios            • iOS 18.0.1 22A3370
    • macOS (desktop)                 • macos                     • darwin-arm64   • macOS 14.0 23A344 darwin-arm64
    • Mac Designed for iPad (desktop) • mac-designed-for-ipad     • darwin         • macOS 14.0 23A344 darwin-arm64
    • Chrome (web)                    • chrome                    • web-javascript • Google Chrome 132.0.6834.160

[✓] Network resources
    • All expected network resources are available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant