Unable to reimport the same xml profile
Open
Nobody has claimed this yet.
bug
- Dominant language
- Java
- Stars
- 14.6k
- Forks
- 3.2k
- Avg merge
- 12d 11h
- Merged PRs (30d)
- 4
Description
Describe the bug
Unable to reimport the same xml profile.
To Reproduce
Steps to reproduce the behavior:
- Go to microG settings => Google device registration => Import custom profile and then import a profile from the xml
- Manually edit the xml file of the profile
- Reimport the edited xml
- See error:
D/ProfileManager( 1062): Importing user profile 'My profile'
W/ProfileManager( 1062): kotlin.io.FileAlreadyExistsException: /data/data/com.google.android.gms/cache/profile_-519229140.xml -> /data/data/com.google.android.gms/files/device_profile.xml: The destination file already exists.
W/ProfileManager( 1062): at kotlin.io.FilesKt__UtilsKt.copyTo(Utils.kt:224)
W/ProfileManager( 1062): at kotlin.io.FilesKt__UtilsKt.copyTo$default(Utils.kt:217)
W/ProfileManager( 1062): at org.microg.gms.profile.ProfileManager.importUserProfile(ProfileManager.kt:307)
W/ProfileManager( 1062): at org.microg.gms.ui.DeviceRegistrationPreferencesFragment.onFileSelected(DeviceRegistrationPreferencesFragment.kt:56)
W/ProfileManager( 1062): at org.microg.gms.ui.DeviceRegistrationPreferencesFragment.$r8$lambda$wnSSaN6Ik4Od66fpD_2eikm17F8(DeviceRegistrationPreferencesFragment.kt)
W/ProfileManager( 1062): at org.microg.gms.ui.DeviceRegistrationPreferencesFragment$$ExternalSyntheticLambda0.onActivityResult(D8$$SyntheticClass)
W/ProfileManager( 1062): at androidx.activity.result.ActivityResultRegistry.doDispatch(ActivityResultRegistry.java:418)
W/ProfileManager( 1062): at androidx.activity.result.ActivityResultRegistry.dispatchResult(ActivityResultRegistry.java:375)
W/ProfileManager( 1062): at androidx.activity.ComponentActivity.onActivityResult(ComponentActivity.java:777)
W/ProfileManager( 1062): at androidx.fragment.app.FragmentActivity.onActivityResult(FragmentActivity.java:152)
W/ProfileManager( 1062): at android.app.Activity.dispatchActivityResult(Activity.java:5438)
W/ProfileManager( 1062): at android.app.ActivityThread.deliverResults(ActivityThread.java:3347)
W/ProfileManager( 1062): at android.app.ActivityThread.handleSendResult(ActivityThread.java:3394)
W/ProfileManager( 1062): at android.app.ActivityThread.access$1300(ActivityThread.java:135)
W/ProfileManager( 1062): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1244)
W/ProfileManager( 1062): at android.os.Handler.dispatchMessage(Handler.java:102)
W/ProfileManager( 1062): at android.os.Looper.loop(Looper.java:136)
W/ProfileManager( 1062): at android.app.ActivityThread.main(ActivityThread.java:5001)
W/ProfileManager( 1062): at java.lang.reflect.Method.invokeNative(Native Method)
W/ProfileManager( 1062): at java.lang.reflect.Method.invoke(Method.java:515)
W/ProfileManager( 1062): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
W/ProfileManager( 1062): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
W/ProfileManager( 1062): at dalvik.system.NativeStart.main(Native Method)
Expected behavior
Successfully re-import it.
System
Android Version: 4.4.4
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ProfileManager.kt at importUserProfile, around line 307, where the stack trace shows the existing destination causes the reimport to fail. Reproduce the import flow on Android 4.4.4 with an edited XML profile, then verify that importing over the existing device profile succeeds without the FileAlreadyExistsException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100