Search in sources :

Example 6 with ResultReceiver

use of android.os.ResultReceiver in project platform_frameworks_base by android.

the class Tethering method runSilentTetherProvisioningAndEnable.

private void runSilentTetherProvisioningAndEnable(int type, ResultReceiver receiver) {
    ResultReceiver proxyReceiver = getProxyReceiver(type, receiver);
    sendSilentTetherProvisionIntent(type, proxyReceiver);
}
Also used : ResultReceiver(android.os.ResultReceiver)

Example 7 with ResultReceiver

use of android.os.ResultReceiver in project android_frameworks_base by DirtyUnicorns.

the class BatteryService method dumpInternal.

private void dumpInternal(FileDescriptor fd, PrintWriter pw, String[] args) {
    synchronized (mLock) {
        if (args == null || args.length == 0 || "-a".equals(args[0])) {
            pw.println("Current Battery Service state:");
            if (mUpdatesStopped) {
                pw.println("  (UPDATES STOPPED -- use 'reset' to restart)");
            }
            pw.println("  AC powered: " + mBatteryProps.chargerAcOnline);
            pw.println("  USB powered: " + mBatteryProps.chargerUsbOnline);
            pw.println("  Wireless powered: " + mBatteryProps.chargerWirelessOnline);
            pw.println("  Max charging current: " + mBatteryProps.maxChargingCurrent);
            pw.println("  Max charging voltage: " + mBatteryProps.maxChargingVoltage);
            pw.println("  Charge counter: " + mBatteryProps.batteryChargeCounter);
            pw.println("  status: " + mBatteryProps.batteryStatus);
            pw.println("  health: " + mBatteryProps.batteryHealth);
            pw.println("  present: " + mBatteryProps.batteryPresent);
            pw.println("  level: " + mBatteryProps.batteryLevel);
            pw.println("  scale: " + BATTERY_SCALE);
            pw.println("  voltage: " + mBatteryProps.batteryVoltage);
            pw.println("  temperature: " + mBatteryProps.batteryTemperature);
            pw.println("  technology: " + mBatteryProps.batteryTechnology);
        } else {
            Shell shell = new Shell();
            shell.exec(mBinderService, null, fd, null, args, new ResultReceiver(null));
        }
    }
}
Also used : ResultReceiver(android.os.ResultReceiver)

Example 8 with ResultReceiver

use of android.os.ResultReceiver in project android_frameworks_base by DirtyUnicorns.

the class ActivityTransitionState method enterReady.

public void enterReady(Activity activity) {
    if (mEnterActivityOptions == null || mIsEnterTriggered) {
        return;
    }
    mIsEnterTriggered = true;
    mHasExited = false;
    ArrayList<String> sharedElementNames = mEnterActivityOptions.getSharedElementNames();
    ResultReceiver resultReceiver = mEnterActivityOptions.getResultReceiver();
    if (mEnterActivityOptions.isReturning()) {
        restoreExitedViews();
        activity.getWindow().getDecorView().setVisibility(View.VISIBLE);
    }
    mEnterTransitionCoordinator = new EnterTransitionCoordinator(activity, resultReceiver, sharedElementNames, mEnterActivityOptions.isReturning(), mEnterActivityOptions.isCrossTask());
    if (mEnterActivityOptions.isCrossTask()) {
        mExitingFrom = new ArrayList<>(mEnterActivityOptions.getSharedElementNames());
        mExitingTo = new ArrayList<>(mEnterActivityOptions.getSharedElementNames());
    }
    if (!mIsEnterPostponed) {
        startEnter();
    }
}
Also used : ResultReceiver(android.os.ResultReceiver)

Example 9 with ResultReceiver

use of android.os.ResultReceiver in project android_frameworks_base by DirtyUnicorns.

the class ExitTransitionCoordinator method notifyComplete.

protected void notifyComplete() {
    if (isReadyToNotify()) {
        if (!mSharedElementNotified) {
            mSharedElementNotified = true;
            delayCancel();
            if (mListener == null) {
                mResultReceiver.send(MSG_TAKE_SHARED_ELEMENTS, mSharedElementBundle);
                notifyExitComplete();
            } else {
                final ResultReceiver resultReceiver = mResultReceiver;
                final Bundle sharedElementBundle = mSharedElementBundle;
                mListener.onSharedElementsArrived(mSharedElementNames, mSharedElements, new OnSharedElementsReadyListener() {

                    @Override
                    public void onSharedElementsReady() {
                        resultReceiver.send(MSG_TAKE_SHARED_ELEMENTS, sharedElementBundle);
                        notifyExitComplete();
                    }
                });
            }
        } else {
            notifyExitComplete();
        }
    }
}
Also used : Bundle(android.os.Bundle) OnSharedElementsReadyListener(android.app.SharedElementCallback.OnSharedElementsReadyListener) ResultReceiver(android.os.ResultReceiver)

Example 10 with ResultReceiver

use of android.os.ResultReceiver in project android_frameworks_base by AOSPA.

the class Pm method runShellCommand.

private int runShellCommand(String serviceName, String[] args) {
    final HandlerThread handlerThread = new HandlerThread("results");
    handlerThread.start();
    try {
        ServiceManager.getService(serviceName).shellCommand(FileDescriptor.in, FileDescriptor.out, FileDescriptor.err, args, new ResultReceiver(new Handler(handlerThread.getLooper())));
        return 0;
    } catch (RemoteException e) {
        e.printStackTrace();
    } finally {
        handlerThread.quitSafely();
    }
    return -1;
}
Also used : HandlerThread(android.os.HandlerThread) Handler(android.os.Handler) RemoteException(android.os.RemoteException) ResultReceiver(android.os.ResultReceiver)

Aggregations

ResultReceiver (android.os.ResultReceiver)70 Bundle (android.os.Bundle)38 RemoteException (android.os.RemoteException)11 Handler (android.os.Handler)9 HandlerThread (android.os.HandlerThread)6 OnSharedElementsReadyListener (android.app.SharedElementCallback.OnSharedElementsReadyListener)5 Intent (android.content.Intent)5 Parcel (android.os.Parcel)5 Parcelable (android.os.Parcelable)5 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)5 JSONArray (org.json.JSONArray)5 JSONException (org.json.JSONException)5 ParcelFileDescriptor (android.os.ParcelFileDescriptor)4 File (java.io.File)4 SharedPreferences (android.content.SharedPreferences)3 IOException (java.io.IOException)3 Point (android.graphics.Point)2 InputMethodManager (android.view.inputmethod.InputMethodManager)2 IResultReceiver (com.android.internal.os.IResultReceiver)2 JSONObject (org.json.JSONObject)2