Fix a monkey crash: guard against position -1.
When handling onClick in ManageApplications, skip getAppEntry if position is -1. Change-Id: I565c42b2c9f742445e49fd4c2e7db539d0f6f8ad Fixes: 67940121 Test: manual
This commit is contained in:
@@ -647,6 +647,10 @@ public class ManageApplications extends InstrumentedPreferenceFragment
|
|||||||
}
|
}
|
||||||
final int position = mRecyclerView.getChildAdapterPosition(view);
|
final int position = mRecyclerView.getChildAdapterPosition(view);
|
||||||
|
|
||||||
|
if (position == RecyclerView.NO_POSITION) {
|
||||||
|
Log.w(TAG, "Cannot find position for child, skipping onClick handling");
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mApplications.getApplicationCount() > position) {
|
if (mApplications.getApplicationCount() > position) {
|
||||||
ApplicationsState.AppEntry entry = mApplications.getAppEntry(position);
|
ApplicationsState.AppEntry entry = mApplications.getAppEntry(position);
|
||||||
mCurrentPkgName = entry.info.packageName;
|
mCurrentPkgName = entry.info.packageName;
|
||||||
|
Reference in New Issue
Block a user