Skip to content

Commit

Permalink
Merge pull request #1441 from microsoft/fix/local-stores-check
Browse files Browse the repository at this point in the history
Local stores updated
  • Loading branch information
MatkovIvan authored Jul 21, 2020
2 parents 4afa83b + 2d23db9 commit 12d2b7b
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

* **[Fix]** Fix an `IncorrectContextUseViolation` warning when calculating screen size on Android 11.
* **[Fix]** All SQL commands used in SDK are presented as raw strings to avoid any possible static analyzer's SQL injection false alarms.
* **[Fix]** Fix Distribute can't get updates for Realme devices which use Realme UI.

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ public class InstallerUtils {
LOCAL_STORES.add("com.android.managedprovisioning");
LOCAL_STORES.add("com.miui.packageinstaller");
LOCAL_STORES.add("com.samsung.android.packageinstaller");
LOCAL_STORES.add("pc");
LOCAL_STORES.add("com.google.android.apps.nbu.files");
LOCAL_STORES.add("org.mozilla.firefox");
LOCAL_STORES.add("com.android.chrome");
}

@VisibleForTesting
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,38 @@ public void samsungLocalInstallerIsNotStore() {
verifyNotFromAppStore();
}

@Test
public void pcLocalInstallerIsNotStore() {
setInstallerPackageName("pc");

/* Check cache. */
verifyNotFromAppStore();
}

@Test
public void firefoxLocalInstallerIsNotStore() {
setInstallerPackageName("org.mozilla.firefox");

/* Check cache. */
verifyNotFromAppStore();
}

@Test
public void chromeLocalInstallerIsNotStore() {
setInstallerPackageName("com.android.chrome");

/* Check cache. */
verifyNotFromAppStore();
}

@Test
public void googleFilesLocalInstallerIsNotStore() {
setInstallerPackageName("com.google.android.apps.nbu.files");

/* Check cache. */
verifyNotFromAppStore();
}

private void setInstallerPackageName(String packageName) {
when(mPackageManager.getInstallerPackageName(anyString())).thenReturn(packageName);
}
Expand Down

0 comments on commit 12d2b7b

Please sign in to comment.