Commit 0224ac5d authored by Kevin F. Haggerty's avatar Kevin F. Haggerty

Merge tag 'android-9.0.0_r49' into staging/lineage-16.0_merge-android-9.0.0_r49

Android 9.0.0 Release 49 (5794013)

* tag 'android-9.0.0_r49':
  Treat mode_default as denied for install_unknown_apps
  [RESTRICT AUTOMERGE] Make ScreenPinningSettings behaviour consistent with LockTaskController.
  Do not allow draw on top for App notification settings
  Do not allow draw on top for default sms picker.
  Hide quicksetting tile for dev options when it's turned off
  Update PBAP info for all pairing dialogs. DO NOT MERGE
  Hide SettingsSlice provider
  Disable changing lock when device is not provisioned.

Change-Id: I705fc2d3c72ea97721d4640a639078c18fbe5ac5
parents 27ae53a7 b008d595
......@@ -94,8 +94,6 @@ public class AppStateInstallAppsBridge extends AppStateBaseBridge {
final InstallAppsState appState = new InstallAppsState();
appState.permissionRequested = hasRequestedAppOpPermission(
Manifest.permission.REQUEST_INSTALL_PACKAGES, packageName);
appState.permissionGranted = hasPermission(Manifest.permission.REQUEST_INSTALL_PACKAGES,
uid);
appState.appOpMode = getAppOpMode(AppOpsManager.OP_REQUEST_INSTALL_PACKAGES, uid,
packageName);
return appState;
......@@ -106,7 +104,6 @@ public class AppStateInstallAppsBridge extends AppStateBaseBridge {
*/
public static class InstallAppsState {
boolean permissionRequested;
boolean permissionGranted;
int appOpMode;
public InstallAppsState() {
......@@ -114,11 +111,7 @@ public class AppStateInstallAppsBridge extends AppStateBaseBridge {
}
public boolean canInstallApps() {
if (appOpMode == AppOpsManager.MODE_DEFAULT) {
return permissionGranted;
} else {
return appOpMode == AppOpsManager.MODE_ALLOWED;
}
return appOpMode == AppOpsManager.MODE_ALLOWED;
}
public boolean isPotentialAppSource() {
......@@ -127,8 +120,8 @@ public class AppStateInstallAppsBridge extends AppStateBaseBridge {
@Override
public String toString() {
StringBuilder sb = new StringBuilder("[permissionGranted: " + permissionGranted);
sb.append(", permissionRequested: " + permissionRequested);
StringBuilder sb = new StringBuilder();
sb.append("[permissionRequested: " + permissionRequested);
sb.append(", appOpMode: " + appOpMode);
sb.append("]");
return sb.toString();
......
......@@ -34,8 +34,10 @@ public class AppStateInstallAppsBridgeTest {
new AppStateInstallAppsBridge.InstallAppsState();
assertThat(appState.canInstallApps()).isFalse();
appState.permissionGranted = true;
appState.permissionRequested = true;
assertThat(appState.canInstallApps()).isFalse();
appState.appOpMode = AppOpsManager.MODE_ALLOWED;
assertThat(appState.canInstallApps()).isTrue();
appState.appOpMode = AppOpsManager.MODE_ERRORED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment