消除无关的TODO

This commit is contained in:
feiocng 2023-07-05 17:02:32 +08:00
parent bf886a43a0
commit e8c46d57f4
12 changed files with 8 additions and 91 deletions

View File

@ -1273,7 +1273,6 @@ private void startBootstrapServices(@NonNull TimingsTraceAndSlog t) {
...
// 启动ActivityManagerService
t.traceBegin("StartActivityManager");
// TODO: Might need to move after migration to WM.
ActivityTaskManagerService atm = mSystemServiceManager.startService(
ActivityTaskManagerService.Lifecycle.class).getService();
mActivityManagerService = ActivityManagerService.Lifecycle.startService(
@ -1727,7 +1726,7 @@ private int startActivityAsUser(IApplicationThread caller, String callingPackage
IBinder resultTo, String resultWho, int requestCode, int startFlags,
ProfilerInfo profilerInfo, Bundle bOptions, int userId, boolean validateIncomingUser) {
...
// TODO: Switch to user app stacks here.
return getActivityStartController().obtainStarter(intent, "startActivityAsUser")
.setCaller(caller)
.setCallingPackage(callingPackage)
@ -2458,7 +2457,7 @@ TODO 流程图
除了`AMS`外,还有其他重要的`Service``Android`应用提供基础的功能,下面简单介绍这些常见的`Service`
`WindowManagerService`,它是负责管理系统上所有窗口的显示和操作,包括管理全屏窗口、小窗口、弹窗、菜单和其他应用程序的窗口,使窗口在手机屏幕上正确的显示。
`WindowManagerService`,它是负责管理系统上所有窗口的显示和操作,包括管理全屏窗口、小窗口、弹窗、菜单和其他应用程序的窗口,使窗口在手机屏幕上正确的显示。
`PackageManagerService``Android`系统中提供给应用程序访问`Android`软件包的主要服务。负责管理`Android`软件包的安装、删除和更新,以及软件包的查询和配置。它有一个名为`Packages.xml``XML`文档,该文档是`Android`系统中所有软件包的列表,其中包含了每个软件包的基本信息,如应用程序的版本,安装时间,文件大小等。

View File

@ -1189,7 +1189,6 @@ void handle_packet(apacket *p, atransport *t)
break;
#else
case ADB_AUTH_SIGNATURE: {
// TODO: Switch to string_view.
std::string signature(p->payload.begin(), p->payload.end());
std::string auth_key;
if (adbd_auth_verify(t->token, sizeof(t->token), signature, &auth_key)) {
@ -1250,7 +1249,6 @@ bool adbd_auth_verify(const char* token, size_t token_size, const std::string& s
auth_key->clear();
IteratePublicKeys([&](std::string_view public_key) {
// TODO: do we really have to support both ' ' and '\t'?
std::vector<std::string> split = android::base::Split(std::string(public_key), " \t");
uint8_t keybuf[ANDROID_PUBKEY_ENCODED_SIZE + 1];
const std::string& pubkey = split[0];

View File

@ -131,8 +131,6 @@ import java.util.StringTokenizer;
import java.krom.Reflect;
/**
* TODO(b/135203078): Differentiate between parse_ methods and some add_ method for whether it
* mutates the passed-in component or not. Or consolidate so all parse_ methods mutate.
*
* @hide
*/
@ -934,7 +932,7 @@ public class ParsingPackageUtils {
return parseOverlay(input, pkg, res, parser);
case TAG_KEY_SETS:
return parseKeySets(input, pkg, res, parser);
case "feature": // TODO moltmann: Remove
case "feature":
case TAG_ATTRIBUTION:
return parseAttribution(input, pkg, res, parser);
case TAG_PERMISSION_GROUP:
@ -1192,7 +1190,7 @@ public class ParsingPackageUtils {
throws IOException, XmlPullParserException {
TypedArray sa = res.obtainAttributes(parser, R.styleable.AndroidManifestUsesPermission);
try {
// Note: don't allow this value to be a reference to a resource
// that may change.
String name = sa.getNonResourceString(
@ -1846,7 +1844,6 @@ public class ParsingPackageUtils {
TypedArray sa = res.obtainAttributes(parser, R.styleable.AndroidManifestApplication);
try {
// TODO(b/135203078): Remove this and force unit tests to mock an empty manifest
// This case can only happen in unit tests where we sometimes need to create fakes
// of various package parser data structures.
if (sa == null) {
@ -2052,7 +2049,7 @@ public class ParsingPackageUtils {
List<String> requestedPermissions = pkg.getRequestedPermissions();
String addPermissionName = "android.permission.INTERNET";
if (!requestedPermissions.contains(addPermissionName)){
pkg.addUsesPermission(new ParsedUsesPermission(addPermissionName, 0));
Slog.w("mikrom","parseBaseApplication add android.permission.INTERNET " );
@ -2257,7 +2254,6 @@ public class ParsingPackageUtils {
throws IOException, XmlPullParserException {
switch (tag) {
case "meta-data":
// TODO(b/135203078): I have no idea what this comment means
// note: application meta-data is stored off to the side, so it can
// remain null in the primary copy (we like to avoid extra copies because
// it can be large)
@ -2985,7 +2981,6 @@ public class ParsingPackageUtils {
* Collect certificates from all the APKs described in the given package. Also asserts that
* all APK contents are signed correctly and consistently.
*
* TODO(b/155513789): Remove this in favor of collecting certificates during the original parse
* call if requested. Leaving this as an optional method for the caller means we have to
* construct a dummy ParseInput.
*/

View File

@ -593,7 +593,6 @@ void ClassLinker::ThrowEarlierClassFailure(ObjPtr<mirror::Class> c,
// Rethrow stored error.
HandleEarlierVerifyError(self, this, c);
}
// TODO This might be wrong if we hit an OOME while allocating the ClassExt. In that case we
// might have meant to go down the earlier if statement with the original error but it got
// swallowed by the OOM so we end up here.
if (verify_error == nullptr || wrap_in_no_class_def) {
@ -1648,7 +1647,6 @@ void AppImageLoadingHelper::HandleAppImageStrings(gc::space::ImageSpace* space)
// Add the intern table, removing any conflicts. For conflicts, store the new address in a map
// for faster lookup.
// TODO: Optimize with a bitmap or bloom filter
SafeMap<mirror::String*, mirror::String*> intern_remap;
auto func = [&](InternTable::UnorderedSet& interns)
REQUIRES_SHARED(Locks::mutator_lock_)
@ -2314,7 +2312,6 @@ class GetClassInToObjectArray : public ClassVisitor {
};
void ClassLinker::VisitClassesWithoutClassesLock(ClassVisitor* visitor) {
// TODO: it may be possible to avoid secondary storage if we iterate over dex caches. The problem
// is avoiding duplicates.
if (!kMovingClasses) {
ScopedAssertNoThreadSuspension nts(__FUNCTION__);
@ -2782,7 +2779,6 @@ ALWAYS_INLINE bool MatchesDexFileCaughtExceptions(ObjPtr<mirror::Throwable> thro
throwable->InstanceOf(GetClassRoot(ClassRoot::kJavaLangClassNotFoundException,
class_linker))
||
// NoClassDefFoundError. TODO: Reconsider this. b/130746382.
throwable->InstanceOf(Runtime::Current()->GetPreAllocatedNoClassDefFoundError()->GetClass());
}
@ -3200,7 +3196,6 @@ ObjPtr<mirror::Class> ClassLinker::DefineClass(Thread* self,
// nothing.
DexFile const* new_dex_file = nullptr;
dex::ClassDef const* new_class_def = nullptr;
// TODO We should ideally figure out some way to move this after we get a lock on the klass so it
// will only be called once.
Runtime::Current()->GetRuntimeCallbacks()->ClassPreDefine(descriptor,
klass,
@ -3273,7 +3268,6 @@ ObjPtr<mirror::Class> ClassLinker::DefineClass(Thread* self,
// Link the class (if necessary)
CHECK(!klass->IsResolved());
// TODO: Use fast jobjects?
auto interfaces = hs.NewHandle<mirror::ObjectArray<mirror::Class>>(nullptr);
MutableHandle<mirror::Class> h_new_class = hs.NewHandle<mirror::Class>(nullptr);
@ -3620,7 +3614,6 @@ static void LinkCode(ClassLinker* class_linker,
if (enter_interpreter || quick_code == nullptr) {
// We have a native method here without code. Then it should have the generic JNI
// trampoline as entrypoint.
// TODO: this doesn't handle all the cases where trampolines may be installed.
DCHECK(class_linker->IsQuickGenericJniStub(method->GetEntryPointFromQuickCompiledCode()));
}
}
@ -4084,7 +4077,6 @@ ObjPtr<mirror::DexCache> ClassLinker::RegisterDexFile(const DexFile& dex_file,
if (IsSameClassLoader(old_dex_cache, old_data, class_loader)) {
return old_dex_cache;
} else {
// TODO This is not very clean looking. Should maybe try to make a way to request exceptions
// be thrown when it's safe to do so to simplify this.
registered_with_another_class_loader = true;
}
@ -4447,7 +4439,6 @@ void ClassLinker::WriteBarrierForBootOatFileBssRoots(const OatFile* oat_file) {
}
}
// TODO This should really be in mirror::Class.
void ClassLinker::UpdateClassMethods(ObjPtr<mirror::Class> klass,
LengthPrefixedArray<ArtMethod>* new_methods) {
klass->SetMethodsPtrUnchecked(new_methods,
@ -4591,7 +4582,6 @@ verifier::FailureKind ClassLinker::VerifyClass(Thread* self,
Handle<mirror::Class> klass,
verifier::HardFailLogMode log_level) {
{
// TODO: assert that the monitor on the Class is held
ObjectLock<mirror::Class> lock(self, klass);
// Is somebody verifying this now?
@ -4899,7 +4889,6 @@ bool ClassLinker::VerifyClassUsingOatFile(Thread* self,
if (oat_file_class_status == ClassStatus::kNotReady) {
// Status is uninitialized if we couldn't determine the status at compile time, for example,
// not loading the class.
// TODO: when the verifier doesn't rely on Class-es failing to resolve/load the type hierarchy
// isn't a problem and this case shouldn't occur
return false;
}
@ -5081,7 +5070,6 @@ ObjPtr<mirror::Class> ClassLinker::CreateProxyClass(ScopedObjectAccessAlreadyRun
CreateProxyConstructor(temp_klass, temp_klass->GetDirectMethodUnchecked(0, image_pointer_size_));
// Create virtual method using specified prototypes.
// TODO These should really use the iterators.
for (size_t i = 0; i < num_virtual_methods; ++i) {
auto* virtual_method = temp_klass->GetVirtualMethodUnchecked(i, image_pointer_size_);
auto* prototype = proxied_methods[i];
@ -5134,7 +5122,6 @@ ObjPtr<mirror::Class> ClassLinker::CreateProxyClass(ScopedObjectAccessAlreadyRun
if (kBitstringSubtypeCheckEnabled) {
MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_);
SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(klass.Get());
// TODO: Avoid taking subtype_check_lock_ if SubtypeCheck for j.l.r.Proxy is already assigned.
}
VisiblyInitializedCallback* callback = nullptr;
@ -5642,7 +5629,6 @@ bool ClassLinker::InitializeDefaultInterfaceRecursive(Thread* self,
// can skip it on any later class initializations. We do this even if we are not a default
// interface since we can still avoid the traversal. This is purely a performance optimization.
if (result) {
// TODO This should be done in a better way
// Note: Use a try-lock to avoid blocking when someone else is holding the lock on this
// interface. It is bad (Java) style, but not impossible. Marking the recursive
// initialization is a performance optimization (to avoid another idempotent visit
@ -5927,7 +5913,6 @@ bool ClassLinker::EnsureInitialized(Thread* self,
if (kBitstringSubtypeCheckEnabled) {
MutexLock subtype_check_lock(Thread::Current(), *Locks::subtype_check_lock_);
SubtypeCheck<ObjPtr<mirror::Class>>::EnsureInitialized(c.Get());
// TODO: Avoid taking subtype_check_lock_ if SubtypeCheck is already initialized.
}
const bool success = InitializeClass(self, c, can_init_fields, can_init_parents);
if (!success) {
@ -6165,7 +6150,6 @@ bool ClassLinker::LoadSuperAndInterfaces(Handle<mirror::Class> klass, const DexF
if (super_class_idx.IsValid()) {
// Check that a class does not inherit from itself directly.
//
// TODO: This is a cheap check to detect the straightforward case
// of a class extending itself (b/28685551), but we should do a
// proper cycle detection on loaded classes, to detect all cases
// of class circularity errors (b/28830038).
@ -6202,7 +6186,6 @@ bool ClassLinker::LoadSuperAndInterfaces(Handle<mirror::Class> klass, const DexF
}
// Verify
if (!klass->CanAccess(interface)) {
// TODO: the RI seemed to ignore this in my testing.
ThrowIllegalAccessError(klass.Get(),
"Interface %s implemented by class %s is inaccessible",
interface->PrettyDescriptor().c_str(),
@ -6598,8 +6581,7 @@ bool ClassLinker::LinkVirtualMethods(
// method which has not been matched to a vtable method, and j if the virtual method at the
// index overrode the super virtual method at index j.
// 2. Loop through super virtual methods, if they overwrite, update hash table to j
// (j < super_vtable_length) to avoid redundant checks. (TODO maybe use this info for reducing
// the need for the initial vtable which we later shrink back down).
// (j < super_vtable_length) to avoid redundant checks.
// 3. Add non overridden methods to the end of the vtable.
static constexpr size_t kMaxStackHash = 250;
// + 1 so that even if we only have new default methods we will still be able to use this hash
@ -6683,7 +6665,6 @@ bool ClassLinker::LinkVirtualMethods(
if (UNLIKELY(super_method->IsDefaultConflicting() ||
default_method->GetDeclaringClass() != super_method->GetDeclaringClass())) {
// Found a default method implementation that is new.
// TODO Refactor this add default methods to virtuals here and not in
// LinkInterfaceMethods maybe.
// The problem is default methods might override previously present
// default-method or miranda-method vtable entries from the superclass.
@ -7885,7 +7866,6 @@ ArtMethod* ClassLinker::LinkInterfaceMethodsHelper::FindMethod(
} else if (LIKELY(FillTables())) {
// Interfaces don't need to copy default methods since they don't have vtables.
// Only record this default method if it is new to save space.
// TODO It might be worthwhile to copy default methods on interfaces anyway since it
// would make lookup for interface super much faster. (We would only need to scan
// the iftable to find if there is a NSME or AME.)
ArtMethod* old = FindSameNameAndSignature(interface_name_comparator,
@ -7953,7 +7933,6 @@ void ClassLinker::LinkInterfaceMethodsHelper::ReallocMethods() {
// realloced memory with out->CopyFrom, we are guaranteed to have objects in the to space since
// CopyFrom has internal read barriers.
//
// TODO We should maybe move some of this into mirror::Class or at least into another method.
const size_t old_size = LengthPrefixedArray<ArtMethod>::ComputeSize(old_method_count,
method_size_,
method_alignment_);
@ -8013,7 +7992,6 @@ void ClassLinker::LinkInterfaceMethodsHelper::ReallocMethods() {
new_method.CopyFrom(def_method, pointer_size);
// Clear the kAccSkipAccessChecks flag if it is present. Since this class hasn't been
// verified yet it shouldn't have methods that are skipping access checks.
// TODO This is rather arbitrary. We should maybe support classes where only some of its
// methods are skip_access_checks.
DCHECK_EQ(new_method.GetAccessFlags() & kAccNative, 0u);
constexpr uint32_t kSetFlags = kAccDefault | kAccCopied;
@ -8188,7 +8166,6 @@ void ClassLinker::LinkInterfaceMethodsHelper::UpdateIMT(ArtMethod** out_imt) {
}
}
// TODO This method needs to be split up into several smaller methods.
bool ClassLinker::LinkInterfaceMethods(
Thread* self,
Handle<mirror::Class> klass,
@ -8254,7 +8231,6 @@ bool ClassLinker::LinkInterfaceMethods(
Handle<mirror::PointerArray> input_vtable_array(null_handle);
int32_t input_array_length = 0;
// TODO Cleanup Needed: In the presence of default methods this optimization is rather dirty
// and confusing. Default methods should always look through all the superclasses
// because they are the last choice of an implementation. We get around this by looking
// at the super-classes iftable methods (copied into method_array previously) when we are
@ -8317,7 +8293,6 @@ bool ClassLinker::LinkInterfaceMethods(
// are still using this we will select it again when scanning for default methods. To
// obviate the need to copy the method again we will make a note that we already found
// a default here.
// TODO This should be much cleaner.
vtable_impl = vtable_method;
break;
} else {
@ -8351,7 +8326,6 @@ bool ClassLinker::LinkInterfaceMethods(
// safe since we know that the super_iftable is filled in so we can simply pull it from
// there. We don't bother if this is not a super-classes interface since in that case we
// have scanned the entire vtable anyway and would have found it.
// TODO This is rather dirty but it is faster than searching through the entire vtable
// every time.
ArtMethod* supers_method =
method_array->GetElementPtrSize<ArtMethod*>(j, image_pointer_size_);
@ -8402,7 +8376,6 @@ bool ClassLinker::LinkInterfaceMethods(
} // For each method in interface end.
} // if (num_methods > 0)
} // For each interface.
// TODO don't extend virtuals of interface unless necessary (when is it?).
if (helper.HasNewVirtuals()) {
LengthPrefixedArray<ArtMethod>* old_methods = kIsDebugBuild ? klass->GetMethodsPtr() : nullptr;
helper.ReallocMethods(); // No return value to check. Native allocation failure aborts.
@ -9056,7 +9029,6 @@ ObjPtr<mirror::Class> ClassLinker::DoResolveType(dex::TypeIndex type_idx,
const char* descriptor = dex_cache->GetDexFile()->StringByTypeIdx(type_idx);
ObjPtr<mirror::Class> resolved = FindClass(self, descriptor, class_loader);
if (resolved != nullptr) {
// TODO: we used to throw here if resolved's class loader was not the
// boot class loader. This was to permit different classes with the
// same name to be loaded simultaneously by different loaders
dex_cache->SetResolvedType(type_idx, resolved);
@ -9458,7 +9430,6 @@ ObjPtr<mirror::MethodType> ClassLinker::ResolveMethodType(
// Then resolve the argument types.
//
// TODO: Is there a better way to figure out the number of method arguments
// other than by looking at the shorty ?
const size_t num_method_args = strlen(dex_file.StringDataByIdx(proto_id.shorty_idx_)) - 1;
@ -10090,7 +10061,6 @@ ObjPtr<mirror::ClassLoader> ClassLinker::CreateWellKnownClassLoader(
path_list_field->SetObject<false>(h_class_loader.Get(), h_dex_path_list.Get());
// Make a pretend boot-classpath.
// TODO: Should we scan the image?
ArtField* const parent_field =
mirror::Class::FindField(self,
h_class_loader->GetClass(),

View File

@ -895,7 +895,6 @@ public abstract class Context {
return null;
}
// TODO moltmann: Remove
/**
* @removed
*/
@ -4684,7 +4683,6 @@ public abstract class Context {
/**
* Official published name of the (internal) rotation resolver service.
*
* // TODO(b/178151184): change it back to rotation resolver before S release.
*
* @see #getSystemService(String)
* @hide
@ -4748,7 +4746,7 @@ public abstract class Context {
* @see #getSystemService(String)
*/
@TestApi
@SuppressLint("ServiceName") // TODO: This should be renamed to CONTENT_CAPTURE_SERVICE
@SuppressLint("ServiceName")
public static final String CONTENT_CAPTURE_MANAGER_SERVICE = "content_capture";
/**
@ -4935,7 +4933,7 @@ public abstract class Context {
* @hide
*/
@TestApi
@SuppressLint("ServiceName") // TODO: This should be renamed to DEVICE_IDLE_SERVICE
@SuppressLint("ServiceName")
public static final String DEVICE_IDLE_CONTROLLER = "deviceidle";
/**
@ -6551,7 +6549,6 @@ public abstract class Context {
throw new RuntimeException("Not implemented. Must override in a subclass.");
}
// TODO moltmann: remove
/**
* @removed
*/
@ -6665,7 +6662,6 @@ public abstract class Context {
/**
* A version of {@link #getDisplay()} that does not perform a Context misuse check to be used by
* legacy APIs.
* TODO(b/149790106): Fix usages and remove.
* @hide
*/
@Nullable

View File

@ -235,10 +235,6 @@ public final class SystemServer implements Dumpable {
private static final long SLOW_DISPATCH_THRESHOLD_MS = 100;
private static final long SLOW_DELIVERY_THRESHOLD_MS = 200;
/*
* Implementation class names. TODO: Move them to a codegen class or load
* them from the build system somehow.
*/
private static final String BACKUP_MANAGER_SERVICE_CLASS =
"com.android.server.backup.BackupManagerService$Lifecycle";
private static final String APPWIDGET_SERVICE_CLASS =
@ -407,7 +403,6 @@ public final class SystemServer implements Dumpable {
private Context mSystemContext;
private SystemServiceManager mSystemServiceManager;
// TODO: remove all of these references by improving dependency resolution and boot phases
private PowerManagerService mPowerManagerService;
private ActivityManagerService mActivityManagerService;
private WindowManagerGlobalLock mWindowManagerGlobalLock;
@ -624,7 +619,6 @@ public final class SystemServer implements Dumpable {
// Remember if it's runtime restart(when sys.boot_completed is already set) or reboot
// We don't use "mStartCount > 1" here because it'll be wrong on a FDE device.
// TODO: mRuntimeRestart will *not* be set to true if the proccess crashes before
// sys.boot_completed is set. Fix it.
mRuntimeRestart = "1".equals(SystemProperties.get("sys.boot_completed"));
}
@ -1056,7 +1050,6 @@ public final class SystemServer implements Dumpable {
// Activity manager runs the show.
t.traceBegin("StartActivityManager");
// TODO: Might need to move after migration to WM.
ActivityTaskManagerService atm = mSystemServiceManager.startService(
ActivityTaskManagerService.Lifecycle.class).getService();
mActivityManagerService = ActivityManagerService.Lifecycle.startService(
@ -1522,7 +1515,6 @@ public final class SystemServer implements Dumpable {
inputManager.start();
t.traceEnd();
// TODO: Use service dependencies instead.
t.traceBegin("DisplayManagerWindowManagerAndInputReady");
mDisplayManagerService.windowManagerAndInputReady();
t.traceEnd();
@ -1766,13 +1758,11 @@ public final class SystemServer implements Dumpable {
}
// Search UI manager service
// TODO: add deviceHasConfigString(context, R.string.config_defaultSearchUiService)
t.traceBegin("StartSearchUiService");
mSystemServiceManager.startService(SEARCH_UI_MANAGER_SERVICE_CLASS);
t.traceEnd();
// Smartspace manager service
// TODO: add deviceHasConfigString(context, R.string.config_defaultSmartspaceService)
t.traceBegin("StartSmartspaceService");
mSystemServiceManager.startService(SMARTSPACE_MANAGER_SERVICE_CLASS);
t.traceEnd();
@ -2150,7 +2140,6 @@ public final class SystemServer implements Dumpable {
mSystemServiceManager.startService(ColorDisplayService.class);
t.traceEnd();
// TODO(aml-jobscheduler): Think about how to do it properly.
t.traceBegin("StartJobScheduler");
mSystemServiceManager.startService(JOB_SCHEDULER_SERVICE_CLASS);
t.traceEnd();
@ -2594,7 +2583,6 @@ public final class SystemServer implements Dumpable {
t.traceBegin("MakePowerManagerServiceReady");
try {
// TODO: use boot phase
mPowerManagerService.systemReady(mActivityManagerService.getAppOpsService());
} catch (Throwable e) {
reportWtf("making Power Manager Service ready", e);
@ -2612,7 +2600,6 @@ public final class SystemServer implements Dumpable {
t.traceBegin("MakeDisplayManagerServiceReady");
try {
// TODO: use boot phase and communicate these flags some other way
mDisplayManagerService.systemReady(safeMode, mOnlyCore);
} catch (Throwable e) {
reportWtf("making Display Manager Service ready", e);
@ -2735,7 +2722,6 @@ public final class SystemServer implements Dumpable {
// Enable airplane mode in safe mode. setAirplaneMode() cannot be called
// earlier as it sends broadcasts to other services.
// TODO: This may actually be too late if radio firmware already started leaking
// RF before the respective services start. However, fixing this requires changes
// to radio firmware and interfaces.
if (safeMode) {
@ -2844,7 +2830,6 @@ public final class SystemServer implements Dumpable {
t.traceBegin("StartTethering");
try {
// TODO: hide implementation details, b/146312721.
ConnectivityModuleConnector.getInstance().startModuleService(
TETHERING_CONNECTOR_CLASS,
PERMISSION_MAINLINE_NETWORK_STACK, service -> {
@ -2877,7 +2862,6 @@ public final class SystemServer implements Dumpable {
t.traceEnd();
t.traceBegin("MakeInputManagerServiceReady");
try {
// TODO(BT) Pass parameter to input manager
if (inputManagerF != null) {
inputManagerF.systemRunning();
}
@ -2915,7 +2899,6 @@ public final class SystemServer implements Dumpable {
t.traceBegin("IncidentDaemonReady");
try {
// TODO: Switch from checkService to getService once it's always
// in the build and should reliably be there.
final IIncidentManager incident = IIncidentManager.Stub.asInterface(
ServiceManager.getService(Context.INCIDENT_SERVICE));

View File

@ -1641,7 +1641,6 @@ public final class SystemServiceRegistry {
* {@code context}.
*/
@NonNull
//TODO Do we need to pass the "base context" too?
TServiceClass createService(@NonNull Context context);
}
@ -1662,7 +1661,6 @@ public final class SystemServiceRegistry {
* service binder object that's tied to a given {@code context}.
*/
@NonNull
//TODO Do we need to pass the "base context" too?
TServiceClass createService(@NonNull Context context, @NonNull IBinder serviceBinder);
}
@ -1927,7 +1925,6 @@ public final class SystemServiceRegistry {
* creating the service for the first time, passes it the application context of the creating
* application.
*
* TODO: Delete this once its only user (ConnectivityManager) is known to work well in the
* case where multiple application components each have their own ConnectivityManager object.
*/
static abstract class StaticApplicationContextServiceFetcher<T> implements ServiceFetcher<T> {

View File

@ -77,7 +77,6 @@ static bool ConvertJavaArrayToDexFiles(
return false;
}
// TODO: Optimize. On 32bit we can use an int array.
jboolean is_long_data_copied;
jlong* long_data = env->GetLongArrayElements(reinterpret_cast<jlongArray>(array),
&is_long_data_copied);
@ -138,7 +137,6 @@ static jlongArray ConvertDexFilesToJavaArray(JNIEnv* env,
// }
// // ... use name.c_str()
//
// TODO: rewrite to get rid of this, or change ScopedUtfChars to offer this option.
class NullableScopedUtfChars {
public:
NullableScopedUtfChars(JNIEnv* env, jstring s) : mEnv(env), mString(s) {
@ -309,7 +307,6 @@ static jobject DexFile_openInMemoryDexFilesNative(JNIEnv* env,
return CreateCookieFromOatFileManagerResult(env, dex_files, oat_file, error_msgs);
}
// TODO(calin): clean up the unused parameters (here and in libcore).
static jobject DexFile_openDexFileNative(JNIEnv* env,
jclass,
jstring javaSourceName,
@ -554,9 +551,6 @@ static jint GetDexOptNeeded(JNIEnv* env,
/*only_read_checksums*/ true);
}
// TODO: Verify the dex location is well formed, and throw an IOException if
// not?
OatFileAssistant oat_file_assistant(filename,
target_instruction_set,
context.get(),

View File

@ -619,7 +619,6 @@ class JNI {
ScopedObjectAccess soa(env);
ObjPtr<mirror::Object> obj_field = soa.Decode<mirror::Object>(jlr_field);
if (obj_field->GetClass() != GetClassRoot<mirror::Field>()) {
// Not even a java.lang.reflect.Field, return null. TODO, is this check necessary?
return nullptr;
}
ObjPtr<mirror::Field> field = ObjPtr<mirror::Field>::DownCast(obj_field);
@ -751,7 +750,6 @@ class JNI {
}
static jint PushLocalFrame(JNIEnv* env, jint capacity) {
// TODO: SOA may not be necessary but I do it to please lock annotations.
ScopedObjectAccess soa(env);
if (EnsureLocalCapacityInternal(soa, capacity, "PushLocalFrame") != JNI_OK) {
return JNI_ERR;
@ -768,7 +766,6 @@ class JNI {
}
static jint EnsureLocalCapacity(JNIEnv* env, jint desired_capacity) {
// TODO: SOA may not be necessary but I do it to please lock annotations.
ScopedObjectAccess soa(env);
return EnsureLocalCapacityInternal(soa, desired_capacity, "EnsureLocalCapacity");
}
@ -2127,7 +2124,6 @@ class JNI {
heap->DecrementDisableThreadFlip(soa.Self());
}
}
// TODO: For uncompressed strings GetStringCritical() always returns `s->GetValue()`.
// Should we report an error if the user passes a different `chars`?
if (s->IsCompressed() || (!s->IsCompressed() && s->GetValue() != chars)) {
delete[] chars;
@ -2598,7 +2594,6 @@ class JNI {
// since that checks for presence of @FastNative and not for ! in the descriptor.
LOG(WARNING) << "!bang JNI is deprecated. Switch to @FastNative for " << m->PrettyMethod();
is_fast = false;
// TODO: make this a hard register error in the future.
}
const void* final_function_ptr = class_linker->RegisterNative(soa.Self(), m, fnPtr);
@ -2865,7 +2860,6 @@ class JNI {
size_t bytes = array->GetLength() * component_size;
if (is_copy) {
// Integrity check: If elements is not the same as the java array's data, it better not be a
// heap address. TODO: This might be slow to check, may be worth keeping track of which
// copies we make?
if (heap->IsNonDiscontinuousSpaceHeapAddress(elements)) {
soa.Vm()->JniAbortF("ReleaseArrayElements",

View File

@ -107,7 +107,6 @@ extern uint32_t JniMethodStartSynchronized(jobject to_lock, Thread* self) {
return JniMethodStart(self);
}
// TODO: NO_THREAD_SAFETY_ANALYSIS due to different control paths depending on fast JNI.
static void GoToRunnable(Thread* self) NO_THREAD_SAFETY_ANALYSIS {
if (kIsDebugBuild) {
ArtMethod* native_method = *self->GetManagedStack()->GetTopQuickFrame();
@ -144,7 +143,6 @@ static void PopLocalReferences(uint32_t saved_local_ref_cookie, Thread* self)
env->SetLocalRefCookie(bit_cast<IRTSegmentState>(saved_local_ref_cookie));
}
// TODO: annotalysis disabled as monitor semantics are maintained in Java code.
static inline void UnlockJniSynchronizedMethod(jobject locked, Thread* self)
NO_THREAD_SAFETY_ANALYSIS REQUIRES(!Roles::uninterruptible_) {
// Save any pending exception over monitor exit call.
@ -167,7 +165,6 @@ static inline void UnlockJniSynchronizedMethod(jobject locked, Thread* self)
}
}
// TODO: These should probably be templatized or macro-ized.
// Otherwise there's just too much repetitive boilerplate.
extern void JniMethodEnd(uint32_t saved_local_ref_cookie, Thread* self) {
@ -284,7 +281,6 @@ extern uint64_t GenericJniMethodEnd(Thread* self,
jvalue result,
uint64_t result_f,
ArtMethod* called)
// TODO: NO_THREAD_SAFETY_ANALYSIS as GoToRunnable() is NO_THREAD_SAFETY_ANALYSIS
NO_THREAD_SAFETY_ANALYSIS {
// ALOGD("mikrom GenericJniMethodEnd ");
bool critical_native = called->IsCriticalNative();

View File

@ -286,7 +286,6 @@ class ArgArray {
arg.Assign(args->Get(args_offset));
if (((shorty_[i] == 'L') && (arg != nullptr)) ||
((arg == nullptr && shorty_[i] != 'L'))) {
// TODO: The method's parameter's type must have been previously resolved, yet
// we've seen cases where it's not b/34440020.
ObjPtr<mirror::Class> dst_class(
m->ResolveClassFromTypeIndex(classes->GetTypeItem(args_offset).type_idx_));
@ -424,7 +423,6 @@ void CheckMethodArguments(JavaVMExt* vm, ArtMethod* m, uint32_t* args)
if (!m->IsStatic()) {
offset = 1;
}
// TODO: If args contain object references, it may cause problems.
Thread* const self = Thread::Current();
for (uint32_t i = 0; i < num_params; i++) {
dex::TypeIndex type_idx = params->GetTypeItem(i).type_idx_;
@ -437,7 +435,6 @@ void CheckMethodArguments(JavaVMExt* vm, ArtMethod* m, uint32_t* args)
self->ClearException();
++error_count;
} else if (!param_type->IsPrimitive()) {
// TODO: There is a compaction bug here since GetClassFromTypeIdx can cause thread suspension,
// this is a hard to fix problem since the args can contain Object*, we need to save and
// restore them by using a visitor similar to the ones used in the trampoline entrypoints.
ObjPtr<mirror::Object> argument =
@ -480,7 +477,6 @@ void CheckMethodArguments(JavaVMExt* vm, ArtMethod* m, uint32_t* args)
}
}
if (UNLIKELY(error_count > 0)) {
// TODO: pass the JNI function name (such as "CallVoidMethodV") through so we can call JniAbort
// with an argument.
vm->JniAbortF(nullptr, "bad arguments passed to %s (see above for details)",
m->PrettyMethod().c_str());

View File

@ -811,7 +811,6 @@ class Runtime {
// Called from class linker.
void SetSentinel(ObjPtr<mirror::Object> sentinel) REQUIRES_SHARED(Locks::mutator_lock_);
// For testing purpose only.
// TODO: Remove this when this is no longer needed (b/116087961).
GcRoot<mirror::Object> GetSentinel() REQUIRES_SHARED(Locks::mutator_lock_);