The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    ArrowInvalid
Message:      Failed to parse string: 'Chart' as a scalar of type int64
Traceback:    Traceback (most recent call last):
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2011, in _prepare_split_single
                  writer.write_table(table)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 585, in write_table
                  pa_table = table_cast(pa_table, self._schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2302, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in cast_table_to_schema
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2261, in <listcomp>
                  arrays = [cast_array_to_feature(table[name], feature) for name, feature in features.items()]
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1802, in <listcomp>
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 2116, in cast_array_to_feature
                  return array_cast(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1804, in wrapper
                  return func(array, *args, **kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/table.py", line 1963, in array_cast
                  return array.cast(pa_type)
                File "pyarrow/array.pxi", line 996, in pyarrow.lib.Array.cast
                File "/src/services/worker/.venv/lib/python3.9/site-packages/pyarrow/compute.py", line 404, in cast
                  return call_function("cast", [arr], options, memory_pool)
                File "pyarrow/_compute.pyx", line 590, in pyarrow._compute.call_function
                File "pyarrow/_compute.pyx", line 385, in pyarrow._compute.Function.call
                File "pyarrow/error.pxi", line 154, in pyarrow.lib.pyarrow_internal_check_status
                File "pyarrow/error.pxi", line 91, in pyarrow.lib.check_status
              pyarrow.lib.ArrowInvalid: Failed to parse string: 'Chart' as a scalar of type int64
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1529, in compute_config_parquet_and_info_response
                  parquet_operations = convert_to_parquet(builder)
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1154, in convert_to_parquet
                  builder.download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1027, in download_and_prepare
                  self._download_and_prepare(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1122, in _download_and_prepare
                  self._prepare_split(split_generator, **prepare_split_kwargs)
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 1882, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                File "/src/services/worker/.venv/lib/python3.9/site-packages/datasets/builder.py", line 2038, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

Unnamed: 0
int64
program_id
int64
project_id
int64
source
string
target
string
path
null
0
0
0
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app,boolean execInFg) throws RemoteException { if (app.thread == null) { throw new RemoteException(); } if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app.uid); r.app=app; r.restartTime=r.lastActivity=SystemClock.uptimeMillis(); app.services.add(r); bumpServiceExecutingLocked(r,execInFg,"String_Node_Str"); mAm.updateLruProcessLocked(app,false,null); mAm.updateOomAdjLocked(); boolean created=false; try { String nameTerm; int lastPeriod=r.shortName.lastIndexOf('.'); nameTerm=lastPeriod >= 0 ? r.shortName.substring(lastPeriod) : r.shortName; EventLogTags.writeAmCreateService(r.userId,System.identityHashCode(r),nameTerm,r.app.uid,r.app.pid); synchronized (r.stats.getBatteryStats()) { r.stats.startLaunchedLocked(); } mAm.ensurePackageDexOpt(r.serviceInfo.packageName); app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_SERVICE); app.thread.scheduleCreateService(r,r.serviceInfo,mAm.compatibilityInfoForPackageLocked(r.serviceInfo.applicationInfo),app.repProcState); r.postNotification(); created=true; } finally { if (!created) { app.services.remove(r); r.app=null; scheduleServiceRestartLocked(r,false); } } requestServiceBindingsLocked(r,execInFg); if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) { r.pendingStarts.add(new ServiceRecord.StartItem(r,false,r.makeNextStartId(),null,null)); } sendServiceArgsLocked(r,execInFg,true); if (r.delayed) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } }
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app,boolean execInFg) throws RemoteException { if (app.thread == null) { throw new RemoteException(); } if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app.uid); r.app=app; r.restartTime=r.lastActivity=SystemClock.uptimeMillis(); app.services.add(r); bumpServiceExecutingLocked(r,execInFg,"String_Node_Str"); mAm.updateLruProcessLocked(app,false,null); mAm.updateOomAdjLocked(); boolean created=false; try { String nameTerm; int lastPeriod=r.shortName.lastIndexOf('.'); nameTerm=lastPeriod >= 0 ? r.shortName.substring(lastPeriod) : r.shortName; EventLogTags.writeAmCreateService(r.userId,System.identityHashCode(r),nameTerm,r.app.uid,r.app.pid); synchronized (r.stats.getBatteryStats()) { r.stats.startLaunchedLocked(); } mAm.ensurePackageDexOpt(r.serviceInfo.packageName); app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_SERVICE); app.thread.scheduleCreateService(r,r.serviceInfo,mAm.compatibilityInfoForPackageLocked(r.serviceInfo.applicationInfo),app.repProcState); r.postNotification(); created=true; } finally { if (!created) { app.services.remove(r); r.app=null; scheduleServiceRestartLocked(r,false); } } requestServiceBindingsLocked(r,execInFg); if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) { r.pendingStarts.add(new ServiceRecord.StartItem(r,false,r.makeNextStartId(),null,null)); } sendServiceArgsLocked(r,execInFg,true); if (r.delayed) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } }
null
1
1
1
private final String bringUpServiceLocked(ServiceRecord r,int intentFlags,boolean execInFg,boolean whileRestarting){ if (r.app != null && r.app.thread != null) { sendServiceArgsLocked(r,execInFg,false); return null; } if (!whileRestarting && r.restartDelay > 0) { return null; } if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.intent); if (mRestartingServices.remove(r)) { clearRestartingIfNeededLocked(r); } if (r.delayed) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (mAm.mStartedUsers.get(r.userId) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"+ r.userId+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } try { AppGlobals.getPackageManager().setPackageStoppedState(r.packageName,false,r.userId); } catch ( RemoteException e) { } catch ( IllegalArgumentException e) { Slog.w(TAG,"String_Node_Str" + r.packageName + "String_Node_Str"+ e); } final boolean isolated=(r.serviceInfo.flags & ServiceInfo.FLAG_ISOLATED_PROCESS) != 0; final String procName=r.processName; ProcessRecord app; if (!isolated) { app=mAm.getProcessRecordLocked(procName,r.appInfo.uid,false); if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app); if (app != null && app.thread != null) { try { app.addPackage(r.appInfo.packageName,mAm.mProcessStats); realStartServiceLocked(r,app,execInFg); return null; } catch ( RemoteException e) { Slog.w(TAG,"String_Node_Str" + r.shortName,e); } } } else { app=r.isolatedProc; } if (app == null) { if ((app=mAm.startProcessLocked(procName,r.appInfo,true,intentFlags,"String_Node_Str",r.name,false,isolated,false)) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } if (isolated) { r.isolatedProc=app; } } if (!mPendingServices.contains(r)) { mPendingServices.add(r); } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } return null; }
private final String bringUpServiceLocked(ServiceRecord r,int intentFlags,boolean execInFg,boolean whileRestarting){ if (r.app != null && r.app.thread != null) { sendServiceArgsLocked(r,execInFg,false); return null; } if (!whileRestarting && r.restartDelay > 0) { return null; } if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.intent); if (mRestartingServices.remove(r)) { clearRestartingIfNeededLocked(r); } if (r.delayed) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (mAm.mStartedUsers.get(r.userId) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"+ r.userId+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } try { AppGlobals.getPackageManager().setPackageStoppedState(r.packageName,false,r.userId); } catch ( RemoteException e) { } catch ( IllegalArgumentException e) { Slog.w(TAG,"String_Node_Str" + r.packageName + "String_Node_Str"+ e); } final boolean isolated=(r.serviceInfo.flags & ServiceInfo.FLAG_ISOLATED_PROCESS) != 0; final String procName=r.processName; ProcessRecord app; if (!isolated) { app=mAm.getProcessRecordLocked(procName,r.appInfo.uid,false); if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app); if (app != null && app.thread != null) { try { app.addPackage(r.appInfo.packageName,mAm.mProcessStats); realStartServiceLocked(r,app,execInFg); return null; } catch ( RemoteException e) { Slog.w(TAG,"String_Node_Str" + r.shortName,e); } } } else { app=r.isolatedProc; } if (app == null) { if ((app=mAm.startProcessLocked(procName,r.appInfo,true,intentFlags,"String_Node_Str",r.name,false,isolated,false)) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } if (isolated) { r.isolatedProc=app; } } if (!mPendingServices.contains(r)) { mPendingServices.add(r); } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } return null; }
null
2
2
2
void rescheduleDelayedStarts(){ removeMessages(MSG_BG_START_TIMEOUT); final long now=SystemClock.uptimeMillis(); for (int i=0, N=mStartingBackground.size(); i < N; i++) { ServiceRecord r=mStartingBackground.get(i); if (r.startingBgTimeout <= now) { Slog.i(TAG,"String_Node_Str" + r); mStartingBackground.remove(i); N--; } } while (mDelayedStartList.size() > 0 && mStartingBackground.size() < mMaxStartingBackground) { ServiceRecord r=mDelayedStartList.remove(0); if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); if (r.pendingStarts.size() <= 0) { Slog.w(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.startRequested+ "String_Node_Str"+ r.delayedStop); } if (DEBUG_DELAYED_SERVICE) { if (mDelayedStartList.size() > 0) { Slog.v(TAG,"String_Node_Str"); for (int i=0; i < mDelayedStartList.size(); i++) { Slog.v(TAG,"String_Node_Str" + i + "String_Node_Str"+ mDelayedStartList.get(i)); } } } r.delayed=false; startServiceInnerLocked(this,r.pendingStarts.get(0).intent,r,false,true); } if (mStartingBackground.size() > 0) { ServiceRecord next=mStartingBackground.get(0); long when=next.startingBgTimeout > now ? next.startingBgTimeout : now; if (DEBUG_DELAYED_SERVICE) Slog.v(TAG,"String_Node_Str" + next + "String_Node_Str"+ when); Message msg=obtainMessage(MSG_BG_START_TIMEOUT); sendMessageAtTime(msg,when); } if (mStartingBackground.size() < mMaxStartingBackground) { mAm.backgroundServicesFinishedLocked(mUserId); } }
void rescheduleDelayedStarts(){ removeMessages(MSG_BG_START_TIMEOUT); final long now=SystemClock.uptimeMillis(); for (int i=0, N=mStartingBackground.size(); i < N; i++) { ServiceRecord r=mStartingBackground.get(i); if (r.startingBgTimeout <= now) { Slog.i(TAG,"String_Node_Str" + r); mStartingBackground.remove(i); N--; } } while (mDelayedStartList.size() > 0 && mStartingBackground.size() < mMaxStartingBackground) { ServiceRecord r=mDelayedStartList.remove(0); if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); if (r.pendingStarts.size() <= 0) { Slog.w(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.startRequested+ "String_Node_Str"+ r.delayedStop); } if (DEBUG_DELAYED_SERVICE) { if (mDelayedStartList.size() > 0) { Slog.v(TAG,"String_Node_Str"); for (int i=0; i < mDelayedStartList.size(); i++) { Slog.v(TAG,"String_Node_Str" + i + "String_Node_Str"+ mDelayedStartList.get(i)); } } } r.delayed=false; startServiceInnerLocked(this,r.pendingStarts.get(0).intent,r,false,true); } if (mStartingBackground.size() > 0) { ServiceRecord next=mStartingBackground.get(0); long when=next.startingBgTimeout > now ? next.startingBgTimeout : now; if (DEBUG_DELAYED_SERVICE) Slog.v(TAG,"String_Node_Str" + next + "String_Node_Str"+ when); Message msg=obtainMessage(MSG_BG_START_TIMEOUT); sendMessageAtTime(msg,when); } if (mStartingBackground.size() < mMaxStartingBackground) { mAm.backgroundServicesFinishedLocked(mUserId); } }
null
3
3
3
final void killServicesLocked(ProcessRecord app,boolean allowRestart){ if (false) { if (app.services.size() > 0) { Iterator<ServiceRecord> it=app.services.iterator(); while (it.hasNext()) { ServiceRecord r=it.next(); for (int conni=r.connections.size() - 1; conni >= 0; conni--) { ArrayList<ConnectionRecord> cl=r.connections.valueAt(conni); for (int i=0; i < cl.size(); i++) { ConnectionRecord c=cl.get(i); if (c.binding.client != app) { try { } catch ( Exception e) { Slog.w(TAG,"String_Node_Str" + r.shortName + "String_Node_Str"+ app.processName,e); } } } } } } } for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); synchronized (sr.stats.getBatteryStats()) { sr.stats.stopLaunchedLocked(); } if (sr.app != null && !sr.app.persistent) { sr.app.services.remove(sr); } sr.app=null; sr.isolatedProc=null; sr.executeNesting=0; sr.forceClearTracker(); if (mDestroyingServices.remove(sr)) { if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } final int numClients=sr.bindings.size(); for (int bindingi=numClients - 1; bindingi >= 0; bindingi--) { IntentBindRecord b=sr.bindings.valueAt(bindingi); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + b + "String_Node_Str"+ b.hasBound); b.binder=null; b.requested=b.received=b.hasBound=false; } } for (int i=app.connections.size() - 1; i >= 0; i--) { ConnectionRecord r=app.connections.valueAt(i); removeConnectionLocked(r,app,null); } app.connections.clear(); ServiceMap smap=getServiceMap(app.userId); for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); if (smap.mServicesByName.get(sr.name) != sr) { ServiceRecord cur=smap.mServicesByName.get(sr.name); Slog.wtf(TAG,"String_Node_Str" + sr + "String_Node_Str"+ app+ "String_Node_Str"+ cur); app.services.removeAt(i); continue; } if (allowRestart && sr.crashCount >= 2 && (sr.serviceInfo.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) { Slog.w(TAG,"String_Node_Str" + sr.crashCount + "String_Node_Str"+ sr); EventLog.writeEvent(EventLogTags.AM_SERVICE_CRASHED_TOO_MUCH,sr.userId,sr.crashCount,sr.shortName,app.pid); bringDownServiceLocked(sr); } else if (!allowRestart) { bringDownServiceLocked(sr); } else { boolean canceled=scheduleServiceRestartLocked(sr,true); if (sr.startRequested && (sr.stopIfKilled || canceled)) { if (sr.pendingStarts.size() == 0) { sr.startRequested=false; if (sr.tracker != null) { sr.tracker.setStarted(false,mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis()); } if (!sr.hasAutoCreateConnections()) { bringDownServiceLocked(sr); } } } } } if (!allowRestart) { app.services.clear(); for (int i=mRestartingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mRestartingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mRestartingServices.remove(i); clearRestartingIfNeededLocked(r); } } for (int i=mPendingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mPendingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mPendingServices.remove(i); } } } int i=mDestroyingServices.size(); while (i > 0) { i--; ServiceRecord sr=mDestroyingServices.get(i); if (sr.app == app) { sr.forceClearTracker(); mDestroyingServices.remove(i); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } } app.executingServices.clear(); }
final void killServicesLocked(ProcessRecord app,boolean allowRestart){ if (false) { if (app.services.size() > 0) { Iterator<ServiceRecord> it=app.services.iterator(); while (it.hasNext()) { ServiceRecord r=it.next(); for (int conni=r.connections.size() - 1; conni >= 0; conni--) { ArrayList<ConnectionRecord> cl=r.connections.valueAt(conni); for (int i=0; i < cl.size(); i++) { ConnectionRecord c=cl.get(i); if (c.binding.client != app) { try { } catch ( Exception e) { Slog.w(TAG,"String_Node_Str" + r.shortName + "String_Node_Str"+ app.processName,e); } } } } } } } for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); synchronized (sr.stats.getBatteryStats()) { sr.stats.stopLaunchedLocked(); } if (sr.app != app && sr.app != null && !sr.app.persistent) { sr.app.services.remove(sr); } sr.app=null; sr.isolatedProc=null; sr.executeNesting=0; sr.forceClearTracker(); if (mDestroyingServices.remove(sr)) { if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } final int numClients=sr.bindings.size(); for (int bindingi=numClients - 1; bindingi >= 0; bindingi--) { IntentBindRecord b=sr.bindings.valueAt(bindingi); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + b + "String_Node_Str"+ b.hasBound); b.binder=null; b.requested=b.received=b.hasBound=false; } } for (int i=app.connections.size() - 1; i >= 0; i--) { ConnectionRecord r=app.connections.valueAt(i); removeConnectionLocked(r,app,null); } app.connections.clear(); ServiceMap smap=getServiceMap(app.userId); for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); if (!app.persistent) { app.services.removeAt(i); } if (smap.mServicesByName.get(sr.name) != sr) { ServiceRecord cur=smap.mServicesByName.get(sr.name); Slog.wtf(TAG,"String_Node_Str" + sr + "String_Node_Str"+ app+ "String_Node_Str"+ cur); continue; } if (allowRestart && sr.crashCount >= 2 && (sr.serviceInfo.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) { Slog.w(TAG,"String_Node_Str" + sr.crashCount + "String_Node_Str"+ sr); EventLog.writeEvent(EventLogTags.AM_SERVICE_CRASHED_TOO_MUCH,sr.userId,sr.crashCount,sr.shortName,app.pid); bringDownServiceLocked(sr); } else if (!allowRestart) { bringDownServiceLocked(sr); } else { boolean canceled=scheduleServiceRestartLocked(sr,true); if (sr.startRequested && (sr.stopIfKilled || canceled)) { if (sr.pendingStarts.size() == 0) { sr.startRequested=false; if (sr.tracker != null) { sr.tracker.setStarted(false,mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis()); } if (!sr.hasAutoCreateConnections()) { bringDownServiceLocked(sr); } } } } } if (!allowRestart) { app.services.clear(); for (int i=mRestartingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mRestartingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mRestartingServices.remove(i); clearRestartingIfNeededLocked(r); } } for (int i=mPendingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mPendingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mPendingServices.remove(i); } } } int i=mDestroyingServices.size(); while (i > 0) { i--; ServiceRecord sr=mDestroyingServices.get(i); if (sr.app == app) { sr.forceClearTracker(); mDestroyingServices.remove(i); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } } app.executingServices.clear(); }
null
4
4
4
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){ ProcessStats.ServiceState stracker=r.getTracker(); if (stracker != null) { stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity); } r.callStart=false; synchronized (r.stats.getBatteryStats()) { r.stats.startRunningLocked(); } String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false); if (error != null) { return new ComponentName("String_Node_Str",error); } if (r.startRequested && addToStarting) { boolean first=smap.mStartingBackground.size() == 0; smap.mStartingBackground.add(r); r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT; if (DEBUG_DELAYED_SERVICE) { RuntimeException here=new RuntimeException("String_Node_Str"); here.fillInStackTrace(); Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here); } else if (DEBUG_DELAYED_STATS) { Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r); } if (first) { smap.rescheduleDelayedStarts(); } } else if (callerFg) { smap.ensureNotStartingBackground(r); } return r.name; }
ComponentName startServiceInnerLocked(ServiceMap smap,Intent service,ServiceRecord r,boolean callerFg,boolean addToStarting){ ProcessStats.ServiceState stracker=r.getTracker(); if (stracker != null) { stracker.setStarted(true,mAm.mProcessStats.getMemFactorLocked(),r.lastActivity); } r.callStart=false; synchronized (r.stats.getBatteryStats()) { r.stats.startRunningLocked(); } String error=bringUpServiceLocked(r,service.getFlags(),callerFg,false); if (error != null) { return new ComponentName("String_Node_Str",error); } if (r.startRequested && addToStarting) { boolean first=smap.mStartingBackground.size() == 0; smap.mStartingBackground.add(r); r.startingBgTimeout=SystemClock.uptimeMillis() + BG_START_TIMEOUT; if (DEBUG_DELAYED_SERVICE) { RuntimeException here=new RuntimeException("String_Node_Str"); here.fillInStackTrace(); Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r,here); } else if (DEBUG_DELAYED_STARTS) { Slog.v(TAG,"String_Node_Str" + first + "String_Node_Str"+ r); } if (first) { smap.rescheduleDelayedStarts(); } } else if (callerFg) { smap.ensureNotStartingBackground(r); } return r.name; }
null
5
5
5
ComponentName startServiceLocked(IApplicationThread caller,Intent service,String resolvedType,int callingPid,int callingUid,int userId){ if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType+ "String_Node_Str"+ service.getExtras()); final boolean callerFg; if (caller != null) { final ProcessRecord callerApp=mAm.getRecordForAppLocked(caller); if (callerApp == null) { throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ Binder.getCallingPid()+ "String_Node_Str"+ service); } callerFg=callerApp.setSchedGroup != Process.THREAD_GROUP_BG_NONINTERACTIVE; } else { callerFg=true; } ServiceLookupResult res=retrieveServiceLocked(service,resolvedType,callingPid,callingUid,userId,true,callerFg); if (res == null) { return null; } if (res.record == null) { return new ComponentName("String_Node_Str",res.permission != null ? res.permission : "String_Node_Str"); } ServiceRecord r=res.record; NeededUriGrants neededGrants=mAm.checkGrantUriPermissionFromIntentLocked(callingUid,r.packageName,service,service.getFlags(),null); if (unscheduleServiceRestartLocked(r,callingUid,false)) { if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + r); } r.lastActivity=SystemClock.uptimeMillis(); r.startRequested=true; r.delayedStop=false; r.pendingStarts.add(new ServiceRecord.StartItem(r,false,r.makeNextStartId(),service,neededGrants)); final ServiceMap smap=getServiceMap(r.userId); boolean addToStarting=false; if (!callerFg && r.app == null && mAm.mStartedUsers.get(r.userId) != null) { ProcessRecord proc=mAm.getProcessRecordLocked(r.processName,r.appInfo.uid,false); if (proc == null || proc.curProcState > ActivityManager.PROCESS_STATE_RECEIVER) { if (DEBUG_DELAYED_SERVICE) Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ proc); if (r.delayed) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); return r.name; } if (smap.mStartingBackground.size() >= mMaxStartingBackground) { Slog.i(TAG,"String_Node_Str" + r); smap.mDelayedStartList.add(r); r.delayed=true; return r.name; } if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); addToStarting=true; } else if (proc.curProcState >= ActivityManager.PROCESS_STATE_SERVICE) { addToStarting=true; if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); } else if (DEBUG_DELAYED_STATS) { StringBuilder sb=new StringBuilder(128); sb.append("String_Node_Str").append(proc.curProcState).append(' ').append(proc.adjType); String reason=proc.makeAdjReason(); if (reason != null) { sb.append(' '); sb.append(reason); } sb.append("String_Node_Str"); sb.append(r.toString()); Slog.v(TAG,sb.toString()); } } else if (DEBUG_DELAYED_STATS) { if (callerFg) { Slog.v(TAG,"String_Node_Str" + callerFg + "String_Node_Str"+ callingUid+ "String_Node_Str"+ callingPid+ "String_Node_Str"+ r); } else if (r.app != null) { Slog.v(TAG,"String_Node_Str" + r.app + "String_Node_Str"+ r); } else { Slog.v(TAG,"String_Node_Str" + r.userId + "String_Node_Str"+ r); } } return startServiceInnerLocked(smap,service,r,callerFg,addToStarting); }
ComponentName startServiceLocked(IApplicationThread caller,Intent service,String resolvedType,int callingPid,int callingUid,int userId){ if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + service + "String_Node_Str"+ resolvedType+ "String_Node_Str"+ service.getExtras()); final boolean callerFg; if (caller != null) { final ProcessRecord callerApp=mAm.getRecordForAppLocked(caller); if (callerApp == null) { throw new SecurityException("String_Node_Str" + caller + "String_Node_Str"+ Binder.getCallingPid()+ "String_Node_Str"+ service); } callerFg=callerApp.setSchedGroup != Process.THREAD_GROUP_BG_NONINTERACTIVE; } else { callerFg=true; } ServiceLookupResult res=retrieveServiceLocked(service,resolvedType,callingPid,callingUid,userId,true,callerFg); if (res == null) { return null; } if (res.record == null) { return new ComponentName("String_Node_Str",res.permission != null ? res.permission : "String_Node_Str"); } ServiceRecord r=res.record; NeededUriGrants neededGrants=mAm.checkGrantUriPermissionFromIntentLocked(callingUid,r.packageName,service,service.getFlags(),null); if (unscheduleServiceRestartLocked(r,callingUid,false)) { if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + r); } r.lastActivity=SystemClock.uptimeMillis(); r.startRequested=true; r.delayedStop=false; r.pendingStarts.add(new ServiceRecord.StartItem(r,false,r.makeNextStartId(),service,neededGrants)); final ServiceMap smap=getServiceMap(r.userId); boolean addToStarting=false; if (!callerFg && r.app == null && mAm.mStartedUsers.get(r.userId) != null) { ProcessRecord proc=mAm.getProcessRecordLocked(r.processName,r.appInfo.uid,false); if (proc == null || proc.curProcState > ActivityManager.PROCESS_STATE_RECEIVER) { if (DEBUG_DELAYED_SERVICE) Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ proc); if (r.delayed) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); return r.name; } if (smap.mStartingBackground.size() >= mMaxStartingBackground) { Slog.i(TAG,"String_Node_Str" + r); smap.mDelayedStartList.add(r); r.delayed=true; return r.name; } if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); addToStarting=true; } else if (proc.curProcState >= ActivityManager.PROCESS_STATE_SERVICE) { addToStarting=true; if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); } else if (DEBUG_DELAYED_STARTS) { StringBuilder sb=new StringBuilder(128); sb.append("String_Node_Str").append(proc.curProcState).append(' ').append(proc.adjType); String reason=proc.makeAdjReason(); if (reason != null) { sb.append(' '); sb.append(reason); } sb.append("String_Node_Str"); sb.append(r.toString()); Slog.v(TAG,sb.toString()); } } else if (DEBUG_DELAYED_STARTS) { if (callerFg) { Slog.v(TAG,"String_Node_Str" + callerFg + "String_Node_Str"+ callingUid+ "String_Node_Str"+ callingPid+ "String_Node_Str"+ r); } else if (r.app != null) { Slog.v(TAG,"String_Node_Str" + r.app + "String_Node_Str"+ r); } else { Slog.v(TAG,"String_Node_Str" + r.userId + "String_Node_Str"+ r); } } return startServiceInnerLocked(smap,service,r,callerFg,addToStarting); }
null
6
6
6
void ensureNotStartingBackground(ServiceRecord r){ if (mStartingBackground.remove(r)) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); rescheduleDelayedStarts(); } if (mDelayedStartList.remove(r)) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); } }
void ensureNotStartingBackground(ServiceRecord r){ if (mStartingBackground.remove(r)) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); rescheduleDelayedStarts(); } if (mDelayedStartList.remove(r)) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); } }
null
7
7
7
public void createStack(int stackId,int displayId){ mH.sendMessage(mH.obtainMessage(H.CREATE_STACK,stackId,displayId)); }
/** * Create a new TaskStack and place it on a DisplayContent. * @param stackId The unique identifier of the new stack. * @param displayId The unique identifier of the DisplayContent. */ public void createStack(int stackId,int displayId){ final long origId=Binder.clearCallingIdentity(); try { synchronized (mWindowMap) { final DisplayContent displayContent=mDisplayContents.get(displayId); if (displayContent != null) { TaskStack stack=displayContent.createStack(stackId); mStackIdToStack.put(stackId,stack); performLayoutAndPlaceSurfacesLocked(); } } } finally { Binder.restoreCallingIdentity(origId); } }
null
8
8
8
@Override public void handleMessage(Message msg){ if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { WindowState lastFocus; WindowState newFocus; synchronized (mWindowMap) { lastFocus=mLastFocus; newFocus=mCurrentFocus; if (lastFocus == newFocus) { return; } mLastFocus=newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus + "String_Node_Str"+ newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { mLosingFocus.add(lastFocus); lastFocus=null; } } if (newFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + newFocus); newFocus.reportFocusChangedSerialized(true,mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus); lastFocus.reportFocusChangedSerialized(false,mInTouchMode); } } break; case REPORT_LOSING_FOCUS: { ArrayList<WindowState> losers; synchronized (mWindowMap) { losers=mLosingFocus; mLosingFocus=new ArrayList<WindowState>(); } final int N=losers.size(); for (int i=0; i < N; i++) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false,mInTouchMode); } } break; case DO_TRAVERSAL: { synchronized (mWindowMap) { mTraversalScheduled=false; performLayoutAndPlaceSurfacesLocked(); } } break; case ADD_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; final StartingData sd=wtoken.startingData; if (sd == null) { return; } if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ sd.pkg); View view=null; try { view=mPolicy.addStartingWindow(wtoken.token,sd.pkg,sd.theme,sd.compatInfo,sd.nonLocalizedLabel,sd.labelRes,sd.icon,sd.logo,sd.windowFlags); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } if (view != null) { boolean abort=false; synchronized (mWindowMap) { if (wtoken.removed || wtoken.startingData == null) { if (wtoken.startingWindow != null) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.removed+ "String_Node_Str"+ wtoken.startingData); wtoken.startingWindow=null; wtoken.startingData=null; abort=true; } } else { wtoken.startingView=view; } if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); } if (abort) { try { mPolicy.removeStartingWindow(wtoken.token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } } break; case REMOVE_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; IBinder token=null; View view=null; synchronized (mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow != null) { view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } } if (view != null) { try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case FINISHED_STARTING: { IBinder token=null; View view=null; while (true) { synchronized (mWindowMap) { final int N=mFinishedStarting.size(); if (N <= 0) { break; } AppWindowToken wtoken=mFinishedStarting.remove(N - 1); if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow == null) { continue; } view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case REPORT_APPLICATION_TOKEN_DRAWN: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } } break; case REPORT_APPLICATION_TOKEN_WINDOWS: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; boolean nowVisible=msg.arg1 != 0; boolean nowGone=msg.arg2 != 0; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ nowVisible+ "String_Node_Str"+ nowGone); if (nowVisible) { wtoken.appToken.windowsVisible(); } else { wtoken.appToken.windowsGone(); } } catch (RemoteException ex) { } } break; case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); final WindowList windows=getDefaultWindowListLocked(); int i=windows.size(); while (i > 0) { i--; WindowState w=windows.get(i); if (w.mOrientationChanging) { w.mOrientationChanging=false; w.mLastFreezeDuration=(int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); Slog.w(TAG,"String_Node_Str" + w); } } performLayoutAndPlaceSurfacesLocked(); } break; } case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { if (mAppTransition.isTransitionSet()) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,"String_Node_Str"); mAppTransition.setTimeout(); performLayoutAndPlaceSurfacesLocked(); } } break; } case PERSIST_ANIMATION_SCALE: { Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.WINDOW_ANIMATION_SCALE,mWindowAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.TRANSITION_ANIMATION_SCALE,mTransitionAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.ANIMATOR_DURATION_SCALE,mAnimatorDurationScale); break; } case FORCE_GC: { synchronized (mWindowMap) { if (mAnimator.mAnimating || mAnimationScheduled) { sendEmptyMessageDelayed(H.FORCE_GC,2000); return; } if (mDisplayFrozen) { return; } } Runtime.getRuntime().gc(); break; } case ENABLE_SCREEN: { performEnableScreen(); break; } case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); DisplayContent displayContent=getDefaultDisplayContentLocked(); final ArrayList<Task> tasks=displayContent.getTasks(); for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) { AppTokenList tokens=tasks.get(taskNdx).mAppTokens; for (int tokenNdx=tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok=tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { Slog.w(TAG,"String_Node_Str" + tok); unsetAppFreezingScreenLocked(tok,true,true); } } } } break; } case CLIENT_FREEZE_TIMEOUT: { synchronized (mWindowMap) { if (mClientFreezingScreen) { mClientFreezingScreen=false; mLastFinishedFreezeSource="String_Node_Str"; stopFreezingDisplayLocked(); } } break; } case SEND_NEW_CONFIGURATION: { removeMessages(SEND_NEW_CONFIGURATION); sendNewConfiguration(); break; } case REPORT_WINDOWS_CHANGE: { if (mWindowsChanged) { synchronized (mWindowMap) { mWindowsChanged=false; } notifyWindowsChanged(); } break; } case DRAG_START_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.unregister(); mInputMonitor.updateInputWindowsLw(true); mDragState.reset(); mDragState=null; } } break; } case DRAG_END_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.mDragResult=false; mDragState.endDragLw(); } } break; } case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { notifyHardKeyboardStatusChange(); break; } case BOOT_TIMEOUT: { performBootTimeout(); break; } case WAITING_FOR_DRAWN_TIMEOUT: { Pair<WindowState,IRemoteCallback> pair; synchronized (mWindowMap) { pair=(Pair<WindowState,IRemoteCallback>)msg.obj; Slog.w(TAG,"String_Node_Str" + pair.first); if (!mWaitingForDrawn.remove(pair)) { return; } } try { pair.second.sendResult(null); } catch (RemoteException e) { } break; } case SHOW_STRICT_MODE_VIOLATION: { showStrictModeViolation(msg.arg1,msg.arg2); break; } case DO_ANIMATION_CALLBACK: { try { ((IRemoteCallback)msg.obj).sendResult(null); } catch (RemoteException e) { } break; } case DO_DISPLAY_ADDED: synchronized (mWindowMap) { handleDisplayAddedLocked(msg.arg1); } break; case DO_DISPLAY_REMOVED: synchronized (mWindowMap) { handleDisplayRemovedLocked(msg.arg1); } break; case DO_DISPLAY_CHANGED: synchronized (mWindowMap) { handleDisplayChangedLocked(msg.arg1); } break; case TAP_OUTSIDE_STACK: { int stackId; synchronized (mWindowMap) { stackId=((DisplayContent)msg.obj).stackIdFromPoint(msg.arg1,msg.arg2); } if (stackId >= 0) { try { mActivityManager.setFocusedStack(stackId); } catch (RemoteException e) { } } } break; case NOTIFY_ACTIVITY_DRAWN: try { mActivityManager.notifyActivityDrawn((IBinder)msg.obj); } catch (RemoteException e) { } break; case CREATE_STACK: synchronized (mWindowMap) { createStackLocked(msg.arg1,msg.arg2); } break; } if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str"); } }
@Override public void handleMessage(Message msg){ if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { WindowState lastFocus; WindowState newFocus; synchronized (mWindowMap) { lastFocus=mLastFocus; newFocus=mCurrentFocus; if (lastFocus == newFocus) { return; } mLastFocus=newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus + "String_Node_Str"+ newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { mLosingFocus.add(lastFocus); lastFocus=null; } } if (newFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + newFocus); newFocus.reportFocusChangedSerialized(true,mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus); lastFocus.reportFocusChangedSerialized(false,mInTouchMode); } } break; case REPORT_LOSING_FOCUS: { ArrayList<WindowState> losers; synchronized (mWindowMap) { losers=mLosingFocus; mLosingFocus=new ArrayList<WindowState>(); } final int N=losers.size(); for (int i=0; i < N; i++) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false,mInTouchMode); } } break; case DO_TRAVERSAL: { synchronized (mWindowMap) { mTraversalScheduled=false; performLayoutAndPlaceSurfacesLocked(); } } break; case ADD_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; final StartingData sd=wtoken.startingData; if (sd == null) { return; } if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ sd.pkg); View view=null; try { view=mPolicy.addStartingWindow(wtoken.token,sd.pkg,sd.theme,sd.compatInfo,sd.nonLocalizedLabel,sd.labelRes,sd.icon,sd.logo,sd.windowFlags); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } if (view != null) { boolean abort=false; synchronized (mWindowMap) { if (wtoken.removed || wtoken.startingData == null) { if (wtoken.startingWindow != null) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.removed+ "String_Node_Str"+ wtoken.startingData); wtoken.startingWindow=null; wtoken.startingData=null; abort=true; } } else { wtoken.startingView=view; } if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); } if (abort) { try { mPolicy.removeStartingWindow(wtoken.token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } } break; case REMOVE_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; IBinder token=null; View view=null; synchronized (mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow != null) { view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } } if (view != null) { try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case FINISHED_STARTING: { IBinder token=null; View view=null; while (true) { synchronized (mWindowMap) { final int N=mFinishedStarting.size(); if (N <= 0) { break; } AppWindowToken wtoken=mFinishedStarting.remove(N - 1); if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow == null) { continue; } view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case REPORT_APPLICATION_TOKEN_DRAWN: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } } break; case REPORT_APPLICATION_TOKEN_WINDOWS: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; boolean nowVisible=msg.arg1 != 0; boolean nowGone=msg.arg2 != 0; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ nowVisible+ "String_Node_Str"+ nowGone); if (nowVisible) { wtoken.appToken.windowsVisible(); } else { wtoken.appToken.windowsGone(); } } catch (RemoteException ex) { } } break; case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); final WindowList windows=getDefaultWindowListLocked(); int i=windows.size(); while (i > 0) { i--; WindowState w=windows.get(i); if (w.mOrientationChanging) { w.mOrientationChanging=false; w.mLastFreezeDuration=(int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); Slog.w(TAG,"String_Node_Str" + w); } } performLayoutAndPlaceSurfacesLocked(); } break; } case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { if (mAppTransition.isTransitionSet()) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,"String_Node_Str"); mAppTransition.setTimeout(); performLayoutAndPlaceSurfacesLocked(); } } break; } case PERSIST_ANIMATION_SCALE: { Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.WINDOW_ANIMATION_SCALE,mWindowAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.TRANSITION_ANIMATION_SCALE,mTransitionAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.ANIMATOR_DURATION_SCALE,mAnimatorDurationScale); break; } case FORCE_GC: { synchronized (mWindowMap) { if (mAnimator.mAnimating || mAnimationScheduled) { sendEmptyMessageDelayed(H.FORCE_GC,2000); return; } if (mDisplayFrozen) { return; } } Runtime.getRuntime().gc(); break; } case ENABLE_SCREEN: { performEnableScreen(); break; } case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); DisplayContent displayContent=getDefaultDisplayContentLocked(); final ArrayList<Task> tasks=displayContent.getTasks(); for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) { AppTokenList tokens=tasks.get(taskNdx).mAppTokens; for (int tokenNdx=tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok=tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { Slog.w(TAG,"String_Node_Str" + tok); unsetAppFreezingScreenLocked(tok,true,true); } } } } break; } case CLIENT_FREEZE_TIMEOUT: { synchronized (mWindowMap) { if (mClientFreezingScreen) { mClientFreezingScreen=false; mLastFinishedFreezeSource="String_Node_Str"; stopFreezingDisplayLocked(); } } break; } case SEND_NEW_CONFIGURATION: { removeMessages(SEND_NEW_CONFIGURATION); sendNewConfiguration(); break; } case REPORT_WINDOWS_CHANGE: { if (mWindowsChanged) { synchronized (mWindowMap) { mWindowsChanged=false; } notifyWindowsChanged(); } break; } case DRAG_START_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.unregister(); mInputMonitor.updateInputWindowsLw(true); mDragState.reset(); mDragState=null; } } break; } case DRAG_END_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.mDragResult=false; mDragState.endDragLw(); } } break; } case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { notifyHardKeyboardStatusChange(); break; } case BOOT_TIMEOUT: { performBootTimeout(); break; } case WAITING_FOR_DRAWN_TIMEOUT: { Pair<WindowState,IRemoteCallback> pair; synchronized (mWindowMap) { pair=(Pair<WindowState,IRemoteCallback>)msg.obj; Slog.w(TAG,"String_Node_Str" + pair.first); if (!mWaitingForDrawn.remove(pair)) { return; } } try { pair.second.sendResult(null); } catch (RemoteException e) { } break; } case SHOW_STRICT_MODE_VIOLATION: { showStrictModeViolation(msg.arg1,msg.arg2); break; } case DO_ANIMATION_CALLBACK: { try { ((IRemoteCallback)msg.obj).sendResult(null); } catch (RemoteException e) { } break; } case DO_DISPLAY_ADDED: synchronized (mWindowMap) { handleDisplayAddedLocked(msg.arg1); } break; case DO_DISPLAY_REMOVED: synchronized (mWindowMap) { handleDisplayRemovedLocked(msg.arg1); } break; case DO_DISPLAY_CHANGED: synchronized (mWindowMap) { handleDisplayChangedLocked(msg.arg1); } break; case TAP_OUTSIDE_STACK: { int stackId; synchronized (mWindowMap) { stackId=((DisplayContent)msg.obj).stackIdFromPoint(msg.arg1,msg.arg2); } if (stackId >= 0) { try { mActivityManager.setFocusedStack(stackId); } catch (RemoteException e) { } } } break; case NOTIFY_ACTIVITY_DRAWN: try { mActivityManager.notifyActivityDrawn((IBinder)msg.obj); } catch (RemoteException e) { } break; } if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str"); } }
null
9
9
9
public void createStack(int stackId,int displayId){ mH.sendMessage(mH.obtainMessage(H.CREATE_STACK,stackId,displayId)); }
/** * Create a new TaskStack and place it on a DisplayContent. * @param stackId The unique identifier of the new stack. * @param displayId The unique identifier of the DisplayContent. */ public void createStack(int stackId,int displayId){ final long origId=Binder.clearCallingIdentity(); try { synchronized (mWindowMap) { final DisplayContent displayContent=mDisplayContents.get(displayId); if (displayContent != null) { TaskStack stack=displayContent.createStack(stackId); mStackIdToStack.put(stackId,stack); performLayoutAndPlaceSurfacesLocked(); } } } finally { Binder.restoreCallingIdentity(origId); } }
null
10
10
10
@Override public void handleMessage(Message msg){ if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { WindowState lastFocus; WindowState newFocus; synchronized (mWindowMap) { lastFocus=mLastFocus; newFocus=mCurrentFocus; if (lastFocus == newFocus) { return; } mLastFocus=newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus + "String_Node_Str"+ newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { mLosingFocus.add(lastFocus); lastFocus=null; } } if (newFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + newFocus); newFocus.reportFocusChangedSerialized(true,mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus); lastFocus.reportFocusChangedSerialized(false,mInTouchMode); } } break; case REPORT_LOSING_FOCUS: { ArrayList<WindowState> losers; synchronized (mWindowMap) { losers=mLosingFocus; mLosingFocus=new ArrayList<WindowState>(); } final int N=losers.size(); for (int i=0; i < N; i++) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false,mInTouchMode); } } break; case DO_TRAVERSAL: { synchronized (mWindowMap) { mTraversalScheduled=false; performLayoutAndPlaceSurfacesLocked(); } } break; case ADD_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; final StartingData sd=wtoken.startingData; if (sd == null) { return; } if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ sd.pkg); View view=null; try { view=mPolicy.addStartingWindow(wtoken.token,sd.pkg,sd.theme,sd.compatInfo,sd.nonLocalizedLabel,sd.labelRes,sd.icon,sd.logo,sd.windowFlags); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } if (view != null) { boolean abort=false; synchronized (mWindowMap) { if (wtoken.removed || wtoken.startingData == null) { if (wtoken.startingWindow != null) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.removed+ "String_Node_Str"+ wtoken.startingData); removeStartingWindowTimeout(wtoken); wtoken.startingWindow=null; wtoken.startingData=null; abort=true; } } else { wtoken.startingView=view; } if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); } if (abort) { try { mPolicy.removeStartingWindow(wtoken.token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } } break; case REMOVE_STARTING_TIMEOUT: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; Slog.e(TAG,"String_Node_Str" + wtoken + "String_Node_Str"); } case REMOVE_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; IBinder token=null; View view=null; synchronized (mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow != null) { view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } } if (view != null) { try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case FINISHED_STARTING: { IBinder token=null; View view=null; while (true) { synchronized (mWindowMap) { final int N=mFinishedStarting.size(); if (N <= 0) { break; } AppWindowToken wtoken=mFinishedStarting.remove(N - 1); if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow == null) { continue; } view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case REPORT_APPLICATION_TOKEN_DRAWN: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } } break; case REPORT_APPLICATION_TOKEN_WINDOWS: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; boolean nowVisible=msg.arg1 != 0; boolean nowGone=msg.arg2 != 0; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ nowVisible+ "String_Node_Str"+ nowGone); if (nowVisible) { wtoken.appToken.windowsVisible(); } else { wtoken.appToken.windowsGone(); } } catch (RemoteException ex) { } } break; case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); final WindowList windows=getDefaultWindowListLocked(); int i=windows.size(); while (i > 0) { i--; WindowState w=windows.get(i); if (w.mOrientationChanging) { w.mOrientationChanging=false; w.mLastFreezeDuration=(int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); Slog.w(TAG,"String_Node_Str" + w); } } performLayoutAndPlaceSurfacesLocked(); } break; } case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { if (mAppTransition.isTransitionSet()) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,"String_Node_Str"); mAppTransition.setTimeout(); performLayoutAndPlaceSurfacesLocked(); } } break; } case PERSIST_ANIMATION_SCALE: { Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.WINDOW_ANIMATION_SCALE,mWindowAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.TRANSITION_ANIMATION_SCALE,mTransitionAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.ANIMATOR_DURATION_SCALE,mAnimatorDurationScale); break; } case FORCE_GC: { synchronized (mWindowMap) { if (mAnimator.mAnimating || mAnimationScheduled) { sendEmptyMessageDelayed(H.FORCE_GC,2000); return; } if (mDisplayFrozen) { return; } } Runtime.getRuntime().gc(); break; } case ENABLE_SCREEN: { performEnableScreen(); break; } case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); DisplayContent displayContent=getDefaultDisplayContentLocked(); final ArrayList<Task> tasks=displayContent.getTasks(); for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) { AppTokenList tokens=tasks.get(taskNdx).mAppTokens; for (int tokenNdx=tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok=tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { Slog.w(TAG,"String_Node_Str" + tok); unsetAppFreezingScreenLocked(tok,true,true); } } } } break; } case CLIENT_FREEZE_TIMEOUT: { synchronized (mWindowMap) { if (mClientFreezingScreen) { mClientFreezingScreen=false; mLastFinishedFreezeSource="String_Node_Str"; stopFreezingDisplayLocked(); } } break; } case SEND_NEW_CONFIGURATION: { removeMessages(SEND_NEW_CONFIGURATION); sendNewConfiguration(); break; } case REPORT_WINDOWS_CHANGE: { if (mWindowsChanged) { synchronized (mWindowMap) { mWindowsChanged=false; } notifyWindowsChanged(); } break; } case DRAG_START_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.unregister(); mInputMonitor.updateInputWindowsLw(true); mDragState.reset(); mDragState=null; } } break; } case DRAG_END_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.mDragResult=false; mDragState.endDragLw(); } } break; } case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { notifyHardKeyboardStatusChange(); break; } case BOOT_TIMEOUT: { performBootTimeout(); break; } case WAITING_FOR_DRAWN_TIMEOUT: { Pair<WindowState,IRemoteCallback> pair; synchronized (mWindowMap) { pair=(Pair<WindowState,IRemoteCallback>)msg.obj; Slog.w(TAG,"String_Node_Str" + pair.first); if (!mWaitingForDrawn.remove(pair)) { return; } } try { pair.second.sendResult(null); } catch (RemoteException e) { } break; } case SHOW_STRICT_MODE_VIOLATION: { showStrictModeViolation(msg.arg1,msg.arg2); break; } case DO_ANIMATION_CALLBACK: { try { ((IRemoteCallback)msg.obj).sendResult(null); } catch (RemoteException e) { } break; } case DO_DISPLAY_ADDED: synchronized (mWindowMap) { handleDisplayAddedLocked(msg.arg1); } break; case DO_DISPLAY_REMOVED: synchronized (mWindowMap) { handleDisplayRemovedLocked(msg.arg1); } break; case DO_DISPLAY_CHANGED: synchronized (mWindowMap) { handleDisplayChangedLocked(msg.arg1); } break; case TAP_OUTSIDE_STACK: { int stackId; synchronized (mWindowMap) { stackId=((DisplayContent)msg.obj).stackIdFromPoint(msg.arg1,msg.arg2); } if (stackId >= 0) { try { mActivityManager.setFocusedStack(stackId); } catch (RemoteException e) { } } } break; case NOTIFY_ACTIVITY_DRAWN: try { mActivityManager.notifyActivityDrawn((IBinder)msg.obj); } catch (RemoteException e) { } break; case CREATE_STACK: synchronized (mWindowMap) { createStackLocked(msg.arg1,msg.arg2); } break; } if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str"); } }
@Override public void handleMessage(Message msg){ if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { WindowState lastFocus; WindowState newFocus; synchronized (mWindowMap) { lastFocus=mLastFocus; newFocus=mCurrentFocus; if (lastFocus == newFocus) { return; } mLastFocus=newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus + "String_Node_Str"+ newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { mLosingFocus.add(lastFocus); lastFocus=null; } } if (newFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + newFocus); newFocus.reportFocusChangedSerialized(true,mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus); lastFocus.reportFocusChangedSerialized(false,mInTouchMode); } } break; case REPORT_LOSING_FOCUS: { ArrayList<WindowState> losers; synchronized (mWindowMap) { losers=mLosingFocus; mLosingFocus=new ArrayList<WindowState>(); } final int N=losers.size(); for (int i=0; i < N; i++) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false,mInTouchMode); } } break; case DO_TRAVERSAL: { synchronized (mWindowMap) { mTraversalScheduled=false; performLayoutAndPlaceSurfacesLocked(); } } break; case ADD_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; final StartingData sd=wtoken.startingData; if (sd == null) { return; } if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ sd.pkg); View view=null; try { view=mPolicy.addStartingWindow(wtoken.token,sd.pkg,sd.theme,sd.compatInfo,sd.nonLocalizedLabel,sd.labelRes,sd.icon,sd.logo,sd.windowFlags); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } if (view != null) { boolean abort=false; synchronized (mWindowMap) { if (wtoken.removed || wtoken.startingData == null) { if (wtoken.startingWindow != null) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.removed+ "String_Node_Str"+ wtoken.startingData); removeStartingWindowTimeout(wtoken); wtoken.startingWindow=null; wtoken.startingData=null; abort=true; } } else { wtoken.startingView=view; } if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); } if (abort) { try { mPolicy.removeStartingWindow(wtoken.token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } } break; case REMOVE_STARTING_TIMEOUT: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; Slog.e(TAG,"String_Node_Str" + wtoken + "String_Node_Str"); } case REMOVE_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; IBinder token=null; View view=null; synchronized (mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow != null) { view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } } if (view != null) { try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case FINISHED_STARTING: { IBinder token=null; View view=null; while (true) { synchronized (mWindowMap) { final int N=mFinishedStarting.size(); if (N <= 0) { break; } AppWindowToken wtoken=mFinishedStarting.remove(N - 1); if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow == null) { continue; } view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case REPORT_APPLICATION_TOKEN_DRAWN: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } } break; case REPORT_APPLICATION_TOKEN_WINDOWS: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; boolean nowVisible=msg.arg1 != 0; boolean nowGone=msg.arg2 != 0; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ nowVisible+ "String_Node_Str"+ nowGone); if (nowVisible) { wtoken.appToken.windowsVisible(); } else { wtoken.appToken.windowsGone(); } } catch (RemoteException ex) { } } break; case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); final WindowList windows=getDefaultWindowListLocked(); int i=windows.size(); while (i > 0) { i--; WindowState w=windows.get(i); if (w.mOrientationChanging) { w.mOrientationChanging=false; w.mLastFreezeDuration=(int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); Slog.w(TAG,"String_Node_Str" + w); } } performLayoutAndPlaceSurfacesLocked(); } break; } case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { if (mAppTransition.isTransitionSet()) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,"String_Node_Str"); mAppTransition.setTimeout(); performLayoutAndPlaceSurfacesLocked(); } } break; } case PERSIST_ANIMATION_SCALE: { Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.WINDOW_ANIMATION_SCALE,mWindowAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.TRANSITION_ANIMATION_SCALE,mTransitionAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.ANIMATOR_DURATION_SCALE,mAnimatorDurationScale); break; } case FORCE_GC: { synchronized (mWindowMap) { if (mAnimator.mAnimating || mAnimationScheduled) { sendEmptyMessageDelayed(H.FORCE_GC,2000); return; } if (mDisplayFrozen) { return; } } Runtime.getRuntime().gc(); break; } case ENABLE_SCREEN: { performEnableScreen(); break; } case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); DisplayContent displayContent=getDefaultDisplayContentLocked(); final ArrayList<Task> tasks=displayContent.getTasks(); for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) { AppTokenList tokens=tasks.get(taskNdx).mAppTokens; for (int tokenNdx=tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok=tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { Slog.w(TAG,"String_Node_Str" + tok); unsetAppFreezingScreenLocked(tok,true,true); } } } } break; } case CLIENT_FREEZE_TIMEOUT: { synchronized (mWindowMap) { if (mClientFreezingScreen) { mClientFreezingScreen=false; mLastFinishedFreezeSource="String_Node_Str"; stopFreezingDisplayLocked(); } } break; } case SEND_NEW_CONFIGURATION: { removeMessages(SEND_NEW_CONFIGURATION); sendNewConfiguration(); break; } case REPORT_WINDOWS_CHANGE: { if (mWindowsChanged) { synchronized (mWindowMap) { mWindowsChanged=false; } notifyWindowsChanged(); } break; } case DRAG_START_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.unregister(); mInputMonitor.updateInputWindowsLw(true); mDragState.reset(); mDragState=null; } } break; } case DRAG_END_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.mDragResult=false; mDragState.endDragLw(); } } break; } case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { notifyHardKeyboardStatusChange(); break; } case BOOT_TIMEOUT: { performBootTimeout(); break; } case WAITING_FOR_DRAWN_TIMEOUT: { Pair<WindowState,IRemoteCallback> pair; synchronized (mWindowMap) { pair=(Pair<WindowState,IRemoteCallback>)msg.obj; Slog.w(TAG,"String_Node_Str" + pair.first); if (!mWaitingForDrawn.remove(pair)) { return; } } try { pair.second.sendResult(null); } catch (RemoteException e) { } break; } case SHOW_STRICT_MODE_VIOLATION: { showStrictModeViolation(msg.arg1,msg.arg2); break; } case DO_ANIMATION_CALLBACK: { try { ((IRemoteCallback)msg.obj).sendResult(null); } catch (RemoteException e) { } break; } case DO_DISPLAY_ADDED: synchronized (mWindowMap) { handleDisplayAddedLocked(msg.arg1); } break; case DO_DISPLAY_REMOVED: synchronized (mWindowMap) { handleDisplayRemovedLocked(msg.arg1); } break; case DO_DISPLAY_CHANGED: synchronized (mWindowMap) { handleDisplayChangedLocked(msg.arg1); } break; case TAP_OUTSIDE_STACK: { int stackId; synchronized (mWindowMap) { stackId=((DisplayContent)msg.obj).stackIdFromPoint(msg.arg1,msg.arg2); } if (stackId >= 0) { try { mActivityManager.setFocusedStack(stackId); } catch (RemoteException e) { } } } break; case NOTIFY_ACTIVITY_DRAWN: try { mActivityManager.notifyActivityDrawn((IBinder)msg.obj); } catch (RemoteException e) { } break; } if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str"); } }
null
11
11
11
public void createStack(int stackId,int displayId){ mH.sendMessage(mH.obtainMessage(H.CREATE_STACK,stackId,displayId)); }
/** * Create a new TaskStack and place it on a DisplayContent. * @param stackId The unique identifier of the new stack. * @param displayId The unique identifier of the DisplayContent. */ public void createStack(int stackId,int displayId){ final long origId=Binder.clearCallingIdentity(); try { synchronized (mWindowMap) { final DisplayContent displayContent=mDisplayContents.get(displayId); if (displayContent != null) { TaskStack stack=displayContent.createStack(stackId); mStackIdToStack.put(stackId,stack); performLayoutAndPlaceSurfacesLocked(); } } } finally { Binder.restoreCallingIdentity(origId); } }
null
12
12
12
@Override public void handleMessage(Message msg){ if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { WindowState lastFocus; WindowState newFocus; synchronized (mWindowMap) { lastFocus=mLastFocus; newFocus=mCurrentFocus; if (lastFocus == newFocus) { return; } mLastFocus=newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus + "String_Node_Str"+ newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { mLosingFocus.add(lastFocus); lastFocus=null; } } if (newFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + newFocus); newFocus.reportFocusChangedSerialized(true,mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus); lastFocus.reportFocusChangedSerialized(false,mInTouchMode); } } break; case REPORT_LOSING_FOCUS: { ArrayList<WindowState> losers; synchronized (mWindowMap) { losers=mLosingFocus; mLosingFocus=new ArrayList<WindowState>(); } final int N=losers.size(); for (int i=0; i < N; i++) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false,mInTouchMode); } } break; case DO_TRAVERSAL: { synchronized (mWindowMap) { mTraversalScheduled=false; performLayoutAndPlaceSurfacesLocked(); } } break; case ADD_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; final StartingData sd=wtoken.startingData; if (sd == null) { return; } if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ sd.pkg); View view=null; try { view=mPolicy.addStartingWindow(wtoken.token,sd.pkg,sd.theme,sd.compatInfo,sd.nonLocalizedLabel,sd.labelRes,sd.icon,sd.logo,sd.windowFlags); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } if (view != null) { boolean abort=false; synchronized (mWindowMap) { if (wtoken.removed || wtoken.startingData == null) { if (wtoken.startingWindow != null) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.removed+ "String_Node_Str"+ wtoken.startingData); wtoken.startingWindow=null; wtoken.startingData=null; abort=true; } } else { wtoken.startingView=view; } if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); } if (abort) { try { mPolicy.removeStartingWindow(wtoken.token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } } break; case REMOVE_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; IBinder token=null; View view=null; synchronized (mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow != null) { view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } } if (view != null) { try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case FINISHED_STARTING: { IBinder token=null; View view=null; while (true) { synchronized (mWindowMap) { final int N=mFinishedStarting.size(); if (N <= 0) { break; } AppWindowToken wtoken=mFinishedStarting.remove(N - 1); if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow == null) { continue; } view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case REPORT_APPLICATION_TOKEN_DRAWN: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } } break; case REPORT_APPLICATION_TOKEN_WINDOWS: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; boolean nowVisible=msg.arg1 != 0; boolean nowGone=msg.arg2 != 0; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ nowVisible+ "String_Node_Str"+ nowGone); if (nowVisible) { wtoken.appToken.windowsVisible(); } else { wtoken.appToken.windowsGone(); } } catch (RemoteException ex) { } } break; case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); final WindowList windows=getDefaultWindowListLocked(); int i=windows.size(); while (i > 0) { i--; WindowState w=windows.get(i); if (w.mOrientationChanging) { w.mOrientationChanging=false; w.mLastFreezeDuration=(int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); Slog.w(TAG,"String_Node_Str" + w); } } performLayoutAndPlaceSurfacesLocked(); } break; } case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { if (mAppTransition.isTransitionSet()) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,"String_Node_Str"); mAppTransition.setTimeout(); performLayoutAndPlaceSurfacesLocked(); } } break; } case PERSIST_ANIMATION_SCALE: { Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.WINDOW_ANIMATION_SCALE,mWindowAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.TRANSITION_ANIMATION_SCALE,mTransitionAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.ANIMATOR_DURATION_SCALE,mAnimatorDurationScale); break; } case FORCE_GC: { synchronized (mWindowMap) { if (mAnimator.mAnimating || mAnimationScheduled) { sendEmptyMessageDelayed(H.FORCE_GC,2000); return; } if (mDisplayFrozen) { return; } } Runtime.getRuntime().gc(); break; } case ENABLE_SCREEN: { performEnableScreen(); break; } case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); DisplayContent displayContent=getDefaultDisplayContentLocked(); final ArrayList<Task> tasks=displayContent.getTasks(); for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) { AppTokenList tokens=tasks.get(taskNdx).mAppTokens; for (int tokenNdx=tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok=tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { Slog.w(TAG,"String_Node_Str" + tok); unsetAppFreezingScreenLocked(tok,true,true); } } } } break; } case CLIENT_FREEZE_TIMEOUT: { synchronized (mWindowMap) { if (mClientFreezingScreen) { mClientFreezingScreen=false; mLastFinishedFreezeSource="String_Node_Str"; stopFreezingDisplayLocked(); } } break; } case SEND_NEW_CONFIGURATION: { removeMessages(SEND_NEW_CONFIGURATION); sendNewConfiguration(); break; } case REPORT_WINDOWS_CHANGE: { if (mWindowsChanged) { synchronized (mWindowMap) { mWindowsChanged=false; } notifyWindowsChanged(); } break; } case DRAG_START_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.unregister(); mInputMonitor.updateInputWindowsLw(true); mDragState.reset(); mDragState=null; } } break; } case DRAG_END_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.mDragResult=false; mDragState.endDragLw(); } } break; } case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { notifyHardKeyboardStatusChange(); break; } case BOOT_TIMEOUT: { performBootTimeout(); break; } case WAITING_FOR_DRAWN_TIMEOUT: { Pair<WindowState,IRemoteCallback> pair; synchronized (mWindowMap) { pair=(Pair<WindowState,IRemoteCallback>)msg.obj; Slog.w(TAG,"String_Node_Str" + pair.first); if (!mWaitingForDrawn.remove(pair)) { return; } } try { pair.second.sendResult(null); } catch (RemoteException e) { } break; } case SHOW_STRICT_MODE_VIOLATION: { showStrictModeViolation(msg.arg1,msg.arg2); break; } case DO_ANIMATION_CALLBACK: { try { ((IRemoteCallback)msg.obj).sendResult(null); } catch (RemoteException e) { } break; } case DO_DISPLAY_ADDED: synchronized (mWindowMap) { handleDisplayAddedLocked(msg.arg1); } break; case DO_DISPLAY_REMOVED: synchronized (mWindowMap) { handleDisplayRemovedLocked(msg.arg1); } break; case DO_DISPLAY_CHANGED: synchronized (mWindowMap) { handleDisplayChangedLocked(msg.arg1); } break; case TAP_OUTSIDE_STACK: { int stackId; synchronized (mWindowMap) { stackId=((DisplayContent)msg.obj).stackIdFromPoint(msg.arg1,msg.arg2); } if (stackId >= 0) { try { mActivityManager.setFocusedStack(stackId); } catch (RemoteException e) { } } } break; case NOTIFY_ACTIVITY_DRAWN: try { mActivityManager.notifyActivityDrawn((IBinder)msg.obj); } catch (RemoteException e) { } break; case CREATE_STACK: synchronized (mWindowMap) { createStackLocked(msg.arg1,msg.arg2); } break; } if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str"); } }
@Override public void handleMessage(Message msg){ if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str" + msg.what); } switch (msg.what) { case REPORT_FOCUS_CHANGE: { WindowState lastFocus; WindowState newFocus; synchronized (mWindowMap) { lastFocus=mLastFocus; newFocus=mCurrentFocus; if (lastFocus == newFocus) { return; } mLastFocus=newFocus; if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus + "String_Node_Str"+ newFocus); if (newFocus != null && lastFocus != null && !newFocus.isDisplayedLw()) { mLosingFocus.add(lastFocus); lastFocus=null; } } if (newFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + newFocus); newFocus.reportFocusChangedSerialized(true,mInTouchMode); notifyFocusChanged(); } if (lastFocus != null) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + lastFocus); lastFocus.reportFocusChangedSerialized(false,mInTouchMode); } } break; case REPORT_LOSING_FOCUS: { ArrayList<WindowState> losers; synchronized (mWindowMap) { losers=mLosingFocus; mLosingFocus=new ArrayList<WindowState>(); } final int N=losers.size(); for (int i=0; i < N; i++) { if (DEBUG_FOCUS_LIGHT) Slog.i(TAG,"String_Node_Str" + losers.get(i)); losers.get(i).reportFocusChangedSerialized(false,mInTouchMode); } } break; case DO_TRAVERSAL: { synchronized (mWindowMap) { mTraversalScheduled=false; performLayoutAndPlaceSurfacesLocked(); } } break; case ADD_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; final StartingData sd=wtoken.startingData; if (sd == null) { return; } if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ sd.pkg); View view=null; try { view=mPolicy.addStartingWindow(wtoken.token,sd.pkg,sd.theme,sd.compatInfo,sd.nonLocalizedLabel,sd.labelRes,sd.icon,sd.logo,sd.windowFlags); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } if (view != null) { boolean abort=false; synchronized (mWindowMap) { if (wtoken.removed || wtoken.startingData == null) { if (wtoken.startingWindow != null) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.removed+ "String_Node_Str"+ wtoken.startingData); wtoken.startingWindow=null; wtoken.startingData=null; abort=true; } } else { wtoken.startingView=view; } if (DEBUG_STARTING_WINDOW && !abort) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); } if (abort) { try { mPolicy.removeStartingWindow(wtoken.token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } } break; case REMOVE_STARTING: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; IBinder token=null; View view=null; synchronized (mWindowMap) { if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow != null) { view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } } if (view != null) { try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case FINISHED_STARTING: { IBinder token=null; View view=null; while (true) { synchronized (mWindowMap) { final int N=mFinishedStarting.size(); if (N <= 0) { break; } AppWindowToken wtoken=mFinishedStarting.remove(N - 1); if (DEBUG_STARTING_WINDOW) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ wtoken.startingWindow+ "String_Node_Str"+ wtoken.startingView); if (wtoken.startingWindow == null) { continue; } view=wtoken.startingView; token=wtoken.token; wtoken.startingData=null; wtoken.startingView=null; wtoken.startingWindow=null; wtoken.startingDisplayed=false; } try { mPolicy.removeStartingWindow(token,view); } catch (Exception e) { Slog.w(TAG,"String_Node_Str",e); } } } break; case REPORT_APPLICATION_TOKEN_DRAWN: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken); wtoken.appToken.windowsDrawn(); } catch (RemoteException ex) { } } break; case REPORT_APPLICATION_TOKEN_WINDOWS: { final AppWindowToken wtoken=(AppWindowToken)msg.obj; boolean nowVisible=msg.arg1 != 0; boolean nowGone=msg.arg2 != 0; try { if (DEBUG_VISIBILITY) Slog.v(TAG,"String_Node_Str" + wtoken + "String_Node_Str"+ nowVisible+ "String_Node_Str"+ nowGone); if (nowVisible) { wtoken.appToken.windowsVisible(); } else { wtoken.appToken.windowsGone(); } } catch (RemoteException ex) { } } break; case WINDOW_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); final WindowList windows=getDefaultWindowListLocked(); int i=windows.size(); while (i > 0) { i--; WindowState w=windows.get(i); if (w.mOrientationChanging) { w.mOrientationChanging=false; w.mLastFreezeDuration=(int)(SystemClock.elapsedRealtime() - mDisplayFreezeTime); Slog.w(TAG,"String_Node_Str" + w); } } performLayoutAndPlaceSurfacesLocked(); } break; } case APP_TRANSITION_TIMEOUT: { synchronized (mWindowMap) { if (mAppTransition.isTransitionSet()) { if (DEBUG_APP_TRANSITIONS) Slog.v(TAG,"String_Node_Str"); mAppTransition.setTimeout(); performLayoutAndPlaceSurfacesLocked(); } } break; } case PERSIST_ANIMATION_SCALE: { Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.WINDOW_ANIMATION_SCALE,mWindowAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.TRANSITION_ANIMATION_SCALE,mTransitionAnimationScale); Settings.Global.putFloat(mContext.getContentResolver(),Settings.Global.ANIMATOR_DURATION_SCALE,mAnimatorDurationScale); break; } case FORCE_GC: { synchronized (mWindowMap) { if (mAnimator.mAnimating || mAnimationScheduled) { sendEmptyMessageDelayed(H.FORCE_GC,2000); return; } if (mDisplayFrozen) { return; } } Runtime.getRuntime().gc(); break; } case ENABLE_SCREEN: { performEnableScreen(); break; } case APP_FREEZE_TIMEOUT: { synchronized (mWindowMap) { Slog.w(TAG,"String_Node_Str"); DisplayContent displayContent=getDefaultDisplayContentLocked(); final ArrayList<Task> tasks=displayContent.getTasks(); for (int taskNdx=tasks.size() - 1; taskNdx >= 0; --taskNdx) { AppTokenList tokens=tasks.get(taskNdx).mAppTokens; for (int tokenNdx=tokens.size() - 1; tokenNdx >= 0; --tokenNdx) { AppWindowToken tok=tokens.get(tokenNdx); if (tok.mAppAnimator.freezingScreen) { Slog.w(TAG,"String_Node_Str" + tok); unsetAppFreezingScreenLocked(tok,true,true); } } } } break; } case CLIENT_FREEZE_TIMEOUT: { synchronized (mWindowMap) { if (mClientFreezingScreen) { mClientFreezingScreen=false; mLastFinishedFreezeSource="String_Node_Str"; stopFreezingDisplayLocked(); } } break; } case SEND_NEW_CONFIGURATION: { removeMessages(SEND_NEW_CONFIGURATION); sendNewConfiguration(); break; } case REPORT_WINDOWS_CHANGE: { if (mWindowsChanged) { synchronized (mWindowMap) { mWindowsChanged=false; } notifyWindowsChanged(); } break; } case DRAG_START_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.unregister(); mInputMonitor.updateInputWindowsLw(true); mDragState.reset(); mDragState=null; } } break; } case DRAG_END_TIMEOUT: { IBinder win=(IBinder)msg.obj; if (DEBUG_DRAG) { Slog.w(TAG,"String_Node_Str" + win); } synchronized (mWindowMap) { if (mDragState != null) { mDragState.mDragResult=false; mDragState.endDragLw(); } } break; } case REPORT_HARD_KEYBOARD_STATUS_CHANGE: { notifyHardKeyboardStatusChange(); break; } case BOOT_TIMEOUT: { performBootTimeout(); break; } case WAITING_FOR_DRAWN_TIMEOUT: { Pair<WindowState,IRemoteCallback> pair; synchronized (mWindowMap) { pair=(Pair<WindowState,IRemoteCallback>)msg.obj; Slog.w(TAG,"String_Node_Str" + pair.first); if (!mWaitingForDrawn.remove(pair)) { return; } } try { pair.second.sendResult(null); } catch (RemoteException e) { } break; } case SHOW_STRICT_MODE_VIOLATION: { showStrictModeViolation(msg.arg1,msg.arg2); break; } case DO_ANIMATION_CALLBACK: { try { ((IRemoteCallback)msg.obj).sendResult(null); } catch (RemoteException e) { } break; } case DO_DISPLAY_ADDED: synchronized (mWindowMap) { handleDisplayAddedLocked(msg.arg1); } break; case DO_DISPLAY_REMOVED: synchronized (mWindowMap) { handleDisplayRemovedLocked(msg.arg1); } break; case DO_DISPLAY_CHANGED: synchronized (mWindowMap) { handleDisplayChangedLocked(msg.arg1); } break; case TAP_OUTSIDE_STACK: { int stackId; synchronized (mWindowMap) { stackId=((DisplayContent)msg.obj).stackIdFromPoint(msg.arg1,msg.arg2); } if (stackId >= 0) { try { mActivityManager.setFocusedStack(stackId); } catch (RemoteException e) { } } } break; case NOTIFY_ACTIVITY_DRAWN: try { mActivityManager.notifyActivityDrawn((IBinder)msg.obj); } catch (RemoteException e) { } break; } if (DEBUG_WINDOW_TRACE) { Slog.v(TAG,"String_Node_Str"); } }
null
13
13
13
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); if (item.hasSubMenu()) { actionView.setOnTouchListener(new ForwardingListener(actionView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionView.setOnTouchListener(null); } final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
null
14
14
14
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); }
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); if (item.hasSubMenu()) { actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionItemView.setOnTouchListener(null); } }
null
15
15
15
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); if (item.hasSubMenu()) { actionView.setOnTouchListener(new ForwardingListener(actionView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionView.setOnTouchListener(null); } final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
null
16
16
16
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); }
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); if (item.hasSubMenu()) { actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionItemView.setOnTouchListener(null); } }
null
17
17
17
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); if (item.hasSubMenu()) { actionView.setOnTouchListener(new ForwardingListener(actionView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionView.setOnTouchListener(null); } final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
null
18
18
18
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); }
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); if (item.hasSubMenu()) { actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionItemView.setOnTouchListener(null); } }
null
19
19
19
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); if (item.hasSubMenu()) { actionView.setOnTouchListener(new ForwardingListener(actionView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionView.setOnTouchListener(null); } final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
@Override public View getItemView(final MenuItemImpl item,View convertView,ViewGroup parent){ View actionView=item.getActionView(); if (actionView == null || item.hasCollapsibleActionView()) { actionView=super.getItemView(item,convertView,parent); } actionView.setVisibility(item.isActionViewExpanded() ? View.GONE : View.VISIBLE); final ActionMenuView menuParent=(ActionMenuView)parent; final ViewGroup.LayoutParams lp=actionView.getLayoutParams(); if (!menuParent.checkLayoutParams(lp)) { actionView.setLayoutParams(menuParent.generateLayoutParams(lp)); } return actionView; }
null
20
20
20
@Override public void bindItemView(MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); }
@Override public void bindItemView(final MenuItemImpl item,MenuView.ItemView itemView){ itemView.initialize(item,0); final ActionMenuView menuView=(ActionMenuView)mMenuView; final ActionMenuItemView actionItemView=(ActionMenuItemView)itemView; actionItemView.setItemInvoker(menuView); if (item.hasSubMenu()) { actionItemView.setOnTouchListener(new ForwardingListener(actionItemView){ @Override public ListPopupWindow getPopup(){ return mActionButtonPopup != null ? mActionButtonPopup.getPopup() : null; } @Override protected boolean onForwardingStarted(){ return onSubMenuSelected((SubMenuBuilder)item.getSubMenu()); } @Override protected boolean onForwardingStopped(){ return dismissPopupMenus(); } } ); } else { actionItemView.setOnTouchListener(null); } }
null
21
21
21
@Override public void onRtlPropertiesChanged(int layoutDirection){ super.onRtlPropertiesChanged(layoutDirection); mTextDir=getTextDirectionHeuristic(); }
@Override public void onRtlPropertiesChanged(int layoutDirection){ super.onRtlPropertiesChanged(layoutDirection); mTextDir=getTextDirectionHeuristic(); if (mLayout != null) { checkForRelayout(); } }
null
22
22
22
private void handleDisable(){ if (DEBUG) Log.d(TAG,"String_Node_Str"); stopNavigating(); mAlarmManager.cancel(mWakeupIntent); mAlarmManager.cancel(mTimeoutIntent); native_cleanup(); }
private void handleDisable(){ if (DEBUG) Log.d(TAG,"String_Node_Str"); updateClientUids(new WorkSource()); stopNavigating(); mAlarmManager.cancel(mWakeupIntent); mAlarmManager.cancel(mTimeoutIntent); native_cleanup(); }
null
23
23
23
private void handleDisable(){ if (DEBUG) Log.d(TAG,"String_Node_Str"); stopNavigating(); mAlarmManager.cancel(mWakeupIntent); mAlarmManager.cancel(mTimeoutIntent); native_cleanup(); }
private void handleDisable(){ if (DEBUG) Log.d(TAG,"String_Node_Str"); updateClientUids(new WorkSource()); stopNavigating(); mAlarmManager.cancel(mWakeupIntent); mAlarmManager.cancel(mTimeoutIntent); native_cleanup(); }
null
24
24
24
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(false); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
null
25
25
25
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(false); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
null
26
26
26
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(false); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
null
27
27
27
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(false); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
null
28
28
28
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
/** * Converts this time to milliseconds. Suitable for interacting with the standard java libraries. The time is in UTC milliseconds since the epoch. This does an implicit normalization to compute the milliseconds but does <em>not</em> change any of the fields in this Time object. If you want to normalize the fields in this Time object and also get the milliseconds then use {@link #normalize(boolean)}. <p> If "ignoreDst" is false, then this method uses the current setting of the "isDst" field and will adjust the returned time if the "isDst" field is wrong for the given time. See the sample code below for an example of this. <p> If "ignoreDst" is true, then this method ignores the current setting of the "isDst" field in this Time object and will instead figure out the correct value of "isDst" (as best it can) from the fields in this Time object. The only case where this method cannot figure out the correct value of the "isDst" field is when the time is inherently ambiguous because it falls in the hour that is repeated when switching from Daylight-Saving Time to Standard Time. <p> Here is an example where <tt>toMillis(true)</tt> adjusts the time, assuming that DST changes at 2am on Sunday, Nov 4, 2007. <pre> Time time = new Time(); time.set(4, 10, 2007); // set the date to Nov 4, 2007, 12am time.normalize(false); // this sets isDst = 1 time.monthDay += 1; // changes the date to Nov 5, 2007, 12am millis = time.toMillis(false); // millis is Nov 4, 2007, 11pm millis = time.toMillis(true); // millis is Nov 5, 2007, 12am </pre> <p> To avoid this problem, use <tt>toMillis(true)</tt> after adding or subtracting days or explicitly setting the "monthDay" field. On the other hand, if you are adding or subtracting hours or minutes, then you should use <tt>toMillis(false)</tt>. <p> You should also use <tt>toMillis(false)</tt> if you want to read back the same milliseconds that you set with {@link #set(long)}or {@link #set(Time)} or after parsing a date string. */ native public long toMillis(boolean ignoreDst);
null
29
29
29
/** * Adds the children of a given View for accessibility. Since some Views are not important for accessibility the children for accessibility are not necessarily direct children of the view, rather they are the first level of descendants important for accessibility. * @param children The list of children for accessibility. */ public void addChildrenForAccessibility(ArrayList<View> children){ if (includeForAccessibility()) { children.add(this); } }
/** * Adds the children of a given View for accessibility. Since some Views are not important for accessibility the children for accessibility are not necessarily direct children of the view, rather they are the first level of descendants important for accessibility. * @param children The list of children for accessibility. */ public void addChildrenForAccessibility(ArrayList<View> children){ }
null
30
30
30
/** * Convenience method for sending a {@link AccessibilityEvent#TYPE_ANNOUNCEMENT}{@link AccessibilityEvent} to make an announcement which is related to somesort of a context change for which none of the events representing UI transitions is a good fit. For example, announcing a new page in a book. If accessibility is not enabled this method does nothing. * @param text The announcement text. */ public void announceForAccessibility(CharSequence text){ if (AccessibilityManager.getInstance(mContext).isEnabled() && mParent != null) { AccessibilityEvent event=AccessibilityEvent.obtain(AccessibilityEvent.TYPE_ANNOUNCEMENT); onInitializeAccessibilityEvent(event); event.getText().add(text); event.setContentDescription(null); mParent.requestSendAccessibilityEvent(this,event); } }
/** * Convenience method for sending a {@link AccessibilityEvent#TYPE_ANNOUNCEMENT}{@link AccessibilityEvent} to make an announcement which is related to somesort of a context change for which none of the events representing UI transitions is a good fit. For example, announcing a new page in a book. If accessibility is not enabled this method does nothing. * @param text The announcement text. */ public void announceForAccessibility(CharSequence text){ if (AccessibilityManager.getInstance(mContext).isEnabled() && mParent != null && isImportantForAccessibility()) { AccessibilityEvent event=AccessibilityEvent.obtain(AccessibilityEvent.TYPE_ANNOUNCEMENT); onInitializeAccessibilityEvent(event); event.getText().add(text); event.setContentDescription(null); mParent.requestSendAccessibilityEvent(this,event); } }
null
31
31
31
/** * @see #sendAccessibilityEventUnchecked(AccessibilityEvent) Note: Called from the default {@link AccessibilityDelegate}. */ void sendAccessibilityEventUncheckedInternal(AccessibilityEvent event){ if (!isShown()) { return; } onInitializeAccessibilityEvent(event); if ((event.getEventType() & POPULATING_ACCESSIBILITY_EVENT_TYPES) != 0) { dispatchPopulateAccessibilityEvent(event); } getParent().requestSendAccessibilityEvent(this,event); }
/** * @see #sendAccessibilityEventUnchecked(AccessibilityEvent) Note: Called from the default {@link AccessibilityDelegate}. */ void sendAccessibilityEventUncheckedInternal(AccessibilityEvent event){ if (!isShown() || !isImportantForAccessibility()) { return; } onInitializeAccessibilityEvent(event); if ((event.getEventType() & POPULATING_ACCESSIBILITY_EVENT_TYPES) != 0) { dispatchPopulateAccessibilityEvent(event); } getParent().requestSendAccessibilityEvent(this,event); }
null
32
32
32
/** * Caches an {@link AccessibilityNodeInfo} given its accessibility node id. * @param info The {@link AccessibilityNodeInfo} to cache. */ public void add(AccessibilityNodeInfo info){ if (ENABLED) { synchronized (mLock) { if (DEBUG) { Log.i(LOG_TAG,"String_Node_Str" + info + "String_Node_Str"); } final long sourceId=info.getSourceNodeId(); AccessibilityNodeInfo oldInfo=mCacheImpl.get(sourceId); if (oldInfo != null) { final LongArray newChildrenIds=info.getChildNodeIds(); final int oldChildCount=oldInfo.getChildCount(); for (int i=0; i < oldChildCount; i++) { final long oldChildId=oldInfo.getChildId(i); if (newChildrenIds.indexOf(oldChildId) < 0) { clearSubTreeLocked(oldChildId); } } final long oldParentId=oldInfo.getParentNodeId(); if (info.getParentNodeId() != oldParentId) { clearSubTreeLocked(oldParentId); } } AccessibilityNodeInfo clone=AccessibilityNodeInfo.obtain(info); mCacheImpl.put(sourceId,clone); } } }
/** * Caches an {@link AccessibilityNodeInfo} given its accessibility node id. * @param info The {@link AccessibilityNodeInfo} to cache. */ public void add(AccessibilityNodeInfo info){ if (ENABLED) { synchronized (mLock) { if (DEBUG) { Log.i(LOG_TAG,"String_Node_Str" + info + "String_Node_Str"); } final long sourceId=info.getSourceNodeId(); AccessibilityNodeInfo oldInfo=mCacheImpl.get(sourceId); if (oldInfo != null) { final LongArray newChildrenIds=info.getChildNodeIds(); if (newChildrenIds != null) { final int oldChildCount=oldInfo.getChildCount(); for (int i=0; i < oldChildCount; i++) { final long oldChildId=oldInfo.getChildId(i); if (newChildrenIds.indexOf(oldChildId) < 0) { clearSubTreeLocked(oldChildId); } } } final long oldParentId=oldInfo.getParentNodeId(); if (info.getParentNodeId() != oldParentId) { clearSubTreeLocked(oldParentId); } } AccessibilityNodeInfo clone=AccessibilityNodeInfo.obtain(info); mCacheImpl.put(sourceId,clone); } } }
null
33
33
33
/** * Adds the children of a given View for accessibility. Since some Views are not important for accessibility the children for accessibility are not necessarily direct children of the view, rather they are the first level of descendants important for accessibility. * @param children The list of children for accessibility. */ public void addChildrenForAccessibility(ArrayList<View> children){ if (includeForAccessibility()) { children.add(this); } }
/** * Adds the children of a given View for accessibility. Since some Views are not important for accessibility the children for accessibility are not necessarily direct children of the view, rather they are the first level of descendants important for accessibility. * @param children The list of children for accessibility. */ public void addChildrenForAccessibility(ArrayList<View> children){ }
null
34
34
34
/** * Convenience method for sending a {@link AccessibilityEvent#TYPE_ANNOUNCEMENT}{@link AccessibilityEvent} to make an announcement which is related to somesort of a context change for which none of the events representing UI transitions is a good fit. For example, announcing a new page in a book. If accessibility is not enabled this method does nothing. * @param text The announcement text. */ public void announceForAccessibility(CharSequence text){ if (AccessibilityManager.getInstance(mContext).isEnabled() && mParent != null) { AccessibilityEvent event=AccessibilityEvent.obtain(AccessibilityEvent.TYPE_ANNOUNCEMENT); onInitializeAccessibilityEvent(event); event.getText().add(text); event.setContentDescription(null); mParent.requestSendAccessibilityEvent(this,event); } }
/** * Convenience method for sending a {@link AccessibilityEvent#TYPE_ANNOUNCEMENT}{@link AccessibilityEvent} to make an announcement which is related to somesort of a context change for which none of the events representing UI transitions is a good fit. For example, announcing a new page in a book. If accessibility is not enabled this method does nothing. * @param text The announcement text. */ public void announceForAccessibility(CharSequence text){ if (AccessibilityManager.getInstance(mContext).isEnabled() && mParent != null && isImportantForAccessibility()) { AccessibilityEvent event=AccessibilityEvent.obtain(AccessibilityEvent.TYPE_ANNOUNCEMENT); onInitializeAccessibilityEvent(event); event.getText().add(text); event.setContentDescription(null); mParent.requestSendAccessibilityEvent(this,event); } }
null
35
35
35
/** * @see #sendAccessibilityEventUnchecked(AccessibilityEvent) Note: Called from the default {@link AccessibilityDelegate}. */ void sendAccessibilityEventUncheckedInternal(AccessibilityEvent event){ if (!isShown()) { return; } onInitializeAccessibilityEvent(event); if ((event.getEventType() & POPULATING_ACCESSIBILITY_EVENT_TYPES) != 0) { dispatchPopulateAccessibilityEvent(event); } getParent().requestSendAccessibilityEvent(this,event); }
/** * @see #sendAccessibilityEventUnchecked(AccessibilityEvent) Note: Called from the default {@link AccessibilityDelegate}. */ void sendAccessibilityEventUncheckedInternal(AccessibilityEvent event){ if (!isShown() || !isImportantForAccessibility()) { return; } onInitializeAccessibilityEvent(event); if ((event.getEventType() & POPULATING_ACCESSIBILITY_EVENT_TYPES) != 0) { dispatchPopulateAccessibilityEvent(event); } getParent().requestSendAccessibilityEvent(this,event); }
null
36
36
36
/** * Caches an {@link AccessibilityNodeInfo} given its accessibility node id. * @param info The {@link AccessibilityNodeInfo} to cache. */ public void add(AccessibilityNodeInfo info){ if (ENABLED) { synchronized (mLock) { if (DEBUG) { Log.i(LOG_TAG,"String_Node_Str" + info + "String_Node_Str"); } final long sourceId=info.getSourceNodeId(); AccessibilityNodeInfo oldInfo=mCacheImpl.get(sourceId); if (oldInfo != null) { final LongArray newChildrenIds=info.getChildNodeIds(); final int oldChildCount=oldInfo.getChildCount(); for (int i=0; i < oldChildCount; i++) { final long oldChildId=oldInfo.getChildId(i); if (newChildrenIds.indexOf(oldChildId) < 0) { clearSubTreeLocked(oldChildId); } } final long oldParentId=oldInfo.getParentNodeId(); if (info.getParentNodeId() != oldParentId) { clearSubTreeLocked(oldParentId); } } AccessibilityNodeInfo clone=AccessibilityNodeInfo.obtain(info); mCacheImpl.put(sourceId,clone); } } }
/** * Caches an {@link AccessibilityNodeInfo} given its accessibility node id. * @param info The {@link AccessibilityNodeInfo} to cache. */ public void add(AccessibilityNodeInfo info){ if (ENABLED) { synchronized (mLock) { if (DEBUG) { Log.i(LOG_TAG,"String_Node_Str" + info + "String_Node_Str"); } final long sourceId=info.getSourceNodeId(); AccessibilityNodeInfo oldInfo=mCacheImpl.get(sourceId); if (oldInfo != null) { final LongArray newChildrenIds=info.getChildNodeIds(); if (newChildrenIds != null) { final int oldChildCount=oldInfo.getChildCount(); for (int i=0; i < oldChildCount; i++) { final long oldChildId=oldInfo.getChildId(i); if (newChildrenIds.indexOf(oldChildId) < 0) { clearSubTreeLocked(oldChildId); } } } final long oldParentId=oldInfo.getParentNodeId(); if (info.getParentNodeId() != oldParentId) { clearSubTreeLocked(oldParentId); } } AccessibilityNodeInfo clone=AccessibilityNodeInfo.obtain(info); mCacheImpl.put(sourceId,clone); } } }
null
37
37
37
private void updateMinScale(int w,int h,TileSource source,boolean resetScale){ synchronized (mLock) { if (resetScale) { mRenderer.scale=1; } if (source != null) { final float[] imageDims=getImageDims(); final float imageWidth=imageDims[0]; final float imageHeight=imageDims[1]; mMinScale=Math.max(w / imageWidth,h / imageHeight); mRenderer.scale=Math.max(mMinScale,mRenderer.scale); } } }
private void updateMinScale(int w,int h,TileSource source,boolean resetScale){ synchronized (mLock) { if (resetScale) { mRenderer.scale=1; } if (source != null) { final float[] imageDims=getImageDims(); final float imageWidth=imageDims[0]; final float imageHeight=imageDims[1]; mMinScale=Math.max(w / imageWidth,h / imageHeight); mRenderer.scale=Math.max(mMinScale,resetScale ? Float.MIN_VALUE : mRenderer.scale); } } }
null
38
38
38
public boolean cropBitmap(){ boolean failure=false; WallpaperManager wallpaperManager=null; if (mSetWallpaper) { wallpaperManager=WallpaperManager.getInstance(mContext.getApplicationContext()); } if (mSetWallpaper && mNoCrop) { try { InputStream is=regenerateInputStream(); if (is != null) { wallpaperManager.setStream(is); Utils.closeSilently(is); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } return !failure; } else { Rect roundedTrueCrop=new Rect(); Matrix rotateMatrix=new Matrix(); Matrix inverseRotateMatrix=new Matrix(); if (mRotation > 0) { rotateMatrix.setRotate(mRotation); inverseRotateMatrix.setRotate(-mRotation); mCropBounds.roundOut(roundedTrueCrop); mCropBounds=new RectF(roundedTrueCrop); Point bounds=getImageBounds(); if (bounds == null) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } float[] rotatedBounds=new float[]{bounds.x,bounds.y}; rotateMatrix.mapPoints(rotatedBounds); rotatedBounds[0]=Math.abs(rotatedBounds[0]); rotatedBounds[1]=Math.abs(rotatedBounds[1]); mCropBounds.offset(-rotatedBounds[0] / 2,-rotatedBounds[1] / 2); inverseRotateMatrix.mapRect(mCropBounds); mCropBounds.offset(bounds.x / 2,bounds.y / 2); } mCropBounds.roundOut(roundedTrueCrop); if (roundedTrueCrop.width() <= 0 || roundedTrueCrop.height() <= 0) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } int scaleDownSampleSize=Math.max(1,Math.min(roundedTrueCrop.width() / mOutWidth,roundedTrueCrop.height() / mOutHeight)); BitmapRegionDecoder decoder=null; InputStream is=null; try { is=regenerateInputStream(); if (is == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } decoder=BitmapRegionDecoder.newInstance(is,false); Utils.closeSilently(is); } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString(),e); } finally { Utils.closeSilently(is); is=null; } Bitmap crop=null; if (decoder != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } crop=decoder.decodeRegion(roundedTrueCrop,options); decoder.recycle(); } if (crop == null) { is=regenerateInputStream(); Bitmap fullSize=null; if (is != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } fullSize=BitmapFactory.decodeStream(is,null,options); Utils.closeSilently(is); } if (fullSize != null) { mCropBounds.left/=scaleDownSampleSize; mCropBounds.top/=scaleDownSampleSize; mCropBounds.bottom/=scaleDownSampleSize; mCropBounds.right/=scaleDownSampleSize; mCropBounds.roundOut(roundedTrueCrop); crop=Bitmap.createBitmap(fullSize,roundedTrueCrop.left,roundedTrueCrop.top,roundedTrueCrop.width(),roundedTrueCrop.height()); } } if (crop == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } if (mOutWidth > 0 && mOutHeight > 0 || mRotation > 0) { float[] dimsAfter=new float[]{crop.getWidth(),crop.getHeight()}; rotateMatrix.mapPoints(dimsAfter); dimsAfter[0]=Math.abs(dimsAfter[0]); dimsAfter[1]=Math.abs(dimsAfter[1]); if (!(mOutWidth > 0 && mOutHeight > 0)) { mOutWidth=Math.round(dimsAfter[0]); mOutHeight=Math.round(dimsAfter[1]); } RectF cropRect=new RectF(0,0,dimsAfter[0],dimsAfter[1]); RectF returnRect=new RectF(0,0,mOutWidth,mOutHeight); Matrix m=new Matrix(); if (mRotation == 0) { m.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); } else { Matrix m1=new Matrix(); m1.setTranslate(-crop.getWidth() / 2f,-crop.getHeight() / 2f); Matrix m2=new Matrix(); m2.setRotate(mRotation); Matrix m3=new Matrix(); m3.setTranslate(dimsAfter[0] / 2f,dimsAfter[1] / 2f); Matrix m4=new Matrix(); m4.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); Matrix c1=new Matrix(); c1.setConcat(m2,m1); Matrix c2=new Matrix(); c2.setConcat(m4,m3); m.setConcat(c2,c1); } Bitmap tmp=Bitmap.createBitmap((int)returnRect.width(),(int)returnRect.height(),Bitmap.Config.ARGB_8888); if (tmp != null) { Canvas c=new Canvas(tmp); Paint p=new Paint(); p.setFilterBitmap(true); c.drawBitmap(crop,m,p); crop=tmp; } } if (mSaveCroppedBitmap) { mCroppedBitmap=crop; } CompressFormat cf=convertExtensionToCompressFormat(getFileExtension(mOutputFormat)); ByteArrayOutputStream tmpOut=new ByteArrayOutputStream(2048); if (crop.compress(cf,DEFAULT_COMPRESS_QUALITY,tmpOut)) { if (mSetWallpaper && wallpaperManager != null) { try { byte[] outByteArray=tmpOut.toByteArray(); wallpaperManager.setStream(new ByteArrayInputStream(outByteArray)); if (mOnBitmapCroppedHandler != null) { mOnBitmapCroppedHandler.onBitmapCropped(outByteArray); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } } } else { Log.w(LOGTAG,"String_Node_Str"); failure=true; } } return !failure; }
public boolean cropBitmap(){ boolean failure=false; WallpaperManager wallpaperManager=null; if (mSetWallpaper) { wallpaperManager=WallpaperManager.getInstance(mContext.getApplicationContext()); } if (mSetWallpaper && mNoCrop) { try { InputStream is=regenerateInputStream(); if (is != null) { wallpaperManager.setStream(is); Utils.closeSilently(is); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } return !failure; } else { Rect roundedTrueCrop=new Rect(); Matrix rotateMatrix=new Matrix(); Matrix inverseRotateMatrix=new Matrix(); Point bounds=getImageBounds(); if (mRotation > 0) { rotateMatrix.setRotate(mRotation); inverseRotateMatrix.setRotate(-mRotation); mCropBounds.roundOut(roundedTrueCrop); mCropBounds=new RectF(roundedTrueCrop); if (bounds == null) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } float[] rotatedBounds=new float[]{bounds.x,bounds.y}; rotateMatrix.mapPoints(rotatedBounds); rotatedBounds[0]=Math.abs(rotatedBounds[0]); rotatedBounds[1]=Math.abs(rotatedBounds[1]); mCropBounds.offset(-rotatedBounds[0] / 2,-rotatedBounds[1] / 2); inverseRotateMatrix.mapRect(mCropBounds); mCropBounds.offset(bounds.x / 2,bounds.y / 2); } mCropBounds.roundOut(roundedTrueCrop); if (roundedTrueCrop.width() <= 0 || roundedTrueCrop.height() <= 0) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } int scaleDownSampleSize=Math.max(1,Math.min(roundedTrueCrop.width() / mOutWidth,roundedTrueCrop.height() / mOutHeight)); BitmapRegionDecoder decoder=null; InputStream is=null; try { is=regenerateInputStream(); if (is == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } decoder=BitmapRegionDecoder.newInstance(is,false); Utils.closeSilently(is); } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString(),e); } finally { Utils.closeSilently(is); is=null; } Bitmap crop=null; if (decoder != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } crop=decoder.decodeRegion(roundedTrueCrop,options); decoder.recycle(); } if (crop == null) { is=regenerateInputStream(); Bitmap fullSize=null; if (is != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } fullSize=BitmapFactory.decodeStream(is,null,options); Utils.closeSilently(is); } if (fullSize != null) { scaleDownSampleSize=bounds.x / fullSize.getWidth(); mCropBounds.left/=scaleDownSampleSize; mCropBounds.top/=scaleDownSampleSize; mCropBounds.bottom/=scaleDownSampleSize; mCropBounds.right/=scaleDownSampleSize; mCropBounds.roundOut(roundedTrueCrop); if (roundedTrueCrop.width() > fullSize.getWidth()) { roundedTrueCrop.right=roundedTrueCrop.left + fullSize.getWidth(); } if (roundedTrueCrop.right > fullSize.getWidth()) { int adjustment=roundedTrueCrop.left - Math.max(0,roundedTrueCrop.right - roundedTrueCrop.width()); roundedTrueCrop.left-=adjustment; roundedTrueCrop.right-=adjustment; } if (roundedTrueCrop.height() > fullSize.getHeight()) { roundedTrueCrop.bottom=roundedTrueCrop.top + fullSize.getHeight(); } if (roundedTrueCrop.bottom > fullSize.getHeight()) { int adjustment=roundedTrueCrop.top - Math.max(0,roundedTrueCrop.bottom - roundedTrueCrop.height()); roundedTrueCrop.top-=adjustment; roundedTrueCrop.bottom-=adjustment; } crop=Bitmap.createBitmap(fullSize,roundedTrueCrop.left,roundedTrueCrop.top,roundedTrueCrop.width(),roundedTrueCrop.height()); } } if (crop == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } if (mOutWidth > 0 && mOutHeight > 0 || mRotation > 0) { float[] dimsAfter=new float[]{crop.getWidth(),crop.getHeight()}; rotateMatrix.mapPoints(dimsAfter); dimsAfter[0]=Math.abs(dimsAfter[0]); dimsAfter[1]=Math.abs(dimsAfter[1]); if (!(mOutWidth > 0 && mOutHeight > 0)) { mOutWidth=Math.round(dimsAfter[0]); mOutHeight=Math.round(dimsAfter[1]); } RectF cropRect=new RectF(0,0,dimsAfter[0],dimsAfter[1]); RectF returnRect=new RectF(0,0,mOutWidth,mOutHeight); Matrix m=new Matrix(); if (mRotation == 0) { m.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); } else { Matrix m1=new Matrix(); m1.setTranslate(-crop.getWidth() / 2f,-crop.getHeight() / 2f); Matrix m2=new Matrix(); m2.setRotate(mRotation); Matrix m3=new Matrix(); m3.setTranslate(dimsAfter[0] / 2f,dimsAfter[1] / 2f); Matrix m4=new Matrix(); m4.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); Matrix c1=new Matrix(); c1.setConcat(m2,m1); Matrix c2=new Matrix(); c2.setConcat(m4,m3); m.setConcat(c2,c1); } Bitmap tmp=Bitmap.createBitmap((int)returnRect.width(),(int)returnRect.height(),Bitmap.Config.ARGB_8888); if (tmp != null) { Canvas c=new Canvas(tmp); Paint p=new Paint(); p.setFilterBitmap(true); c.drawBitmap(crop,m,p); crop=tmp; } } if (mSaveCroppedBitmap) { mCroppedBitmap=crop; } CompressFormat cf=convertExtensionToCompressFormat(getFileExtension(mOutputFormat)); ByteArrayOutputStream tmpOut=new ByteArrayOutputStream(2048); if (crop.compress(cf,DEFAULT_COMPRESS_QUALITY,tmpOut)) { if (mSetWallpaper && wallpaperManager != null) { try { byte[] outByteArray=tmpOut.toByteArray(); wallpaperManager.setStream(new ByteArrayInputStream(outByteArray)); if (mOnBitmapCroppedHandler != null) { mOnBitmapCroppedHandler.onBitmapCropped(outByteArray); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } } } else { Log.w(LOGTAG,"String_Node_Str"); failure=true; } } return !failure; }
null
39
39
39
public void run(){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); }
public void run(){ updateWallpaperDimensions(outWidth,outHeight); if (finishActivityWhenDone) { setResult(Activity.RESULT_OK); finish(); } }
null
40
40
40
static public void suggestWallpaperDimension(Resources res,final SharedPreferences sharedPrefs,WindowManager windowManager,final WallpaperManager wallpaperManager){ final Point defaultWallpaperSize=getDefaultWallpaperSize(res,windowManager); new Thread("String_Node_Str"){ public void run(){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); } } .start(); }
static public void suggestWallpaperDimension(Resources res,final SharedPreferences sharedPrefs,WindowManager windowManager,final WallpaperManager wallpaperManager){ final Point defaultWallpaperSize=getDefaultWallpaperSize(res,windowManager); new AsyncTask<Void,Void,Void>(){ public Void doInBackground( Void... args){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); return null; } } .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,(Void)null); }
null
41
41
41
@Override protected Boolean doInBackground(Void... params){ return cropBitmap(); }
public Void doInBackground(Void... args){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); return null; }
null
42
42
42
private void updateMinScale(int w,int h,TileSource source,boolean resetScale){ synchronized (mLock) { if (resetScale) { mRenderer.scale=1; } if (source != null) { final float[] imageDims=getImageDims(); final float imageWidth=imageDims[0]; final float imageHeight=imageDims[1]; mMinScale=Math.max(w / imageWidth,h / imageHeight); mRenderer.scale=Math.max(mMinScale,mRenderer.scale); } } }
private void updateMinScale(int w,int h,TileSource source,boolean resetScale){ synchronized (mLock) { if (resetScale) { mRenderer.scale=1; } if (source != null) { final float[] imageDims=getImageDims(); final float imageWidth=imageDims[0]; final float imageHeight=imageDims[1]; mMinScale=Math.max(w / imageWidth,h / imageHeight); mRenderer.scale=Math.max(mMinScale,resetScale ? Float.MIN_VALUE : mRenderer.scale); } } }
null
43
43
43
public boolean cropBitmap(){ boolean failure=false; WallpaperManager wallpaperManager=null; if (mSetWallpaper) { wallpaperManager=WallpaperManager.getInstance(mContext.getApplicationContext()); } if (mSetWallpaper && mNoCrop) { try { InputStream is=regenerateInputStream(); if (is != null) { wallpaperManager.setStream(is); Utils.closeSilently(is); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } return !failure; } else { Rect roundedTrueCrop=new Rect(); Matrix rotateMatrix=new Matrix(); Matrix inverseRotateMatrix=new Matrix(); if (mRotation > 0) { rotateMatrix.setRotate(mRotation); inverseRotateMatrix.setRotate(-mRotation); mCropBounds.roundOut(roundedTrueCrop); mCropBounds=new RectF(roundedTrueCrop); Point bounds=getImageBounds(); if (bounds == null) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } float[] rotatedBounds=new float[]{bounds.x,bounds.y}; rotateMatrix.mapPoints(rotatedBounds); rotatedBounds[0]=Math.abs(rotatedBounds[0]); rotatedBounds[1]=Math.abs(rotatedBounds[1]); mCropBounds.offset(-rotatedBounds[0] / 2,-rotatedBounds[1] / 2); inverseRotateMatrix.mapRect(mCropBounds); mCropBounds.offset(bounds.x / 2,bounds.y / 2); } mCropBounds.roundOut(roundedTrueCrop); if (roundedTrueCrop.width() <= 0 || roundedTrueCrop.height() <= 0) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } int scaleDownSampleSize=Math.max(1,Math.min(roundedTrueCrop.width() / mOutWidth,roundedTrueCrop.height() / mOutHeight)); BitmapRegionDecoder decoder=null; InputStream is=null; try { is=regenerateInputStream(); if (is == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } decoder=BitmapRegionDecoder.newInstance(is,false); Utils.closeSilently(is); } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString(),e); } finally { Utils.closeSilently(is); is=null; } Bitmap crop=null; if (decoder != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } crop=decoder.decodeRegion(roundedTrueCrop,options); decoder.recycle(); } if (crop == null) { is=regenerateInputStream(); Bitmap fullSize=null; if (is != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } fullSize=BitmapFactory.decodeStream(is,null,options); Utils.closeSilently(is); } if (fullSize != null) { mCropBounds.left/=scaleDownSampleSize; mCropBounds.top/=scaleDownSampleSize; mCropBounds.bottom/=scaleDownSampleSize; mCropBounds.right/=scaleDownSampleSize; mCropBounds.roundOut(roundedTrueCrop); crop=Bitmap.createBitmap(fullSize,roundedTrueCrop.left,roundedTrueCrop.top,roundedTrueCrop.width(),roundedTrueCrop.height()); } } if (crop == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } if (mOutWidth > 0 && mOutHeight > 0 || mRotation > 0) { float[] dimsAfter=new float[]{crop.getWidth(),crop.getHeight()}; rotateMatrix.mapPoints(dimsAfter); dimsAfter[0]=Math.abs(dimsAfter[0]); dimsAfter[1]=Math.abs(dimsAfter[1]); if (!(mOutWidth > 0 && mOutHeight > 0)) { mOutWidth=Math.round(dimsAfter[0]); mOutHeight=Math.round(dimsAfter[1]); } RectF cropRect=new RectF(0,0,dimsAfter[0],dimsAfter[1]); RectF returnRect=new RectF(0,0,mOutWidth,mOutHeight); Matrix m=new Matrix(); if (mRotation == 0) { m.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); } else { Matrix m1=new Matrix(); m1.setTranslate(-crop.getWidth() / 2f,-crop.getHeight() / 2f); Matrix m2=new Matrix(); m2.setRotate(mRotation); Matrix m3=new Matrix(); m3.setTranslate(dimsAfter[0] / 2f,dimsAfter[1] / 2f); Matrix m4=new Matrix(); m4.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); Matrix c1=new Matrix(); c1.setConcat(m2,m1); Matrix c2=new Matrix(); c2.setConcat(m4,m3); m.setConcat(c2,c1); } Bitmap tmp=Bitmap.createBitmap((int)returnRect.width(),(int)returnRect.height(),Bitmap.Config.ARGB_8888); if (tmp != null) { Canvas c=new Canvas(tmp); Paint p=new Paint(); p.setFilterBitmap(true); c.drawBitmap(crop,m,p); crop=tmp; } } if (mSaveCroppedBitmap) { mCroppedBitmap=crop; } CompressFormat cf=convertExtensionToCompressFormat(getFileExtension(mOutputFormat)); ByteArrayOutputStream tmpOut=new ByteArrayOutputStream(2048); if (crop.compress(cf,DEFAULT_COMPRESS_QUALITY,tmpOut)) { if (mSetWallpaper && wallpaperManager != null) { try { byte[] outByteArray=tmpOut.toByteArray(); wallpaperManager.setStream(new ByteArrayInputStream(outByteArray)); if (mOnBitmapCroppedHandler != null) { mOnBitmapCroppedHandler.onBitmapCropped(outByteArray); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } } } else { Log.w(LOGTAG,"String_Node_Str"); failure=true; } } return !failure; }
public boolean cropBitmap(){ boolean failure=false; WallpaperManager wallpaperManager=null; if (mSetWallpaper) { wallpaperManager=WallpaperManager.getInstance(mContext.getApplicationContext()); } if (mSetWallpaper && mNoCrop) { try { InputStream is=regenerateInputStream(); if (is != null) { wallpaperManager.setStream(is); Utils.closeSilently(is); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } return !failure; } else { Rect roundedTrueCrop=new Rect(); Matrix rotateMatrix=new Matrix(); Matrix inverseRotateMatrix=new Matrix(); Point bounds=getImageBounds(); if (mRotation > 0) { rotateMatrix.setRotate(mRotation); inverseRotateMatrix.setRotate(-mRotation); mCropBounds.roundOut(roundedTrueCrop); mCropBounds=new RectF(roundedTrueCrop); if (bounds == null) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } float[] rotatedBounds=new float[]{bounds.x,bounds.y}; rotateMatrix.mapPoints(rotatedBounds); rotatedBounds[0]=Math.abs(rotatedBounds[0]); rotatedBounds[1]=Math.abs(rotatedBounds[1]); mCropBounds.offset(-rotatedBounds[0] / 2,-rotatedBounds[1] / 2); inverseRotateMatrix.mapRect(mCropBounds); mCropBounds.offset(bounds.x / 2,bounds.y / 2); } mCropBounds.roundOut(roundedTrueCrop); if (roundedTrueCrop.width() <= 0 || roundedTrueCrop.height() <= 0) { Log.w(LOGTAG,"String_Node_Str"); failure=true; return false; } int scaleDownSampleSize=Math.max(1,Math.min(roundedTrueCrop.width() / mOutWidth,roundedTrueCrop.height() / mOutHeight)); BitmapRegionDecoder decoder=null; InputStream is=null; try { is=regenerateInputStream(); if (is == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } decoder=BitmapRegionDecoder.newInstance(is,false); Utils.closeSilently(is); } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString(),e); } finally { Utils.closeSilently(is); is=null; } Bitmap crop=null; if (decoder != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } crop=decoder.decodeRegion(roundedTrueCrop,options); decoder.recycle(); } if (crop == null) { is=regenerateInputStream(); Bitmap fullSize=null; if (is != null) { BitmapFactory.Options options=new BitmapFactory.Options(); if (scaleDownSampleSize > 1) { options.inSampleSize=scaleDownSampleSize; } fullSize=BitmapFactory.decodeStream(is,null,options); Utils.closeSilently(is); } if (fullSize != null) { scaleDownSampleSize=bounds.x / fullSize.getWidth(); mCropBounds.left/=scaleDownSampleSize; mCropBounds.top/=scaleDownSampleSize; mCropBounds.bottom/=scaleDownSampleSize; mCropBounds.right/=scaleDownSampleSize; mCropBounds.roundOut(roundedTrueCrop); if (roundedTrueCrop.width() > fullSize.getWidth()) { roundedTrueCrop.right=roundedTrueCrop.left + fullSize.getWidth(); } if (roundedTrueCrop.right > fullSize.getWidth()) { int adjustment=roundedTrueCrop.left - Math.max(0,roundedTrueCrop.right - roundedTrueCrop.width()); roundedTrueCrop.left-=adjustment; roundedTrueCrop.right-=adjustment; } if (roundedTrueCrop.height() > fullSize.getHeight()) { roundedTrueCrop.bottom=roundedTrueCrop.top + fullSize.getHeight(); } if (roundedTrueCrop.bottom > fullSize.getHeight()) { int adjustment=roundedTrueCrop.top - Math.max(0,roundedTrueCrop.bottom - roundedTrueCrop.height()); roundedTrueCrop.top-=adjustment; roundedTrueCrop.bottom-=adjustment; } crop=Bitmap.createBitmap(fullSize,roundedTrueCrop.left,roundedTrueCrop.top,roundedTrueCrop.width(),roundedTrueCrop.height()); } } if (crop == null) { Log.w(LOGTAG,"String_Node_Str" + mInUri.toString()); failure=true; return false; } if (mOutWidth > 0 && mOutHeight > 0 || mRotation > 0) { float[] dimsAfter=new float[]{crop.getWidth(),crop.getHeight()}; rotateMatrix.mapPoints(dimsAfter); dimsAfter[0]=Math.abs(dimsAfter[0]); dimsAfter[1]=Math.abs(dimsAfter[1]); if (!(mOutWidth > 0 && mOutHeight > 0)) { mOutWidth=Math.round(dimsAfter[0]); mOutHeight=Math.round(dimsAfter[1]); } RectF cropRect=new RectF(0,0,dimsAfter[0],dimsAfter[1]); RectF returnRect=new RectF(0,0,mOutWidth,mOutHeight); Matrix m=new Matrix(); if (mRotation == 0) { m.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); } else { Matrix m1=new Matrix(); m1.setTranslate(-crop.getWidth() / 2f,-crop.getHeight() / 2f); Matrix m2=new Matrix(); m2.setRotate(mRotation); Matrix m3=new Matrix(); m3.setTranslate(dimsAfter[0] / 2f,dimsAfter[1] / 2f); Matrix m4=new Matrix(); m4.setRectToRect(cropRect,returnRect,Matrix.ScaleToFit.FILL); Matrix c1=new Matrix(); c1.setConcat(m2,m1); Matrix c2=new Matrix(); c2.setConcat(m4,m3); m.setConcat(c2,c1); } Bitmap tmp=Bitmap.createBitmap((int)returnRect.width(),(int)returnRect.height(),Bitmap.Config.ARGB_8888); if (tmp != null) { Canvas c=new Canvas(tmp); Paint p=new Paint(); p.setFilterBitmap(true); c.drawBitmap(crop,m,p); crop=tmp; } } if (mSaveCroppedBitmap) { mCroppedBitmap=crop; } CompressFormat cf=convertExtensionToCompressFormat(getFileExtension(mOutputFormat)); ByteArrayOutputStream tmpOut=new ByteArrayOutputStream(2048); if (crop.compress(cf,DEFAULT_COMPRESS_QUALITY,tmpOut)) { if (mSetWallpaper && wallpaperManager != null) { try { byte[] outByteArray=tmpOut.toByteArray(); wallpaperManager.setStream(new ByteArrayInputStream(outByteArray)); if (mOnBitmapCroppedHandler != null) { mOnBitmapCroppedHandler.onBitmapCropped(outByteArray); } } catch ( IOException e) { Log.w(LOGTAG,"String_Node_Str",e); failure=true; } } } else { Log.w(LOGTAG,"String_Node_Str"); failure=true; } } return !failure; }
null
44
44
44
public void run(){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); }
public void run(){ updateWallpaperDimensions(outWidth,outHeight); if (finishActivityWhenDone) { setResult(Activity.RESULT_OK); finish(); } }
null
45
45
45
static public void suggestWallpaperDimension(Resources res,final SharedPreferences sharedPrefs,WindowManager windowManager,final WallpaperManager wallpaperManager){ final Point defaultWallpaperSize=getDefaultWallpaperSize(res,windowManager); new Thread("String_Node_Str"){ public void run(){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); } } .start(); }
static public void suggestWallpaperDimension(Resources res,final SharedPreferences sharedPrefs,WindowManager windowManager,final WallpaperManager wallpaperManager){ final Point defaultWallpaperSize=getDefaultWallpaperSize(res,windowManager); new AsyncTask<Void,Void,Void>(){ public Void doInBackground( Void... args){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); return null; } } .executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,(Void)null); }
null
46
46
46
@Override protected Boolean doInBackground(Void... params){ return cropBitmap(); }
public Void doInBackground(Void... args){ int savedWidth=sharedPrefs.getInt(WALLPAPER_WIDTH_KEY,defaultWallpaperSize.x); int savedHeight=sharedPrefs.getInt(WALLPAPER_HEIGHT_KEY,defaultWallpaperSize.y); wallpaperManager.suggestDesiredDimensions(savedWidth,savedHeight); return null; }
null
47
47
47
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app,boolean execInFg) throws RemoteException { if (app.thread == null) { throw new RemoteException(); } if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app.uid); r.app=app; r.restartTime=r.lastActivity=SystemClock.uptimeMillis(); app.services.add(r); bumpServiceExecutingLocked(r,execInFg,"String_Node_Str"); mAm.updateLruProcessLocked(app,false,null); mAm.updateOomAdjLocked(); boolean created=false; try { String nameTerm; int lastPeriod=r.shortName.lastIndexOf('.'); nameTerm=lastPeriod >= 0 ? r.shortName.substring(lastPeriod) : r.shortName; EventLogTags.writeAmCreateService(r.userId,System.identityHashCode(r),nameTerm,r.app.uid,r.app.pid); synchronized (r.stats.getBatteryStats()) { r.stats.startLaunchedLocked(); } mAm.ensurePackageDexOpt(r.serviceInfo.packageName); app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_SERVICE); app.thread.scheduleCreateService(r,r.serviceInfo,mAm.compatibilityInfoForPackageLocked(r.serviceInfo.applicationInfo),app.repProcState); r.postNotification(); created=true; } finally { if (!created) { app.services.remove(r); r.app=null; scheduleServiceRestartLocked(r,false); } } requestServiceBindingsLocked(r,execInFg); if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) { r.pendingStarts.add(new ServiceRecord.StartItem(r,false,r.makeNextStartId(),null,null)); } sendServiceArgsLocked(r,execInFg,true); if (r.delayed) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } }
private final void realStartServiceLocked(ServiceRecord r,ProcessRecord app,boolean execInFg) throws RemoteException { if (app.thread == null) { throw new RemoteException(); } if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app.uid); r.app=app; r.restartTime=r.lastActivity=SystemClock.uptimeMillis(); app.services.add(r); bumpServiceExecutingLocked(r,execInFg,"String_Node_Str"); mAm.updateLruProcessLocked(app,false,null); mAm.updateOomAdjLocked(); boolean created=false; try { String nameTerm; int lastPeriod=r.shortName.lastIndexOf('.'); nameTerm=lastPeriod >= 0 ? r.shortName.substring(lastPeriod) : r.shortName; EventLogTags.writeAmCreateService(r.userId,System.identityHashCode(r),nameTerm,r.app.uid,r.app.pid); synchronized (r.stats.getBatteryStats()) { r.stats.startLaunchedLocked(); } mAm.ensurePackageDexOpt(r.serviceInfo.packageName); app.forceProcessStateUpTo(ActivityManager.PROCESS_STATE_SERVICE); app.thread.scheduleCreateService(r,r.serviceInfo,mAm.compatibilityInfoForPackageLocked(r.serviceInfo.applicationInfo),app.repProcState); r.postNotification(); created=true; } finally { if (!created) { app.services.remove(r); r.app=null; scheduleServiceRestartLocked(r,false); } } requestServiceBindingsLocked(r,execInFg); if (r.startRequested && r.callStart && r.pendingStarts.size() == 0) { r.pendingStarts.add(new ServiceRecord.StartItem(r,false,r.makeNextStartId(),null,null)); } sendServiceArgsLocked(r,execInFg,true); if (r.delayed) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } }
null
48
48
48
private final String bringUpServiceLocked(ServiceRecord r,int intentFlags,boolean execInFg,boolean whileRestarting){ if (r.app != null && r.app.thread != null) { sendServiceArgsLocked(r,execInFg,false); return null; } if (!whileRestarting && r.restartDelay > 0) { return null; } if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.intent); if (mRestartingServices.remove(r)) { clearRestartingIfNeededLocked(r); } if (r.delayed) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (mAm.mStartedUsers.get(r.userId) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"+ r.userId+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } try { AppGlobals.getPackageManager().setPackageStoppedState(r.packageName,false,r.userId); } catch ( RemoteException e) { } catch ( IllegalArgumentException e) { Slog.w(TAG,"String_Node_Str" + r.packageName + "String_Node_Str"+ e); } final boolean isolated=(r.serviceInfo.flags & ServiceInfo.FLAG_ISOLATED_PROCESS) != 0; final String procName=r.processName; ProcessRecord app; if (!isolated) { app=mAm.getProcessRecordLocked(procName,r.appInfo.uid,false); if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app); if (app != null && app.thread != null) { try { app.addPackage(r.appInfo.packageName,mAm.mProcessStats); realStartServiceLocked(r,app,execInFg); return null; } catch ( RemoteException e) { Slog.w(TAG,"String_Node_Str" + r.shortName,e); } } } else { app=r.isolatedProc; } if (app == null) { if ((app=mAm.startProcessLocked(procName,r.appInfo,true,intentFlags,"String_Node_Str",r.name,false,isolated,false)) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } if (isolated) { r.isolatedProc=app; } } if (!mPendingServices.contains(r)) { mPendingServices.add(r); } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } return null; }
private final String bringUpServiceLocked(ServiceRecord r,int intentFlags,boolean execInFg,boolean whileRestarting){ if (r.app != null && r.app.thread != null) { sendServiceArgsLocked(r,execInFg,false); return null; } if (!whileRestarting && r.restartDelay > 0) { return null; } if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.intent); if (mRestartingServices.remove(r)) { clearRestartingIfNeededLocked(r); } if (r.delayed) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); getServiceMap(r.userId).mDelayedStartList.remove(r); r.delayed=false; } if (mAm.mStartedUsers.get(r.userId) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"+ r.userId+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } try { AppGlobals.getPackageManager().setPackageStoppedState(r.packageName,false,r.userId); } catch ( RemoteException e) { } catch ( IllegalArgumentException e) { Slog.w(TAG,"String_Node_Str" + r.packageName + "String_Node_Str"+ e); } final boolean isolated=(r.serviceInfo.flags & ServiceInfo.FLAG_ISOLATED_PROCESS) != 0; final String procName=r.processName; ProcessRecord app; if (!isolated) { app=mAm.getProcessRecordLocked(procName,r.appInfo.uid,false); if (DEBUG_MU) Slog.v(TAG_MU,"String_Node_Str" + r.appInfo.uid + "String_Node_Str"+ app); if (app != null && app.thread != null) { try { app.addPackage(r.appInfo.packageName,mAm.mProcessStats); realStartServiceLocked(r,app,execInFg); return null; } catch ( RemoteException e) { Slog.w(TAG,"String_Node_Str" + r.shortName,e); } } } else { app=r.isolatedProc; } if (app == null) { if ((app=mAm.startProcessLocked(procName,r.appInfo,true,intentFlags,"String_Node_Str",r.name,false,isolated,false)) == null) { String msg="String_Node_Str" + r.appInfo.packageName + "String_Node_Str"+ r.appInfo.uid+ "String_Node_Str"+ r.intent.getIntent()+ "String_Node_Str"; Slog.w(TAG,msg); bringDownServiceLocked(r); return msg; } if (isolated) { r.isolatedProc=app; } } if (!mPendingServices.contains(r)) { mPendingServices.add(r); } if (r.delayedStop) { r.delayedStop=false; if (r.startRequested) { if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); stopServiceLocked(r); } } return null; }
null
49
49
49
void rescheduleDelayedStarts(){ removeMessages(MSG_BG_START_TIMEOUT); final long now=SystemClock.uptimeMillis(); for (int i=0, N=mStartingBackground.size(); i < N; i++) { ServiceRecord r=mStartingBackground.get(i); if (r.startingBgTimeout <= now) { Slog.i(TAG,"String_Node_Str" + r); mStartingBackground.remove(i); N--; } } while (mDelayedStartList.size() > 0 && mStartingBackground.size() < mMaxStartingBackground) { ServiceRecord r=mDelayedStartList.remove(0); if (DEBUG_DELAYED_STATS) Slog.v(TAG,"String_Node_Str" + r); if (r.pendingStarts.size() <= 0) { Slog.w(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.startRequested+ "String_Node_Str"+ r.delayedStop); } if (DEBUG_DELAYED_SERVICE) { if (mDelayedStartList.size() > 0) { Slog.v(TAG,"String_Node_Str"); for (int i=0; i < mDelayedStartList.size(); i++) { Slog.v(TAG,"String_Node_Str" + i + "String_Node_Str"+ mDelayedStartList.get(i)); } } } r.delayed=false; startServiceInnerLocked(this,r.pendingStarts.get(0).intent,r,false,true); } if (mStartingBackground.size() > 0) { ServiceRecord next=mStartingBackground.get(0); long when=next.startingBgTimeout > now ? next.startingBgTimeout : now; if (DEBUG_DELAYED_SERVICE) Slog.v(TAG,"String_Node_Str" + next + "String_Node_Str"+ when); Message msg=obtainMessage(MSG_BG_START_TIMEOUT); sendMessageAtTime(msg,when); } if (mStartingBackground.size() < mMaxStartingBackground) { mAm.backgroundServicesFinishedLocked(mUserId); } }
void rescheduleDelayedStarts(){ removeMessages(MSG_BG_START_TIMEOUT); final long now=SystemClock.uptimeMillis(); for (int i=0, N=mStartingBackground.size(); i < N; i++) { ServiceRecord r=mStartingBackground.get(i); if (r.startingBgTimeout <= now) { Slog.i(TAG,"String_Node_Str" + r); mStartingBackground.remove(i); N--; } } while (mDelayedStartList.size() > 0 && mStartingBackground.size() < mMaxStartingBackground) { ServiceRecord r=mDelayedStartList.remove(0); if (DEBUG_DELAYED_STARTS) Slog.v(TAG,"String_Node_Str" + r); if (r.pendingStarts.size() <= 0) { Slog.w(TAG,"String_Node_Str" + r + "String_Node_Str"+ r.startRequested+ "String_Node_Str"+ r.delayedStop); } if (DEBUG_DELAYED_SERVICE) { if (mDelayedStartList.size() > 0) { Slog.v(TAG,"String_Node_Str"); for (int i=0; i < mDelayedStartList.size(); i++) { Slog.v(TAG,"String_Node_Str" + i + "String_Node_Str"+ mDelayedStartList.get(i)); } } } r.delayed=false; startServiceInnerLocked(this,r.pendingStarts.get(0).intent,r,false,true); } if (mStartingBackground.size() > 0) { ServiceRecord next=mStartingBackground.get(0); long when=next.startingBgTimeout > now ? next.startingBgTimeout : now; if (DEBUG_DELAYED_SERVICE) Slog.v(TAG,"String_Node_Str" + next + "String_Node_Str"+ when); Message msg=obtainMessage(MSG_BG_START_TIMEOUT); sendMessageAtTime(msg,when); } if (mStartingBackground.size() < mMaxStartingBackground) { mAm.backgroundServicesFinishedLocked(mUserId); } }
null
50
50
50
final void killServicesLocked(ProcessRecord app,boolean allowRestart){ if (false) { if (app.services.size() > 0) { Iterator<ServiceRecord> it=app.services.iterator(); while (it.hasNext()) { ServiceRecord r=it.next(); for (int conni=r.connections.size() - 1; conni >= 0; conni--) { ArrayList<ConnectionRecord> cl=r.connections.valueAt(conni); for (int i=0; i < cl.size(); i++) { ConnectionRecord c=cl.get(i); if (c.binding.client != app) { try { } catch ( Exception e) { Slog.w(TAG,"String_Node_Str" + r.shortName + "String_Node_Str"+ app.processName,e); } } } } } } } for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); synchronized (sr.stats.getBatteryStats()) { sr.stats.stopLaunchedLocked(); } if (sr.app != null && !sr.app.persistent) { sr.app.services.remove(sr); } sr.app=null; sr.isolatedProc=null; sr.executeNesting=0; sr.forceClearTracker(); if (mDestroyingServices.remove(sr)) { if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } final int numClients=sr.bindings.size(); for (int bindingi=numClients - 1; bindingi >= 0; bindingi--) { IntentBindRecord b=sr.bindings.valueAt(bindingi); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + b + "String_Node_Str"+ b.hasBound); b.binder=null; b.requested=b.received=b.hasBound=false; } } for (int i=app.connections.size() - 1; i >= 0; i--) { ConnectionRecord r=app.connections.valueAt(i); removeConnectionLocked(r,app,null); } app.connections.clear(); ServiceMap smap=getServiceMap(app.userId); for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); if (smap.mServicesByName.get(sr.name) != sr) { ServiceRecord cur=smap.mServicesByName.get(sr.name); Slog.wtf(TAG,"String_Node_Str" + sr + "String_Node_Str"+ app+ "String_Node_Str"+ cur); app.services.removeAt(i); continue; } if (allowRestart && sr.crashCount >= 2 && (sr.serviceInfo.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) { Slog.w(TAG,"String_Node_Str" + sr.crashCount + "String_Node_Str"+ sr); EventLog.writeEvent(EventLogTags.AM_SERVICE_CRASHED_TOO_MUCH,sr.userId,sr.crashCount,sr.shortName,app.pid); bringDownServiceLocked(sr); } else if (!allowRestart) { bringDownServiceLocked(sr); } else { boolean canceled=scheduleServiceRestartLocked(sr,true); if (sr.startRequested && (sr.stopIfKilled || canceled)) { if (sr.pendingStarts.size() == 0) { sr.startRequested=false; if (sr.tracker != null) { sr.tracker.setStarted(false,mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis()); } if (!sr.hasAutoCreateConnections()) { bringDownServiceLocked(sr); } } } } } if (!allowRestart) { app.services.clear(); for (int i=mRestartingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mRestartingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mRestartingServices.remove(i); clearRestartingIfNeededLocked(r); } } for (int i=mPendingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mPendingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mPendingServices.remove(i); } } } int i=mDestroyingServices.size(); while (i > 0) { i--; ServiceRecord sr=mDestroyingServices.get(i); if (sr.app == app) { sr.forceClearTracker(); mDestroyingServices.remove(i); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } } app.executingServices.clear(); }
final void killServicesLocked(ProcessRecord app,boolean allowRestart){ if (false) { if (app.services.size() > 0) { Iterator<ServiceRecord> it=app.services.iterator(); while (it.hasNext()) { ServiceRecord r=it.next(); for (int conni=r.connections.size() - 1; conni >= 0; conni--) { ArrayList<ConnectionRecord> cl=r.connections.valueAt(conni); for (int i=0; i < cl.size(); i++) { ConnectionRecord c=cl.get(i); if (c.binding.client != app) { try { } catch ( Exception e) { Slog.w(TAG,"String_Node_Str" + r.shortName + "String_Node_Str"+ app.processName,e); } } } } } } } for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); synchronized (sr.stats.getBatteryStats()) { sr.stats.stopLaunchedLocked(); } if (sr.app != app && sr.app != null && !sr.app.persistent) { sr.app.services.remove(sr); } sr.app=null; sr.isolatedProc=null; sr.executeNesting=0; sr.forceClearTracker(); if (mDestroyingServices.remove(sr)) { if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } final int numClients=sr.bindings.size(); for (int bindingi=numClients - 1; bindingi >= 0; bindingi--) { IntentBindRecord b=sr.bindings.valueAt(bindingi); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + b + "String_Node_Str"+ b.hasBound); b.binder=null; b.requested=b.received=b.hasBound=false; } } for (int i=app.connections.size() - 1; i >= 0; i--) { ConnectionRecord r=app.connections.valueAt(i); removeConnectionLocked(r,app,null); } app.connections.clear(); ServiceMap smap=getServiceMap(app.userId); for (int i=app.services.size() - 1; i >= 0; i--) { ServiceRecord sr=app.services.valueAt(i); if (!app.persistent) { app.services.remove(sr); } if (smap.mServicesByName.get(sr.name) != sr) { ServiceRecord cur=smap.mServicesByName.get(sr.name); Slog.wtf(TAG,"String_Node_Str" + sr + "String_Node_Str"+ app+ "String_Node_Str"+ cur); app.services.removeAt(i); continue; } if (allowRestart && sr.crashCount >= 2 && (sr.serviceInfo.applicationInfo.flags & ApplicationInfo.FLAG_PERSISTENT) == 0) { Slog.w(TAG,"String_Node_Str" + sr.crashCount + "String_Node_Str"+ sr); EventLog.writeEvent(EventLogTags.AM_SERVICE_CRASHED_TOO_MUCH,sr.userId,sr.crashCount,sr.shortName,app.pid); bringDownServiceLocked(sr); } else if (!allowRestart) { bringDownServiceLocked(sr); } else { boolean canceled=scheduleServiceRestartLocked(sr,true); if (sr.startRequested && (sr.stopIfKilled || canceled)) { if (sr.pendingStarts.size() == 0) { sr.startRequested=false; if (sr.tracker != null) { sr.tracker.setStarted(false,mAm.mProcessStats.getMemFactorLocked(),SystemClock.uptimeMillis()); } if (!sr.hasAutoCreateConnections()) { bringDownServiceLocked(sr); } } } } } if (!allowRestart) { app.services.clear(); for (int i=mRestartingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mRestartingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mRestartingServices.remove(i); clearRestartingIfNeededLocked(r); } } for (int i=mPendingServices.size() - 1; i >= 0; i--) { ServiceRecord r=mPendingServices.get(i); if (r.processName.equals(app.processName) && r.serviceInfo.applicationInfo.uid == app.info.uid) { mPendingServices.remove(i); } } } int i=mDestroyingServices.size(); while (i > 0) { i--; ServiceRecord sr=mDestroyingServices.get(i); if (sr.app == app) { sr.forceClearTracker(); mDestroyingServices.remove(i); if (DEBUG_SERVICE) Slog.v(TAG,"String_Node_Str" + sr); } } app.executingServices.clear(); }
null
End of preview.