void injectMultipleServices(@SystemService ActivityManager firstMultipleService, @SystemService WindowManager secondMultipleService) { this.firstMultipleService = firstMultipleService; this.secondMultipleService = secondMultipleService; } }
@SystemService void injectAppWidgetManager(AppWidgetManager methodInjectedAppWidgetManager) { this.methodInjectedAppWidgetManager = methodInjectedAppWidgetManager; }
@SystemService void injectSingleServiceWithMethodAnnotation(ActivityManager serviceWithMethodAnnotation) { this.serviceWithMethodAnnotation = serviceWithMethodAnnotation; }
void injectSingleServiceWithParameterAnnotation(@SystemService WindowManager serviceWithParameterAnnotation) { this.serviceWithParameterAnnotation = serviceWithParameterAnnotation; }
@EBean public class AfterInjectBean { public boolean afterInjectCalled = false; public boolean notificationManagerNullAfterInject = true; @SystemService NotificationManager notificationManager; @AfterInject void afterInject() { afterInjectCalled = true; notificationManagerNullAfterInject = notificationManager == null; } }
@EActivity public class AfterInjectActivity extends Activity { public boolean afterInjectCalled = false; public boolean notificationManagerNullAfterInject = true; @SystemService NotificationManager notificationManager; @AfterInject void afterInject() { afterInjectCalled = true; notificationManagerNullAfterInject = notificationManager == null; } }
@SystemService AccessibilityManager accessibilityManager; @SystemService AccountManager accountManager; @SystemService ActivityManager activityManager; @SystemService AlarmManager alarmManager; @SystemService AppWidgetManager appWidgetManager; @SystemService AudioManager audioManager; @SystemService android.content.ClipboardManager contentClipboardManager; @SystemService android.text.ClipboardManager textClipboardManager; @SystemService ConnectivityManager connectivityManager; @SystemService DevicePolicyManager devicePolicyManager;
@EReceiver public class MyReceiver extends BroadcastReceiver { @SystemService NotificationManager notificationManager; @Bean EnhancedClass dependency; @Override public void onReceive(Context context, Intent intent) { showToast(context); workInBackground(); } @Trace @UiThread void showToast(Context context) { Toast.makeText(context, "Hello World!", Toast.LENGTH_LONG).show(); } @Trace @Background void workInBackground() { Log.d(MyService.class.getSimpleName(), "Doing some background work."); } }
TextView myTextView; @SystemService ActivityManager activityManager;
@EService public class MyService extends IntentService { @SystemService NotificationManager notificationManager;
@EService public class MySimpleIntentService extends IntentService { @SystemService NotificationManager notificationManager;
TextView myTextView; @SystemService ActivityManager activityManager;
@EProvider public class MyProvider extends ContentProvider { @SystemService NotificationManager notificationManager;
@SystemService ActivityManager activityManager;
@EBean(scope = EBean.Scope.Singleton) public class ConnectivityHelper { @SystemService ConnectivityManager connectivityManager; public boolean isNetworkAvailable() { NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo(); return activeNetworkInfo != null && activeNetworkInfo.isConnected(); } }
@SystemService protected LocationManager locationManager; @SystemService protected WifiManager wifi;
private Display display; @SystemService WindowManager windowManager;
public class NotificationHelper { private static final String TAG = NotificationHelper.class.getSimpleName(); @SystemService NotificationManager notificationManager; @SystemService Vibrator vibrator; @Bean
@EBean(scope = EBean.Scope.Singleton) public class MovirtAuthenticator extends AbstractAccountAuthenticator { @SystemService AccountManager accountManager;
protected ImageView ivCopy_AM; @SystemService protected ClipboardManager clipboardManager;