Merge "Protect against monkey crash" into nyc-dev am: d3ce331b94

am: cb0e0f9e30

* commit 'cb0e0f9e300785a74eaebde9b048861a5c66135f':
  Protect against monkey crash

Change-Id: I4f731e57db6563e92d64c873c71f5da1367fcf67
This commit is contained in:
Jason Monk
2016-05-20 18:28:18 +00:00
committed by android-build-merger

View File

@@ -152,6 +152,7 @@ public class UnrestrictedDataAccess extends SettingsPreferenceFragment
@Override
public void onRebuildComplete(ArrayList<AppEntry> apps) {
if (getContext() == null) return;
cacheRemoveAllPrefs(getPreferenceScreen());
final int N = apps.size();
for (int i = 0; i < N; i++) {
@@ -159,7 +160,7 @@ public class UnrestrictedDataAccess extends SettingsPreferenceFragment
String key = entry.info.packageName + "|" + entry.info.uid;
AccessPreference preference = (AccessPreference) getCachedPreference(key);
if (preference == null) {
preference = new AccessPreference(getContext(), entry);
preference = new AccessPreference(getPrefContext(), entry);
preference.setKey(key);
preference.setOnPreferenceChangeListener(this);
getPreferenceScreen().addPreference(preference);