@@ -245,12 +245,18 @@ struct NotificationJni
245
245
JniMethodID getGroup ;
246
246
JniMethodID getSortKey ;
247
247
248
+ JniFieldID extras ;
249
+ JniFieldID flags ;
250
+ JniFieldID number ;
251
+ JniFieldID when ;
252
+
248
253
public void CollectJni ( )
249
254
{
250
255
using ( var notificationClass = new AndroidJavaClass ( "android.app.Notification" ) )
251
256
{
252
257
CollectConstants ( notificationClass ) ;
253
258
CollectMethods ( notificationClass ) ;
259
+ CollectFields ( notificationClass ) ;
254
260
}
255
261
}
256
262
@@ -271,19 +277,27 @@ void CollectMethods(AndroidJavaClass clazz)
271
277
getSortKey = JniApi . FindMethod ( clazz , "getSortKey" , "()Ljava/lang/String;" , false ) ;
272
278
}
273
279
280
+ void CollectFields ( AndroidJavaClass clazz )
281
+ {
282
+ extras = JniApi . FindField ( clazz , "extras" , "Landroid/os/Bundle;" , false ) ;
283
+ flags = JniApi . FindField ( clazz , "flags" , "I" , false ) ;
284
+ number = JniApi . FindField ( clazz , "number" , "I" , false ) ;
285
+ when = JniApi . FindField ( clazz , "when" , "J" , false ) ;
286
+ }
287
+
274
288
public AndroidJavaObject Extras ( AndroidJavaObject notification )
275
289
{
276
- return notification . Get < AndroidJavaObject > ( " extras" ) ;
290
+ return notification . Get < AndroidJavaObject > ( extras ) ;
277
291
}
278
292
279
293
public int Flags ( AndroidJavaObject notification )
280
294
{
281
- return notification . Get < int > ( " flags" ) ;
295
+ return notification . Get < int > ( flags ) ;
282
296
}
283
297
284
298
public int Number ( AndroidJavaObject notification )
285
299
{
286
- return notification . Get < int > ( " number" ) ;
300
+ return notification . Get < int > ( number ) ;
287
301
}
288
302
289
303
public string GetGroup ( AndroidJavaObject notification )
@@ -298,7 +312,7 @@ public string GetSortKey(AndroidJavaObject notification)
298
312
299
313
internal long When ( AndroidJavaObject notification )
300
314
{
301
- return notification . Get < long > ( " when" ) ;
315
+ return notification . Get < long > ( when ) ;
302
316
}
303
317
}
304
318
0 commit comments