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

Android N SetupWizard Issue #348

Closed
Schischu opened this Issue Aug 31, 2016 · 2 comments

Comments

Projects
None yet
2 participants
@Schischu

Schischu commented Aug 31, 2016

Hi there,

I am an AOSP ROM developer for Samsung Tab S devices. (http://forum.xda-developers.com/galaxy-tab-s/development/rom-android-7-nougat-t3449078)
It seems to me that the default permission patch used on Android M does not work properly anymore on Android N.

SetupWizard always crashes cause due to missing CONTACTS permissions. See trace below.
I just debugged the permission system the whole evening and noticed that the following code never sets the permissions. "setupwizardPackage" is always null.

Does anybody else have this issue?

It seems to at least also exist on Xperia Port (http://forum.xda-developers.com/xperia-sp/orig-development/rom-aosp-nougat-xperia-sp-t3449300)

Any idea?

Thanks.

            // Google Setup Wizard
            PackageParser.Package setupwizardPackage = getDefaultProviderAuthorityPackageLPr(
                    "com.google.android.setupwizard", userId);
            Log.i(TAG, "Granting permissions setupwizardPackage " + setupwizardPackage);
            if (setupwizardPackage != null) {
                grantRuntimePermissionsLPw(setupwizardPackage, CONTACTS_PERMISSIONS, userId);
                grantRuntimePermissionsLPw(setupwizardPackage, PHONE_PERMISSIONS, userId);
                grantRuntimePermissionsLPw(setupwizardPackage, LOCATION_PERMISSIONS, userId);
                grantRuntimePermissionsLPw(setupwizardPackage, CAMERA_PERMISSIONS, userId);
            }
8-31 21:31:43.855  3260  3823 W ActivityManager: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{44db062 4211:com.google.android.setupwizard/u0a30} (pid=4211, uid=10030) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
08-31 21:31:43.859  4211  6306 E AndroidRuntime: FATAL EXCEPTION: AsyncTask #6
08-31 21:31:43.859  4211  6306 E AndroidRuntime: Process: com.google.android.setupwizard, PID: 4211
08-31 21:31:43.859  4211  6306 E AndroidRuntime: java.lang.RuntimeException: An error occurred while executing doInBackground()
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.os.AsyncTask$3.done(AsyncTask.java:318)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:242)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:243)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.lang.Thread.run(Thread.java:761)
08-31 21:31:43.859  4211  6306 E AndroidRuntime: Caused by: java.lang.SecurityException: Permission Denial: opening provider com.android.providers.contacts.ContactsProvider2 from ProcessRecord{44db062 4211:com.google.android.setupwizard/u0a30} (pid=4211, uid=10030) requires android.permission.READ_CONTACTS or android.permission.WRITE_CONTACTS
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:1683)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.os.Parcel.readException(Parcel.java:1636)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.app.ActivityManagerProxy.getContentProvider(ActivityManagerNative.java:4169)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.app.ActivityThread.acquireProvider(ActivityThread.java:5434)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2273)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:1515)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.content.ContentResolver.query(ContentResolver.java:514)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.content.ContentResolver.query(ContentResolver.java:472)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at com.google.android.setupwizard.user.ProfileHelper.updateMeContactWith(ProfileHelper.java:61)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at com.google.android.setupwizard.user.NameCheckFragment$1.doInBackground(NameCheckFragment.java:73)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at com.google.android.setupwizard.user.NameCheckFragment$1.doInBackground(NameCheckFragment.java:72)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at android.os.AsyncTask$2.call(AsyncTask.java:304)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    at java.util.concurrent.FutureTask.run(FutureTask.java:237)
08-31 21:31:43.859  4211  6306 E AndroidRuntime:    ... 4 more
08-31 21:31:43.902  3260  4221 W ActivityManager:   Force finishing activity com.google.android.setupwizard/.time.DateTimeCheck

@mfonville mfonville referenced this issue Sep 5, 2016

Merged

Fix nougat #76

@mfonville

This comment has been minimized.

Member

mfonville commented Sep 5, 2016

@Schischu is this problem fixed for you in the latest builds that purge the Provision app?

@Schischu

This comment has been minimized.

Schischu commented Sep 16, 2016

@mfonville: Thank you. The issue seems to have been resolved. 👍

@Schischu Schischu closed this Sep 16, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment