Back to project page android_device.
The source code is released under:
[Apache License](http://www.apache.org/licenses/): Version 2.0, January 2004 =============== ## TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ## ### 1. Definitions. ### "License" sha...
If you think the Android project android_device listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
/* * ================================================================================================= * Copyright (C) 2013 - 2014 Martin Albedinsky [Wolf-ITechnologies] * ================================================================================================= * Licensed under the Apache License, Version 2.0 or later (further "License" only). * ------------------------------------------------------------------------------------------------- * You may use this file only in compliance with the License. More details and copy of this License * you may obtain at/*from w w w .j a v a 2 s . c o m*/ * * http://www.apache.org/licenses/LICENSE-2.0 * * You can redistribute, modify or publish any part of the code written within this file but as it * is described in the License, the software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES or CONDITIONS OF ANY KIND. * * See the License for the specific language governing permissions and limitations under the License. * ================================================================================================= */ package com.wit.android.device.receiver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; import android.support.annotation.NonNull; import com.wit.android.device.AndroidDevice; import com.wit.android.device.Battery; /** * <h3>Class Overview</h3> * todo: description * <p> * This broadcast receiver receives all data about the battery. * * @author Martin Albedinsky */ public class BatteryStatusReceiver extends Battery.BatteryBroadcastReceiver { /** * Interface =================================================================================== */ /** * Constants =================================================================================== */ /** * Log TAG. */ // private static final String TAG = "BatteryStatusReceiver"; /** * Flag indicating whether the debug output trough log-cat is enabled or not. */ // private static final boolean DEBUG_ENABLED = true; /** * Flag indicating whether the output trough log-cat is enabled or not. */ // private static final boolean LOG_ENABLED = true; /** * Id of this receiver. */ public static final int RECEIVER_ID = 0x10001; /** * Methods ===================================================================================== */ /** * Returns the intent filter for {@link Intent#ACTION_BATTERY_CHANGED} action which should be used * when registering this instance of battery receiver. * * @return New instance of {@link android.content.IntentFilter}. */ @NonNull @Override public final IntentFilter newIntentFilter() { return new IntentFilter(Intent.ACTION_BATTERY_CHANGED); } /** */ @Override public void onReceive(Context context, Intent intent) { final Battery battery = AndroidDevice.getInstance(context).getBattery(); battery.processReceivedBroadcast(context, intent, RECEIVER_ID); } }