INNER CODE UNIT · Java
shouldIgnoreIntents
yuliskov/SmartTubeLegacy · browser/src/main/java/com/liskovsoft/browser/BaseBrowserFragment.java:197
private boolean shouldIgnoreIntents() {
// Only process intents if the screen is on and the device is unlocked
// aka, if we will be user-visible
if (mKeyguardManager == null) {
mKeyguardManager = (KeyguardManager) getActivity().getSystemService(Context.KEYGUARD_SERVICE);
}
if (mPowerManager == null) {
mPowerManager = (PowerManager) getActivity().getSystemService(Context.POWER_SERVICE);
}
boolean ignore = !mPowerManager.isScreenOn();
ignore |= mKeyguardManager.inKeyguardRestrictedInputMode();
Log.i(TAG, "ignore intents: " + ignore);
return ignore;
}
@Override
public int getState() {
return mState;