ApplicationThreadNativepublic abstract class ApplicationThreadNative extends android.os.Binder implements IApplicationThread
Constructors Summary |
---|
public ApplicationThreadNative()
attachInterface(this, descriptor);
|
Methods Summary |
---|
public android.os.IBinder | asBinder()
return this;
| public static IApplicationThread | asInterface(android.os.IBinder obj)Cast a Binder object into an application thread interface, generating
a proxy if needed.
if (obj == null) {
return null;
}
IApplicationThread in =
(IApplicationThread)obj.queryLocalInterface(descriptor);
if (in != null) {
return in;
}
return new ApplicationThreadProxy(obj);
| public boolean | onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags)
switch (code) {
case SCHEDULE_PAUSE_ACTIVITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
boolean finished = data.readInt() != 0;
boolean userLeaving = data.readInt() != 0;
int configChanges = data.readInt();
boolean dontReport = data.readInt() != 0;
schedulePauseActivity(b, finished, userLeaving, configChanges, dontReport);
return true;
}
case SCHEDULE_STOP_ACTIVITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
boolean show = data.readInt() != 0;
int configChanges = data.readInt();
scheduleStopActivity(b, show, configChanges);
return true;
}
case SCHEDULE_WINDOW_VISIBILITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
boolean show = data.readInt() != 0;
scheduleWindowVisibility(b, show);
return true;
}
case SCHEDULE_SLEEPING_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
boolean sleeping = data.readInt() != 0;
scheduleSleeping(b, sleeping);
return true;
}
case SCHEDULE_RESUME_ACTIVITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
int procState = data.readInt();
boolean isForward = data.readInt() != 0;
Bundle resumeArgs = data.readBundle();
scheduleResumeActivity(b, procState, isForward, resumeArgs);
return true;
}
case SCHEDULE_SEND_RESULT_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
scheduleSendResult(b, ri);
return true;
}
case SCHEDULE_LAUNCH_ACTIVITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
Intent intent = Intent.CREATOR.createFromParcel(data);
IBinder b = data.readStrongBinder();
int ident = data.readInt();
ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
Configuration curConfig = Configuration.CREATOR.createFromParcel(data);
CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
String referrer = data.readString();
IVoiceInteractor voiceInteractor = IVoiceInteractor.Stub.asInterface(
data.readStrongBinder());
int procState = data.readInt();
Bundle state = data.readBundle();
PersistableBundle persistentState = data.readPersistableBundle();
List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR);
boolean notResumed = data.readInt() != 0;
boolean isForward = data.readInt() != 0;
ProfilerInfo profilerInfo = data.readInt() != 0
? ProfilerInfo.CREATOR.createFromParcel(data) : null;
scheduleLaunchActivity(intent, b, ident, info, curConfig, compatInfo, referrer,
voiceInteractor, procState, state, persistentState, ri, pi,
notResumed, isForward, profilerInfo);
return true;
}
case SCHEDULE_RELAUNCH_ACTIVITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
List<ResultInfo> ri = data.createTypedArrayList(ResultInfo.CREATOR);
List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR);
int configChanges = data.readInt();
boolean notResumed = data.readInt() != 0;
Configuration config = null;
if (data.readInt() != 0) {
config = Configuration.CREATOR.createFromParcel(data);
}
scheduleRelaunchActivity(b, ri, pi, configChanges, notResumed, config);
return true;
}
case SCHEDULE_NEW_INTENT_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
List<ReferrerIntent> pi = data.createTypedArrayList(ReferrerIntent.CREATOR);
IBinder b = data.readStrongBinder();
scheduleNewIntent(pi, b);
return true;
}
case SCHEDULE_FINISH_ACTIVITY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
boolean finishing = data.readInt() != 0;
int configChanges = data.readInt();
scheduleDestroyActivity(b, finishing, configChanges);
return true;
}
case SCHEDULE_RECEIVER_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
Intent intent = Intent.CREATOR.createFromParcel(data);
ActivityInfo info = ActivityInfo.CREATOR.createFromParcel(data);
CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
int resultCode = data.readInt();
String resultData = data.readString();
Bundle resultExtras = data.readBundle();
boolean sync = data.readInt() != 0;
int sendingUser = data.readInt();
int processState = data.readInt();
scheduleReceiver(intent, info, compatInfo, resultCode, resultData,
resultExtras, sync, sendingUser, processState);
return true;
}
case SCHEDULE_CREATE_SERVICE_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
ServiceInfo info = ServiceInfo.CREATOR.createFromParcel(data);
CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
int processState = data.readInt();
scheduleCreateService(token, info, compatInfo, processState);
return true;
}
case SCHEDULE_BIND_SERVICE_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
Intent intent = Intent.CREATOR.createFromParcel(data);
boolean rebind = data.readInt() != 0;
int processState = data.readInt();
scheduleBindService(token, intent, rebind, processState);
return true;
}
case SCHEDULE_UNBIND_SERVICE_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
Intent intent = Intent.CREATOR.createFromParcel(data);
scheduleUnbindService(token, intent);
return true;
}
case SCHEDULE_SERVICE_ARGS_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
boolean taskRemoved = data.readInt() != 0;
int startId = data.readInt();
int fl = data.readInt();
Intent args;
if (data.readInt() != 0) {
args = Intent.CREATOR.createFromParcel(data);
} else {
args = null;
}
scheduleServiceArgs(token, taskRemoved, startId, fl, args);
return true;
}
case SCHEDULE_STOP_SERVICE_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
scheduleStopService(token);
return true;
}
case BIND_APPLICATION_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
String packageName = data.readString();
ApplicationInfo info =
ApplicationInfo.CREATOR.createFromParcel(data);
List<ProviderInfo> providers =
data.createTypedArrayList(ProviderInfo.CREATOR);
ComponentName testName = (data.readInt() != 0)
? new ComponentName(data) : null;
ProfilerInfo profilerInfo = data.readInt() != 0
? ProfilerInfo.CREATOR.createFromParcel(data) : null;
Bundle testArgs = data.readBundle();
IBinder binder = data.readStrongBinder();
IInstrumentationWatcher testWatcher = IInstrumentationWatcher.Stub.asInterface(binder);
binder = data.readStrongBinder();
IUiAutomationConnection uiAutomationConnection =
IUiAutomationConnection.Stub.asInterface(binder);
int testMode = data.readInt();
boolean openGlTrace = data.readInt() != 0;
boolean restrictedBackupMode = (data.readInt() != 0);
boolean persistent = (data.readInt() != 0);
Configuration config = Configuration.CREATOR.createFromParcel(data);
CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
HashMap<String, IBinder> services = data.readHashMap(null);
Bundle coreSettings = data.readBundle();
bindApplication(packageName, info, providers, testName, profilerInfo, testArgs,
testWatcher, uiAutomationConnection, testMode, openGlTrace,
restrictedBackupMode, persistent, config, compatInfo, services, coreSettings);
return true;
}
case SCHEDULE_EXIT_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
scheduleExit();
return true;
}
case SCHEDULE_SUICIDE_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
scheduleSuicide();
return true;
}
case SCHEDULE_CONFIGURATION_CHANGED_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
Configuration config = Configuration.CREATOR.createFromParcel(data);
scheduleConfigurationChanged(config);
return true;
}
case UPDATE_TIME_ZONE_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
updateTimeZone();
return true;
}
case CLEAR_DNS_CACHE_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
clearDnsCache();
return true;
}
case SET_HTTP_PROXY_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
final String proxy = data.readString();
final String port = data.readString();
final String exclList = data.readString();
final Uri pacFileUrl = Uri.CREATOR.createFromParcel(data);
setHttpProxy(proxy, port, exclList, pacFileUrl);
return true;
}
case PROCESS_IN_BACKGROUND_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
processInBackground();
return true;
}
case DUMP_SERVICE_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
ParcelFileDescriptor fd = data.readFileDescriptor();
final IBinder service = data.readStrongBinder();
final String[] args = data.readStringArray();
if (fd != null) {
dumpService(fd.getFileDescriptor(), service, args);
try {
fd.close();
} catch (IOException e) {
}
}
return true;
}
case DUMP_PROVIDER_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
ParcelFileDescriptor fd = data.readFileDescriptor();
final IBinder service = data.readStrongBinder();
final String[] args = data.readStringArray();
if (fd != null) {
dumpProvider(fd.getFileDescriptor(), service, args);
try {
fd.close();
} catch (IOException e) {
}
}
return true;
}
case SCHEDULE_REGISTERED_RECEIVER_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
IIntentReceiver receiver = IIntentReceiver.Stub.asInterface(
data.readStrongBinder());
Intent intent = Intent.CREATOR.createFromParcel(data);
int resultCode = data.readInt();
String dataStr = data.readString();
Bundle extras = data.readBundle();
boolean ordered = data.readInt() != 0;
boolean sticky = data.readInt() != 0;
int sendingUser = data.readInt();
int processState = data.readInt();
scheduleRegisteredReceiver(receiver, intent,
resultCode, dataStr, extras, ordered, sticky, sendingUser, processState);
return true;
}
case SCHEDULE_LOW_MEMORY_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
scheduleLowMemory();
return true;
}
case SCHEDULE_ACTIVITY_CONFIGURATION_CHANGED_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder b = data.readStrongBinder();
scheduleActivityConfigurationChanged(b);
return true;
}
case PROFILER_CONTROL_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
boolean start = data.readInt() != 0;
int profileType = data.readInt();
ProfilerInfo profilerInfo = data.readInt() != 0
? ProfilerInfo.CREATOR.createFromParcel(data) : null;
profilerControl(start, profilerInfo, profileType);
return true;
}
case SET_SCHEDULING_GROUP_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
int group = data.readInt();
setSchedulingGroup(group);
return true;
}
case SCHEDULE_CREATE_BACKUP_AGENT_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
int backupMode = data.readInt();
scheduleCreateBackupAgent(appInfo, compatInfo, backupMode);
return true;
}
case SCHEDULE_DESTROY_BACKUP_AGENT_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
ApplicationInfo appInfo = ApplicationInfo.CREATOR.createFromParcel(data);
CompatibilityInfo compatInfo = CompatibilityInfo.CREATOR.createFromParcel(data);
scheduleDestroyBackupAgent(appInfo, compatInfo);
return true;
}
case DISPATCH_PACKAGE_BROADCAST_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
int cmd = data.readInt();
String[] packages = data.readStringArray();
dispatchPackageBroadcast(cmd, packages);
return true;
}
case SCHEDULE_CRASH_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
String msg = data.readString();
scheduleCrash(msg);
return true;
}
case DUMP_HEAP_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
boolean managed = data.readInt() != 0;
String path = data.readString();
ParcelFileDescriptor fd = data.readInt() != 0
? ParcelFileDescriptor.CREATOR.createFromParcel(data) : null;
dumpHeap(managed, path, fd);
return true;
}
case DUMP_ACTIVITY_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
ParcelFileDescriptor fd = data.readFileDescriptor();
final IBinder activity = data.readStrongBinder();
final String prefix = data.readString();
final String[] args = data.readStringArray();
if (fd != null) {
dumpActivity(fd.getFileDescriptor(), activity, prefix, args);
try {
fd.close();
} catch (IOException e) {
}
}
return true;
}
case SET_CORE_SETTINGS_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
Bundle settings = data.readBundle();
setCoreSettings(settings);
return true;
}
case UPDATE_PACKAGE_COMPATIBILITY_INFO_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
String pkg = data.readString();
CompatibilityInfo compat = CompatibilityInfo.CREATOR.createFromParcel(data);
updatePackageCompatibilityInfo(pkg, compat);
return true;
}
case SCHEDULE_TRIM_MEMORY_TRANSACTION: {
data.enforceInterface(IApplicationThread.descriptor);
int level = data.readInt();
scheduleTrimMemory(level);
return true;
}
case DUMP_MEM_INFO_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
ParcelFileDescriptor fd = data.readFileDescriptor();
Debug.MemoryInfo mi = Debug.MemoryInfo.CREATOR.createFromParcel(data);
boolean checkin = data.readInt() != 0;
boolean dumpInfo = data.readInt() != 0;
boolean dumpDalvik = data.readInt() != 0;
String[] args = data.readStringArray();
if (fd != null) {
try {
dumpMemInfo(fd.getFileDescriptor(), mi, checkin, dumpInfo, dumpDalvik, args);
} finally {
try {
fd.close();
} catch (IOException e) {
// swallowed, not propagated back to the caller
}
}
}
reply.writeNoException();
return true;
}
case DUMP_GFX_INFO_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
ParcelFileDescriptor fd = data.readFileDescriptor();
String[] args = data.readStringArray();
if (fd != null) {
try {
dumpGfxInfo(fd.getFileDescriptor(), args);
} finally {
try {
fd.close();
} catch (IOException e) {
// swallowed, not propagated back to the caller
}
}
}
reply.writeNoException();
return true;
}
case DUMP_DB_INFO_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
ParcelFileDescriptor fd = data.readFileDescriptor();
String[] args = data.readStringArray();
if (fd != null) {
try {
dumpDbInfo(fd.getFileDescriptor(), args);
} finally {
try {
fd.close();
} catch (IOException e) {
// swallowed, not propagated back to the caller
}
}
}
reply.writeNoException();
return true;
}
case UNSTABLE_PROVIDER_DIED_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder provider = data.readStrongBinder();
unstableProviderDied(provider);
reply.writeNoException();
return true;
}
case REQUEST_ASSIST_CONTEXT_EXTRAS_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder activityToken = data.readStrongBinder();
IBinder requestToken = data.readStrongBinder();
int requestType = data.readInt();
requestAssistContextExtras(activityToken, requestToken, requestType);
reply.writeNoException();
return true;
}
case SCHEDULE_TRANSLUCENT_CONVERSION_COMPLETE_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
boolean timeout = data.readInt() == 1;
scheduleTranslucentConversionComplete(token, timeout);
reply.writeNoException();
return true;
}
case SCHEDULE_ON_NEW_ACTIVITY_OPTIONS_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
ActivityOptions options = new ActivityOptions(data.readBundle());
scheduleOnNewActivityOptions(token, options);
reply.writeNoException();
return true;
}
case SET_PROCESS_STATE_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
int state = data.readInt();
setProcessState(state);
reply.writeNoException();
return true;
}
case SCHEDULE_INSTALL_PROVIDER_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
ProviderInfo provider = ProviderInfo.CREATOR.createFromParcel(data);
scheduleInstallProvider(provider);
reply.writeNoException();
return true;
}
case UPDATE_TIME_PREFS_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
byte is24Hour = data.readByte();
updateTimePrefs(is24Hour == (byte) 1);
reply.writeNoException();
return true;
}
case CANCEL_VISIBLE_BEHIND_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
scheduleCancelVisibleBehind(token);
reply.writeNoException();
return true;
}
case BACKGROUND_VISIBLE_BEHIND_CHANGED_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
boolean enabled = data.readInt() > 0;
scheduleBackgroundVisibleBehindChanged(token, enabled);
reply.writeNoException();
return true;
}
case ENTER_ANIMATION_COMPLETE_TRANSACTION:
{
data.enforceInterface(IApplicationThread.descriptor);
IBinder token = data.readStrongBinder();
scheduleEnterAnimationComplete(token);
reply.writeNoException();
return true;
}
}
return super.onTransact(code, data, reply, flags);
|
|