Fixed
Status Update
Comments
aa...@google.com <aa...@google.com> #2
Wouldn't it be more appropriate to have SDK Manager install these as read-only?
gh...@google.com <gh...@google.com> #3
Fixed by Change I9cd0a8f5c.
Wouldn't it be more appropriate to have SDK Manager install these as read-only?
From offline discussion: changing the SDK Manager in this way is not straightforward, and has some risks.
jl...@google.com <jl...@google.com> #4
It looks like this approach means all writes will cause a Log.error() if they happen from a UI thread.
java.lang.Throwable: Slow operations are prohibited on EDT. See SlowOperations.assertSlowOperationsAreAllowed javadoc.
at com.intellij.openapi.diagnostic.Logger.error(Logger.java:376)
at com.intellij.util.SlowOperations.assertSlowOperationsAreAllowed(SlowOperations.java:101)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.ensureIsUpToDate(WorkspaceFileIndexDataImpl.kt:130)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexDataImpl.getFileInfo(WorkspaceFileIndexDataImpl.kt:75)
at com.intellij.workspaceModel.core.fileIndex.impl.WorkspaceFileIndexImpl.getFileInfo(WorkspaceFileIndexImpl.kt:247)
at com.intellij.openapi.roots.impl.DirectoryIndexImpl.getOrderEntries(DirectoryIndexImpl.java:143)
at com.intellij.openapi.roots.impl.ProjectFileIndexImpl.getOrderEntriesForFile(ProjectFileIndexImpl.java:105)
at com.android.tools.idea.sdk.AndroidSdks.isInAndroidSdk(AndroidSdks.java:518)
at com.android.tools.idea.sdk.SdkWritingAccessProvider.requestWriting(SdkWritingAccessProvider.kt:28)
gh...@google.com <gh...@google.com> #5
Yes, that issue was recently filed and partially addressed in
Description
Navigating to
android.app.Activity
opens~/Library/Android/sdk/sources/android-33/android/app/Activity.java
in the editor. Attempting to edit the file triggers a warning (see attached image), but still it seems too easy to accidentally edit SDK sources.I have a fix in mind involving
WritingAccessProvider
andAndroidSdks.isInAndroidSdk(PsiElement)
.