Fix a crash in AppInfoBase where appEntry is invalid

Change-Id: Ifbea967405ddc1e1bd069ddeab170bc67b1835b4
Fix: 63178369
Test: robotests
This commit is contained in:
Fan Zhang
2017-07-05 16:12:00 -07:00
parent 24ba2fbdb9
commit 2c6634a8a9
2 changed files with 45 additions and 2 deletions

View File

@@ -35,6 +35,7 @@ import android.os.IBinder;
import android.os.ServiceManager;
import android.os.UserHandle;
import android.os.UserManager;
import android.text.TextUtils;
import android.util.Log;
import com.android.internal.logging.nano.MetricsProto;
@@ -291,7 +292,8 @@ public abstract class AppInfoBase extends SettingsPreferenceFragment
@Override
public void onReceive(Context context, Intent intent) {
String packageName = intent.getData().getSchemeSpecificPart();
if (!mFinishing && mAppEntry.info.packageName.equals(packageName)) {
if (!mFinishing && (mAppEntry == null || mAppEntry.info == null
|| TextUtils.equals(mAppEntry.info.packageName, packageName))) {
onPackageRemoved();
}
}