use of android.os.IBinder in project platform_frameworks_base by android.
the class LockPatternUtils method updateEncryptionPassword.
/** Update the encryption password if it is enabled **/
private void updateEncryptionPassword(final int type, final String password) {
if (!isDeviceEncryptionEnabled()) {
return;
}
final IBinder service = ServiceManager.getService("mount");
if (service == null) {
Log.e(TAG, "Could not find the mount service to update the encryption password");
return;
}
new AsyncTask<Void, Void, Void>() {
@Override
protected Void doInBackground(Void... dummy) {
IMountService mountService = IMountService.Stub.asInterface(service);
try {
mountService.changeEncryptionPassword(type, password);
} catch (RemoteException e) {
Log.e(TAG, "Error changing encryption password", e);
}
return null;
}
}.execute();
}
use of android.os.IBinder in project platform_frameworks_base by android.
the class SoundPool method getService.
private static IAudioService getService() {
if (sService != null) {
return sService;
}
IBinder b = ServiceManager.getService(Context.AUDIO_SERVICE);
sService = IAudioService.Stub.asInterface(b);
return sService;
}
use of android.os.IBinder in project platform_frameworks_base by android.
the class AudioRecord method handleFullVolumeRec.
private void handleFullVolumeRec(boolean starting) {
if (!mIsSubmixFullVolume) {
return;
}
final IBinder b = ServiceManager.getService(android.content.Context.AUDIO_SERVICE);
final IAudioService ias = IAudioService.Stub.asInterface(b);
try {
ias.forceRemoteSubmixFullVolume(starting, mICallBack);
} catch (RemoteException e) {
Log.e(TAG, "Error talking to AudioService when handling full submix volume", e);
}
}
use of android.os.IBinder in project platform_frameworks_base by android.
the class StatusBarWindowView method onAttachedToWindow.
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
// the scrim, we don't need the window to be cleared in the beginning.
if (mService.isScrimSrcModeEnabled()) {
IBinder windowToken = getWindowToken();
WindowManager.LayoutParams lp = (WindowManager.LayoutParams) getLayoutParams();
lp.token = windowToken;
setLayoutParams(lp);
WindowManagerGlobal.getInstance().changeCanvasOpacity(windowToken, true);
setWillNotDraw(false);
} else {
setWillNotDraw(!DEBUG);
}
}
use of android.os.IBinder in project platform_frameworks_base by android.
the class AppWidgetServiceImpl method handleNotifyAppWidgetViewDataChanged.
private void handleNotifyAppWidgetViewDataChanged(Host host, IAppWidgetHost callbacks, int appWidgetId, int viewId, long requestTime) {
try {
callbacks.viewDataChanged(appWidgetId, viewId);
host.lastWidgetUpdateTime = requestTime;
} catch (RemoteException re) {
// It failed; remove the callback. No need to prune because
// we know that this host is still referenced by this instance.
callbacks = null;
}
// RemoteViewsFactory.onDataSetChanged() directly
synchronized (mLock) {
if (callbacks == null) {
host.callbacks = null;
Set<Pair<Integer, FilterComparison>> keys = mRemoteViewsServicesAppWidgets.keySet();
for (Pair<Integer, FilterComparison> key : keys) {
if (mRemoteViewsServicesAppWidgets.get(key).contains(appWidgetId)) {
final ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
IRemoteViewsFactory cb = IRemoteViewsFactory.Stub.asInterface(service);
try {
cb.onDataSetChangedAsync();
} catch (RemoteException e) {
Slog.e(TAG, "Error calling onDataSetChangedAsync()", e);
}
mContext.unbindService(this);
}
@Override
public void onServiceDisconnected(android.content.ComponentName name) {
// Do nothing
}
};
final int userId = UserHandle.getUserId(key.first);
Intent intent = key.second.getIntent();
// Bind to the service and call onDataSetChanged()
bindService(intent, connection, new UserHandle(userId));
}
}
}
}
}
Aggregations