We display a dialog in AccountManager.removeAccountAsUser() callback, but at that
time fragment is onstop() which causes the IllegalStateException.
Fixes: 133253227
Fixes: 135004255
Test: make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.accounts
make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.core
make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.dashboard
Change-Id: I8534e8f7118234f6346607415698f9f91c3e5ffb
(cherry picked from commit d843ee85de)
Guard against null activity. If activity is already null, there is no
need to call finish().
Fixes: 131180213
Test: robotests
Change-Id: I19232ed67ddd0c3539b1827de23fdc584850b519
- Remove LayoutPreference in Settings source code.
- Remove unused style, layout
- Replace old imports to com.android.settingslib.widget.LayoutPreference
- Replace old XML tag to com.android.settingslib.widget.LayoutPreference
Test: robotest, manual test
Bug: 120005054
Change-Id: I9ae1ae14a16f443e11ac5d75b6038c7c5e253844
The visible symptom of this problem is that when deleting an account, if
a screen lock is set, after confirming the removal and entering the
credentials, you end up back on the account details for the page and it
looks like the deletion failed (even though it didn't).
There were two problems here:
-We were expecting the AccountDetailDashboardFragment to be in a resumed
state at the end of the confirmation dialog, but it wasn't if we had
launched the activity to have the user enter their screen lock
credentials. In the past trying to finish an activity that wasn't in
resumed state seemed to have generated a crash (b/6494527), but that
isn't the case anymore from some tests I ran.
-The AccountDetailDashboardFragment doesn't check in onResume that the
account still exists.
This CL fixes the bug in 2 ways - we'll always try to finish the
AccountDetailDashboardFragment if the account removal succeeded, and
when AccountDetailDashboardFragment's onResume is called we'll always
check for the account existence. Either approach would be sufficient on
its own.
Change-Id: Iaa65e97fca5dfc8b1251968142e47315e3b590c2
Fixes: 112845988
Test: make RunSettingsRoboTests
This means that in some cases RestrictedLockUtils has to be used and in
some RestrictedLockUtilsInternal.
This causes a lot of trivial code changes.
I also updated the ordering of the imports in all affected files.
Bug: 110953302
Test: Built
make -j RunSettingsRoboTests
Change-Id: I9bdf8b89134f853bae4f38c81af436715c73e924
Having consistent import order will reduce chance of merge
conflict between internal and external master
Test: rebuild
Change-Id: I0b1a170967ddcce7f388603fd521f6ed1eeba30b
This CL only changed AlertDialog imports.
So, reviewer can review it easily.
Change-Id: I097bc44394195b14287f4f920c570ac8653f356a
Fixes: 111413092
Test: This CL can't pass Robo test.
is set.
createAdminIntentSupport always checks user restrictions on user 0(
if called from system uid) so can't be used here when account could
be work profile account.
Bug: 70674230
Test: m -j RunSettingsRobotests
Change-Id: Ibd2df8891d9fa7b4c85c42a305c5db2acd4c829b
- Add the wrapper package and move all wrappers to the wrapper package.
- Get rid of some wrapper interface/impl implementation and have a
wrapper class directly.
Bug: 65634579
Test: make RunSettingsRoboTests
Change-Id: Ic757d8f7bacfa7a034c7e692205bc1dc4b0e1de1
When DISALLOW_MODIFY_ACCOUNT is set by a device admin, and
the user wants to remove an account, show the support dialog
instead of showing the confirm dialog.
To use the O-API DPM.createAdminSupportIntent(), a wrapper
needs to be used, because existing Robolectric tests otherwise
don't compile.
Bug: 37413849
Test: make RunSettingsRoboTests -j40 ROBOTEST_FILTER=*RemoveAccountPreferenceControllerTest
Change-Id: If23ea304ab8b9df1748e6acf3032310843b04780
Fix: 35996483
Test: m -j RunSettingsRoboTests
Test: manual test
1. Remove account in work profile
2. Remove account in user 0
Change-Id: I3ed9364afbf8ef5cddd0edc0d4e0e5e48d2dd62a
- Add account header which contains the account icon and name to the top
of the account detail page.
- Also add the remove account button to the bottom of the page.
Change-Id: I24f1a17a7f9c4dd8c840a2b0329c0965e4e612e9
Fix: 33543525
Test: make RunSettingsRoboTests