New issue
Advanced search Search tips

Issue 692130 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
EstimatedDays: ----
NextAction: 2017-02-17
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

Strictmode violation in "About Chrome"

Project Member Reported by rouslan@chromium.org, Feb 14 2017

Issue description

Chrome Version       : 58.0.3011.0
OS Version: Android 7.1.2
Device: Nexus 6p

What steps will reproduce the problem?
1. Open Settings.
2. Open "About Chrome".

What happens instead of that?
StrictMode policy violation; ~duration=17 ms: android.os.StrictMode$StrictModeDiskReadViolation: policy=18153503 violation=2                                                                                                                   
at android.os.StrictMode$AndroidBlockGuardPolicy.onReadFromDisk(StrictMode.java:1293)
at java.io.UnixFileSystem.checkAccess(UnixFileSystem.java:249)
at java.io.File.exists(File.java:780)
at android.app.ContextImpl.getDataDir(ContextImpl.java:1938)
at android.app.ContextImpl.getPreferencesDir(ContextImpl.java:466)
at android.app.ContextImpl.getSharedPreferencesPath(ContextImpl.java:627)
at android.app.ContextImpl.getSharedPreferences(ContextImpl.java:345)
at android.content.ContextWrapper.getSharedPreferences(ContextWrapper.java:164)
at android.preference.PreferenceManager.getSharedPreferences(PreferenceManager.java:471)
at android.preference.Preference.getSharedPreferences(Preference.java:1064)
at android.preference.Preference.dispatchSetInitialValue(Preference.java:1386)
at android.preference.Preference.onAttachedToHierarchy(Preference.java:1185)
at android.preference.PreferenceGroup.addPreference(PreferenceGroup.java:163)
at android.preference.PreferenceGroup.addItemFromInflater(PreferenceGroup.java:105)
at android.preference.PreferenceGroup.addItemFromInflater(PreferenceGroup.java:104)
at android.preference.GenericInflater.rInflate(GenericInflater.java:490)
at android.preference.GenericInflater.inflate(GenericInflater.java:327)
at android.preference.GenericInflater.inflate(GenericInflater.java:264)
at android.preference.PreferenceManager.inflateFromResource(PreferenceManager.java:280)
at android.preference.PreferenceFragment.addPreferencesFromResource(PreferenceFragment.java:326)
at org.chromium.chrome.browser.preferences.AboutChromePreferences.onCreate(AboutChromePreferences.java:36)
at android.app.Fragment.performCreate(Fragment.java:2336)
at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:949)
at android.app.BackStackRecord.setLastIn(BackStackRecord.java:860)
at android.app.BackStackRecord.calculateFragments(BackStackRecord.java:900)
at android.app.BackStackRecord.run(BackStackRecord.java:728)
at android.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1578)
at android.app.FragmentController.execPendingActions(FragmentController.java:371)
at android.app.Activity.performStart(Activity.java:6698)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2628)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
at android.app.ActivityThread.-wrap12(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6119)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
 
Owner: tedc...@chromium.org
Status: Untriaged (was: Available)
Ted, please triage.
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 3 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/92933ff654ebb9bb8be0de9eaad60668eb395443

commit 92933ff654ebb9bb8be0de9eaad60668eb395443
Author: dullweber <dullweber@chromium.org>
Date: Mon Apr 03 17:32:28 2017

Add StrictMode exception for addPreferencesFromResource calls.

Add a helper method that disables StrictMode temporarily and loads preferences to ClearBrowsingDataPrefences, AboutChromePreferences and AutofillAndPaymentsPreferences to avoid StrictModeViolation errors.

BUG= 707174 ,692125, 692130 

Review-Url: https://codereview.chromium.org/2787323002
Cr-Commit-Position: refs/heads/master@{#461462}

[modify] https://crrev.com/92933ff654ebb9bb8be0de9eaad60668eb395443/chrome/android/java/src/org/chromium/chrome/browser/preferences/AboutChromePreferences.java
[modify] https://crrev.com/92933ff654ebb9bb8be0de9eaad60668eb395443/chrome/android/java/src/org/chromium/chrome/browser/preferences/MainPreferences.java
[add] https://crrev.com/92933ff654ebb9bb8be0de9eaad60668eb395443/chrome/android/java/src/org/chromium/chrome/browser/preferences/PreferenceUtils.java
[modify] https://crrev.com/92933ff654ebb9bb8be0de9eaad60668eb395443/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillAndPaymentsPreferences.java
[modify] https://crrev.com/92933ff654ebb9bb8be0de9eaad60668eb395443/chrome/android/java/src/org/chromium/chrome/browser/preferences/privacy/ClearBrowsingDataPreferences.java
[modify] https://crrev.com/92933ff654ebb9bb8be0de9eaad60668eb395443/chrome/android/java_sources.gni

Status: Fixed (was: Untriaged)
The violation was fixed by my cl

Sign in to add a comment