Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
bitmask_android
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Shinigama
bitmask_android
Commits
b62e17ad
Commit
b62e17ad
authored
7 years ago
by
cyberta
Browse files
Options
Downloads
Patches
Plain Diff
#8789 fix IllegalStateException for failed provider configuring
parent
590f95df
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java
+27
-9
27 additions, 9 deletions
...n/java/se/leap/bitmaskclient/BaseConfigurationWizard.java
with
27 additions
and
9 deletions
app/src/main/java/se/leap/bitmaskclient/BaseConfigurationWizard.java
+
27
−
9
View file @
b62e17ad
...
@@ -89,7 +89,9 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -89,7 +89,9 @@ public abstract class BaseConfigurationWizard extends Activity
final
protected
static
String
PROVIDER_NOT_SET
=
"PROVIDER NOT SET"
;
final
protected
static
String
PROVIDER_NOT_SET
=
"PROVIDER NOT SET"
;
final
protected
static
String
SETTING_UP_PROVIDER
=
"PROVIDER GETS SET"
;
final
protected
static
String
SETTING_UP_PROVIDER
=
"PROVIDER GETS SET"
;
private
static
final
String
SETTING_UP_PROVIDER_SHOW_PROVIDER_DETILS
=
"PROVIDER DETAILS SHOWN"
;
final
private
static
String
PENDING_SHOW_PROVIDER_DETAILS
=
"PROVIDER DETAILS SHOWN"
;
final
private
static
String
PENDING_SHOW_FAILED_DIALOG
=
"SHOW FAILED DIALOG"
;
final
private
static
String
REASON_TO_FAIL
=
"REASON TO FAIL"
;
final
protected
static
String
PROVIDER_SET
=
"PROVIDER SET"
;
final
protected
static
String
PROVIDER_SET
=
"PROVIDER SET"
;
final
protected
static
String
SERVICES_RETRIEVED
=
"SERVICES RETRIEVED"
;
final
protected
static
String
SERVICES_RETRIEVED
=
"SERVICES RETRIEVED"
;
...
@@ -149,7 +151,11 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -149,7 +151,11 @@ public abstract class BaseConfigurationWizard extends Activity
progressbar_text
=
savedInstanceState
.
getString
(
PROGRESSBAR_TEXT
,
""
);
progressbar_text
=
savedInstanceState
.
getString
(
PROGRESSBAR_TEXT
,
""
);
selected_provider
=
savedInstanceState
.
getParcelable
(
Provider
.
KEY
);
selected_provider
=
savedInstanceState
.
getParcelable
(
Provider
.
KEY
);
if
(
fragment_manager
.
findFragmentByTag
(
ProviderDetailFragment
.
TAG
)
==
null
&&
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
()))
{
if
(
fragment_manager
.
findFragmentByTag
(
ProviderDetailFragment
.
TAG
)
==
null
&&
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
())
||
PENDING_SHOW_PROVIDER_DETAILS
.
equals
(
mConfigState
.
getAction
())
||
PENDING_SHOW_FAILED_DIALOG
.
equals
(
mConfigState
.
getAction
())
))
{
onItemSelectedUi
();
onItemSelectedUi
();
}
}
}
}
...
@@ -160,8 +166,10 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -160,8 +166,10 @@ public abstract class BaseConfigurationWizard extends Activity
if
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
()))
{
if
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
()))
{
showProgressBar
();
showProgressBar
();
adapter
.
hideAllBut
(
adapter
.
indexOf
(
selected_provider
));
adapter
.
hideAllBut
(
adapter
.
indexOf
(
selected_provider
));
}
else
if
(
SETTING_UP_PROVIDER
_SHOW_PROVIDER_DETILS
.
equals
(
mConfigState
.
getAction
()))
{
}
else
if
(
PENDING
_SHOW_PROVIDER_DET
A
ILS
.
equals
(
mConfigState
.
getAction
()))
{
showProviderDetails
();
showProviderDetails
();
}
else
if
(
PENDING_SHOW_FAILED_DIALOG
.
equals
(
mConfigState
.
getAction
()))
{
showDownloadFailedDialog
(
mConfigState
.
getStringExtra
(
REASON_TO_FAIL
));
}
}
}
}
...
@@ -248,7 +256,8 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -248,7 +256,8 @@ public abstract class BaseConfigurationWizard extends Activity
@OnItemClick
(
R
.
id
.
provider_list
)
@OnItemClick
(
R
.
id
.
provider_list
)
void
onItemSelected
(
int
position
)
{
void
onItemSelected
(
int
position
)
{
if
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
())
||
if
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
())
||
SETTING_UP_PROVIDER_SHOW_PROVIDER_DETILS
.
equals
(
mConfigState
.
getAction
()))
{
PENDING_SHOW_PROVIDER_DETAILS
.
equals
(
mConfigState
.
getAction
())
||
PENDING_SHOW_FAILED_DIALOG
.
equals
(
mConfigState
.
getAction
()))
{
return
;
return
;
}
}
...
@@ -266,7 +275,9 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -266,7 +275,9 @@ public abstract class BaseConfigurationWizard extends Activity
@Override
@Override
public
void
onBackPressed
()
{
public
void
onBackPressed
()
{
if
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
()))
{
if
(
SETTING_UP_PROVIDER
.
equals
(
mConfigState
.
getAction
())
||
PENDING_SHOW_PROVIDER_DETAILS
.
equals
(
mConfigState
.
getAction
())
||
PENDING_SHOW_FAILED_DIALOG
.
equals
(
mConfigState
.
getAction
()))
{
stopSettingUpProvider
();
stopSettingUpProvider
();
}
else
{
}
else
{
askDashboardToQuitApp
();
askDashboardToQuitApp
();
...
@@ -364,10 +375,17 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -364,10 +375,17 @@ public abstract class BaseConfigurationWizard extends Activity
* @param reason_to_fail
* @param reason_to_fail
*/
*/
public
void
showDownloadFailedDialog
(
String
reason_to_fail
)
{
public
void
showDownloadFailedDialog
(
String
reason_to_fail
)
{
try
{
FragmentTransaction
fragment_transaction
=
fragment_manager
.
removePreviousFragment
(
DownloadFailedDialog
.
TAG
);
FragmentTransaction
fragment_transaction
=
fragment_manager
.
removePreviousFragment
(
DownloadFailedDialog
.
TAG
);
DialogFragment
newFragment
=
DownloadFailedDialog
.
newInstance
(
reason_to_fail
);
DialogFragment
newFragment
=
DownloadFailedDialog
.
newInstance
(
reason_to_fail
);
newFragment
.
show
(
fragment_transaction
,
DownloadFailedDialog
.
TAG
);
newFragment
.
show
(
fragment_transaction
,
DownloadFailedDialog
.
TAG
);
}
catch
(
IllegalStateException
e
)
{
e
.
printStackTrace
();
mConfigState
.
setAction
(
PENDING_SHOW_FAILED_DIALOG
);
mConfigState
.
putExtra
(
REASON_TO_FAIL
,
reason_to_fail
);
}
}
}
...
@@ -380,7 +398,6 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -380,7 +398,6 @@ public abstract class BaseConfigurationWizard extends Activity
*
*
*/
*/
public
void
showProviderDetails
()
{
public
void
showProviderDetails
()
{
mConfigState
.
setAction
(
SETTING_UP_PROVIDER_SHOW_PROVIDER_DETILS
);
try
{
try
{
FragmentTransaction
fragment_transaction
=
fragment_manager
.
removePreviousFragment
(
ProviderDetailFragment
.
TAG
);
FragmentTransaction
fragment_transaction
=
fragment_manager
.
removePreviousFragment
(
ProviderDetailFragment
.
TAG
);
...
@@ -388,6 +405,7 @@ public abstract class BaseConfigurationWizard extends Activity
...
@@ -388,6 +405,7 @@ public abstract class BaseConfigurationWizard extends Activity
newFragment
.
show
(
fragment_transaction
,
ProviderDetailFragment
.
TAG
);
newFragment
.
show
(
fragment_transaction
,
ProviderDetailFragment
.
TAG
);
}
catch
(
IllegalStateException
e
)
{
}
catch
(
IllegalStateException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
mConfigState
.
setAction
(
PENDING_SHOW_PROVIDER_DETAILS
);
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment