Java Code Examples for android.os.Bundle#setAllowFds()

The following examples show how to use android.os.Bundle#setAllowFds() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: LoadedApk.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public void performReceive(Intent intent, int resultCode, String data,
        Bundle extras, boolean ordered, boolean sticky, int sendingUser) {
    final LoadedApk.ReceiverDispatcher rd;
    if (intent == null) {
        Log.wtf(TAG, "Null intent received");
        rd = null;
    } else {
        rd = mDispatcher.get();
    }
    if (ActivityThread.DEBUG_BROADCAST) {
        int seq = intent.getIntExtra("seq", -1);
        Slog.i(ActivityThread.TAG, "Receiving broadcast " + intent.getAction()
                + " seq=" + seq + " to " + (rd != null ? rd.mReceiver : null));
    }
    if (rd != null) {
        rd.performReceive(intent, resultCode, data, extras,
                ordered, sticky, sendingUser);
    } else {
        // The activity manager dispatched a broadcast to a registered
        // receiver in this process, but before it could be delivered the
        // receiver was unregistered.  Acknowledge the broadcast on its
        // behalf so that the system's broadcast sequence can continue.
        if (ActivityThread.DEBUG_BROADCAST) Slog.i(ActivityThread.TAG,
                "Finishing broadcast to unregistered receiver");
        IActivityManager mgr = ActivityManager.getService();
        try {
            if (extras != null) {
                extras.setAllowFds(false);
            }
            mgr.finishReceiver(this, resultCode, data, extras, false, intent.getFlags());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
 
Example 2
Source File: LoadedApk.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public void performReceive(Intent intent, int resultCode, String data,
        Bundle extras, boolean ordered, boolean sticky, int sendingUser) {
    final LoadedApk.ReceiverDispatcher rd;
    if (intent == null) {
        Log.wtf(TAG, "Null intent received");
        rd = null;
    } else {
        rd = mDispatcher.get();
    }
    if (ActivityThread.DEBUG_BROADCAST) {
        int seq = intent.getIntExtra("seq", -1);
        Slog.i(ActivityThread.TAG, "Receiving broadcast " + intent.getAction()
                + " seq=" + seq + " to " + (rd != null ? rd.mReceiver : null));
    }
    if (rd != null) {
        rd.performReceive(intent, resultCode, data, extras,
                ordered, sticky, sendingUser);
    } else {
        // The activity manager dispatched a broadcast to a registered
        // receiver in this process, but before it could be delivered the
        // receiver was unregistered.  Acknowledge the broadcast on its
        // behalf so that the system's broadcast sequence can continue.
        if (ActivityThread.DEBUG_BROADCAST) Slog.i(ActivityThread.TAG,
                "Finishing broadcast to unregistered receiver");
        IActivityManager mgr = ActivityManager.getService();
        try {
            if (extras != null) {
                extras.setAllowFds(false);
            }
            mgr.finishReceiver(this, resultCode, data, extras, false, intent.getFlags());
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
 
Example 3
Source File: ContextImpl.java    From android_9.0.0_r45 with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManager.getService().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 4
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 5
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId());
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 6
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId());
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 7
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, getUserId());
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 8
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 9
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManager.getService().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 10
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 11
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManager.getService().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 12
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 13
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null);
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 14
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null);
    } catch (RemoteException e) {
        // System has crashed, nothing we can do.
    }
    return false;
}
 
Example 15
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManager.getService().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 16
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManager.getService().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}
 
Example 17
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManagerNative.getDefault().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw new RuntimeException("Failure from system", e);
    }
}
 
Example 18
Source File: ContextImpl.java    From AndroidComponentPlugin with Apache License 2.0 5 votes vote down vote up
@Override
public boolean startInstrumentation(ComponentName className,
        String profileFile, Bundle arguments) {
    try {
        if (arguments != null) {
            arguments.setAllowFds(false);
        }
        return ActivityManager.getService().startInstrumentation(
                className, profileFile, 0, arguments, null, null, getUserId(),
                null /* ABI override */);
    } catch (RemoteException e) {
        throw e.rethrowFromSystemServer();
    }
}