Search in sources :

Example 51 with IBinder

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();
}
Also used : IBinder(android.os.IBinder) IMountService(android.os.storage.IMountService) RemoteException(android.os.RemoteException)

Example 52 with IBinder

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;
}
Also used : IBinder(android.os.IBinder)

Example 53 with IBinder

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);
    }
}
Also used : IBinder(android.os.IBinder) RemoteException(android.os.RemoteException)

Example 54 with IBinder

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);
    }
}
Also used : IBinder(android.os.IBinder) WindowManager(android.view.WindowManager)

Example 55 with IBinder

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));
                }
            }
        }
    }
}
Also used : ServiceConnection(android.content.ServiceConnection) PendingIntent(android.app.PendingIntent) Intent(android.content.Intent) Point(android.graphics.Point) IBinder(android.os.IBinder) UserHandle(android.os.UserHandle) IRemoteViewsFactory(com.android.internal.widget.IRemoteViewsFactory) FilterComparison(android.content.Intent.FilterComparison) ComponentName(android.content.ComponentName) RemoteException(android.os.RemoteException) Pair(android.util.Pair)

Aggregations

IBinder (android.os.IBinder)991 RemoteException (android.os.RemoteException)494 Intent (android.content.Intent)141 ComponentName (android.content.ComponentName)128 ServiceConnection (android.content.ServiceConnection)94 Parcel (android.os.Parcel)91 Point (android.graphics.Point)67 PendingIntent (android.app.PendingIntent)60 IOException (java.io.IOException)53 UserHandle (android.os.UserHandle)50 Bundle (android.os.Bundle)40 Binder (android.os.Binder)37 Message (android.os.Message)37 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)34 AndroidRuntimeException (android.util.AndroidRuntimeException)33 Handler (android.os.Handler)31 ArrayList (java.util.ArrayList)27 IContentProvider (android.content.IContentProvider)25 TransactionTooLargeException (android.os.TransactionTooLargeException)25 OperationResult (android.security.keymaster.OperationResult)25