use of com.android.internal.statusbar.IStatusBarService in project android_frameworks_base by DirtyUnicorns.
the class DevicePolicyManagerService method setStatusBarDisabledInternal.
private boolean setStatusBarDisabledInternal(boolean disabled, int userId) {
long ident = mInjector.binderClearCallingIdentity();
try {
IStatusBarService statusBarService = IStatusBarService.Stub.asInterface(ServiceManager.checkService(Context.STATUS_BAR_SERVICE));
if (statusBarService != null) {
int flags1 = disabled ? STATUS_BAR_DISABLE_MASK : StatusBarManager.DISABLE_NONE;
int flags2 = disabled ? STATUS_BAR_DISABLE2_MASK : StatusBarManager.DISABLE2_NONE;
statusBarService.disableForUser(flags1, mToken, mContext.getPackageName(), userId);
statusBarService.disable2ForUser(flags2, mToken, mContext.getPackageName(), userId);
return true;
}
} catch (RemoteException e) {
Slog.e(LOG_TAG, "Failed to disable the status bar", e);
} finally {
mInjector.binderRestoreCallingIdentity(ident);
}
return false;
}
use of com.android.internal.statusbar.IStatusBarService in project android_frameworks_base by ResurrectionRemix.
the class InputMethodService method showWindow.
public void showWindow(boolean showInput) {
if (DEBUG)
Log.v(TAG, "Showing window: showInput=" + showInput + " mShowInputRequested=" + mShowInputRequested + " mWindowAdded=" + mWindowAdded + " mWindowCreated=" + mWindowCreated + " mWindowVisible=" + mWindowVisible + " mInputStarted=" + mInputStarted + " mShowInputFlags=" + mShowInputFlags);
if (mInShowWindow) {
Log.w(TAG, "Re-entrance in to showWindow");
return;
}
try {
mWindowWasVisible = mWindowVisible;
mInShowWindow = true;
showWindowInner(showInput);
} catch (BadTokenException e) {
// while there is a DO_SHOW_SOFT_INPUT message in the IIMethodWrapper queue.
if (DEBUG)
Log.v(TAG, "BadTokenException: IME is done.");
mWindowVisible = false;
mWindowAdded = false;
// InputMethodManager#showSoftInputFromInputMethod() should always be used instead.
throw e;
} finally {
// TODO: Is it OK to set true when we get BadTokenException?
mWindowWasVisible = true;
mInShowWindow = false;
}
IStatusBarService statusbar = getStatusBarService();
int mKeyboardRotationTimeout = Settings.System.getIntForUser(getContentResolver(), Settings.System.KEYBOARD_ROTATION_TIMEOUT, 0, UserHandle.USER_CURRENT_OR_SELF);
if (mKeyboardRotationTimeout > 0) {
mHandler.removeCallbacks(restoreAutoRotation);
if (!mForcedAutoRotate) {
boolean isAutoRotate = (Settings.System.getIntForUser(getContentResolver(), Settings.System.ACCELEROMETER_ROTATION, 0, UserHandle.USER_CURRENT_OR_SELF) == 1);
if (!isAutoRotate) {
try {
if (statusbar != null) {
statusbar.setAutoRotate(true);
mForcedAutoRotate = true;
}
} catch (RemoteException e) {
mStatusBarService = null;
}
}
}
}
}
Aggregations