Program: 79779
Project: 79779
Buggy source:
@Override protected void onCreate(Bundle savedInstanceState){
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
  if (WallpaperFactory.isLiveWallpaperUsed(this) && WallpaperFactory.isWallpaperThemeSelected(this)) {
    setTheme(R.style.AppTheme_Peek_Wallpaper);
  }
 else {
    setTheme(R.style.AppTheme_Peek);
  }
  super.onCreate(savedInstanceState);
  mPeekView=NotificationPeek.getPeekView();
  mNotificationsContainer=(GridLayout)mPeekView.findViewById(R.id.notification_container);
  mNotificationView=(ViewGroup)mPeekView.findViewById(R.id.notification_view);
  setContentView(mPeekView);
  boolean showClock=PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PreferenceKeys.PREF_CLOCK,true);
  if (showClock) {
    mClockTextView=(TextView)PeekLayoutFactory.createPeekLayout(this,PeekLayoutFactory.LAYOUT_TYPE_CLOCK,null);
    mPeekView.addView(mClockTextView);
    mClockTextView.setText(getCurrentTimeText());
  }
  mPeekView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
  initReceiver();
  mNotificationLayout=(NotificationLayout)mPeekView.findViewById(R.id.notification_layout);
  mPeek=mNotificationLayout.getNotificationPeek();
  mNotificationIcon=(ImageView)mPeekView.findViewById(R.id.notification_icon);
  StatusBarNotification n=(StatusBarNotification)mNotificationView.getTag();
  final PendingIntent contentIntent=n.getNotification().contentIntent;
  if (contentIntent != null) {
    mNotificationClicker=new NotificationClicker(n,mPeek);
    mNotificationIcon.setOnClickListener(mNotificationClicker);
  }
 else {
    mNotificationIcon.setOnClickListener(null);
  }
  mNotificationText=(TextView)mPeekView.findViewById(R.id.notification_text);
}

Fixed version (ground truth):
@Override protected void onCreate(Bundle savedInstanceState){
  getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD);
  if (WallpaperFactory.isLiveWallpaperUsed(this) && WallpaperFactory.isWallpaperThemeSelected(this)) {
    setTheme(R.style.AppTheme_Peek_Wallpaper);
  }
 else {
    setTheme(R.style.AppTheme_Peek);
  }
  super.onCreate(savedInstanceState);
  mPeekView=NotificationPeek.getPeekView();
  mNotificationsContainer=(GridLayout)mPeekView.findViewById(R.id.notification_container);
  mNotificationView=(ViewGroup)mPeekView.findViewById(R.id.notification_view);
  setContentView(mPeekView);
  boolean showClock=PreferenceManager.getDefaultSharedPreferences(this).getBoolean(PreferenceKeys.PREF_CLOCK,true);
  if (showClock) {
    mClockTextView=(TextView)PeekLayoutFactory.createPeekLayout(this,PeekLayoutFactory.LAYOUT_TYPE_CLOCK,null);
    mPeekView.addView(mClockTextView);
    mClockTextView.setText(getCurrentTimeText());
  }
  mPeekView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_IMMERSIVE | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION | View.SYSTEM_UI_FLAG_FULLSCREEN| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
  initReceiver();
  mNotificationLayout=(NotificationLayout)mPeekView.findViewById(R.id.notification_layout);
  mPeek=mNotificationLayout.getNotificationPeek();
  mNotificationIcon=(ImageView)mPeekView.findViewById(R.id.notification_icon);
  mNotificationText=(TextView)mPeekView.findViewById(R.id.notification_text);
}