• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

packages/apps/Settings


Commit MetaInfo

Revisão9b525443dce74b14460fca0b5e747d7ec0c73773 (tree)
Hora2016-10-08 21:27:25
AutorMichael W <baddaemon87@gmai...>
CommiterSteve Kondik

Mensagem de Log

Settings: Fix possible NPE

mPackageInfo and applicationInfo can sometimes be null, causing an NPE.
Check for null first and make the menu entry invisible in that case.

This commit is a squash of the following commit from CM 13.0:
29d679a18784e8c28d2146ad3037c420abc00928 Settings: Fix possible crash
4b03da7757caf8a0dff2864ab6a2fac3afd91e39 Settings: Fix possible NPE

Change-Id: I4c2d73cced26b8900c95ede08e5a9c478c107529
Reference: BugDumps 13-20160715-21 L#52, BugDumps 20160909-15 L#39

Mudança Sumário

Diff

--- a/src/com/android/settings/applications/InstalledAppDetails.java
+++ b/src/com/android/settings/applications/InstalledAppDetails.java
@@ -475,7 +475,8 @@ public class InstalledAppDetails extends AppInfoBase
475475 uninstallUpdatesItem, mAppsControlDisallowedAdmin);
476476 }
477477
478- menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo.applicationInfo.protect);
478+ menu.findItem(OPEN_PROTECTED_APPS).setVisible(mPackageInfo != null &&
479+ mPackageInfo.applicationInfo != null && mPackageInfo.applicationInfo.protect);
479480 }
480481
481482 @Override