Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PIA-973: Skip GetStarted screen on amazon branded devices #50

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,17 @@ public static boolean isAndroidTV(Context context){
*
* @return if Build.BRAND == amazon
*/
public static boolean isAmazon(){
public static boolean isAmazon() {
return isAmazonBrand() && isAmazonFlavour();
}

public static boolean isAmazonBrand() {
String brand = Build.BRAND;
DLog.d("isAmazon"," " + Build.MODEL + " " + Build.DEVICE + " " + Build.BRAND + " " + Build.PRODUCT + " " + Build.BOARD);
if(!TextUtils.isEmpty(brand) && BuildConfig.FLAVOR_store.equals("amazonstore"))
return brand.toLowerCase().contains("amazon");
else
return false;
return !TextUtils.isEmpty(brand) && brand.toLowerCase().contains("amazon");
}

public static boolean isAmazonFlavour() {
return BuildConfig.FLAVOR_store.equals("amazonstore");
}

public static boolean isChromebook(Context context){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ private void initView() {
&& !BuildConfig.FLAVOR_store.equals("noinapp")) {
frag = new NewGetStartedFragment();
} else {
frag = new GetStartedFragment();
if (PIAApplication.isAmazonBrand()) {
frag = new LoginFragment();
} else {
frag = new GetStartedFragment();
}
}
FragmentTransaction trans = getSupportFragmentManager().beginTransaction();
trans.replace(R.id.container, frag);
Expand Down