summaryrefslogtreecommitdiffstats
path: root/src/com/android/settings/DeviceAdminSettings.java
diff options
context:
space:
mode:
authorZoltan Szatmary-Ban <szatmz@google.com>2014-09-11 10:52:56 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-11 10:52:57 +0000
commitcf911d107ac931306af80fd02eb696410bb2aaad (patch)
tree8d6b77e14e6c444a271100a35c4a4b575709d791 /src/com/android/settings/DeviceAdminSettings.java
parentf572fdd132c796448064f919dcbe22ae70659aa8 (diff)
parentd92897d39fb9734cf2fd8c74ff1f6f3233933086 (diff)
downloadpackages_apps_Settings-cf911d107ac931306af80fd02eb696410bb2aaad.zip
packages_apps_Settings-cf911d107ac931306af80fd02eb696410bb2aaad.tar.gz
packages_apps_Settings-cf911d107ac931306af80fd02eb696410bb2aaad.tar.bz2
Merge "Check for DeviceAdminInfo type before casting" into lmp-dev
Diffstat (limited to 'src/com/android/settings/DeviceAdminSettings.java')
-rw-r--r--src/com/android/settings/DeviceAdminSettings.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/com/android/settings/DeviceAdminSettings.java b/src/com/android/settings/DeviceAdminSettings.java
index 6ac0974..bc22637 100644
--- a/src/com/android/settings/DeviceAdminSettings.java
+++ b/src/com/android/settings/DeviceAdminSettings.java
@@ -126,7 +126,12 @@ public class DeviceAdminSettings extends ListFragment {
@Override
public void onListItemClick(ListView l, View v, int position, long id) {
- DeviceAdminInfo dpi = (DeviceAdminInfo) l.getAdapter().getItem(position);
+ Object o = l.getAdapter().getItem(position);
+ if (!(o instanceof DeviceAdminInfo)) {
+ // race conditions may cause this
+ return;
+ }
+ DeviceAdminInfo dpi = (DeviceAdminInfo) o;
final Activity activity = getActivity();
final int userId = getUserId(dpi);
if (userId == UserHandle.myUserId() || !isProfileOwner(dpi)) {