|
11 | 11 | import androidx.annotation.NonNull;
|
12 | 12 | import androidx.annotation.Nullable;
|
13 | 13 |
|
14 |
| -import com.yoti.mobile.android.sdk.exceptions.AppNotInstalledErrorCode; |
| 14 | +import com.yoti.mobile.android.sdk.exceptions.AppType; |
15 | 15 | import com.yoti.mobile.android.sdk.exceptions.YotiSDKAppNotInstalledException;
|
16 | 16 | import com.yoti.mobile.android.sdk.exceptions.YotiSDKException;
|
17 | 17 | import com.yoti.mobile.android.sdk.exceptions.YotiSDKMinVersionException;
|
|
24 | 24 |
|
25 | 25 | import static com.yoti.mobile.android.sdk.ButtonTheme.THEME_PARTNERSHIP;
|
26 | 26 | import static com.yoti.mobile.android.sdk.ButtonTheme.THEME_YOTI;
|
27 |
| -import static com.yoti.mobile.android.sdk.exceptions.AppNotInstalledErrorCode.EASY_ID_APP_NOT_INSTALLED; |
28 |
| -import static com.yoti.mobile.android.sdk.exceptions.AppNotInstalledErrorCode.PARTNERSHIP_APP_NOT_INSTALLED; |
29 |
| -import static com.yoti.mobile.android.sdk.exceptions.AppNotInstalledErrorCode.YOTI_APP_NOT_INSTALLED; |
| 27 | +import static com.yoti.mobile.android.sdk.exceptions.AppType.EASY_ID_APP; |
| 28 | +import static com.yoti.mobile.android.sdk.exceptions.AppType.PARTNERSHIP_APP; |
| 29 | +import static com.yoti.mobile.android.sdk.exceptions.AppType.YOTI_APP; |
30 | 30 |
|
31 | 31 | /**
|
32 | 32 | * Singleton to manage the different Scenarios defined by a third party app.
|
@@ -158,22 +158,22 @@ private static PackageInfo getAppPackageInfoBasedOnTheme(PackageManager packageM
|
158 | 158 | } else if (checkAppInstalled(packageManager, YotiAppDefs.EASY_ID_APP_PACKAGE)) {
|
159 | 159 | packageInfo = packageManager.getPackageInfo(YotiAppDefs.EASY_ID_APP_PACKAGE, 0);
|
160 | 160 | } else {
|
161 |
| - AppNotInstalledErrorCode errorCode = buttonTheme == THEME_YOTI ? YOTI_APP_NOT_INSTALLED : PARTNERSHIP_APP_NOT_INSTALLED; |
162 |
| - throw new YotiSDKAppNotInstalledException(errorCode, "Yoti app not installed"); |
| 161 | + AppType appType = buttonTheme == THEME_YOTI ? YOTI_APP : PARTNERSHIP_APP; |
| 162 | + throw new YotiSDKAppNotInstalledException(appType, appType.getValue()+" app not installed"); |
163 | 163 | }
|
164 | 164 | break;
|
165 | 165 | case THEME_EASYID:
|
166 | 166 | if (checkAppInstalled(packageManager, YotiAppDefs.EASY_ID_APP_PACKAGE)
|
167 | 167 | && checkEasyAppWithSchemeAvailable(packageManager)) {
|
168 | 168 | packageInfo = packageManager.getPackageInfo(YotiAppDefs.EASY_ID_APP_PACKAGE, 0);
|
169 | 169 | } else {
|
170 |
| - throw new YotiSDKAppNotInstalledException(EASY_ID_APP_NOT_INSTALLED, "EasyId app not installed"); |
| 170 | + throw new YotiSDKAppNotInstalledException(EASY_ID_APP, "EasyId app not installed"); |
171 | 171 | }
|
172 | 172 | break;
|
173 | 173 | }
|
174 | 174 | }
|
175 | 175 | catch (NameNotFoundException e) {
|
176 |
| - throw new YotiSDKAppNotInstalledException(YOTI_APP_NOT_INSTALLED, "Yoti app not installed"); |
| 176 | + throw new YotiSDKAppNotInstalledException(YOTI_APP, "Yoti app not installed"); |
177 | 177 | }
|
178 | 178 | return packageInfo;
|
179 | 179 | }
|
|
0 commit comments