Commit a42a6c60 authored by Kevin F. Haggerty's avatar Kevin F. Haggerty

Merge tag 'android-8.1.0_r69' into staging/lineage-15.1_merge-android-8.1.0_r69

Android 8.1.0 Release 69 (5794017)

* tag 'android-8.1.0_r69':
  Treat mode_default as denied for install_unknown_apps
  [RESTRICT AUTOMERGE] Make ScreenPinningSettings behaviour consistent with lock tasks.
  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
  Disable changing lock when device is not provisioned.
  Delete obsolete activity alias for dev settings
  Import translations. DO NOT MERGE
  DO NOT MERGE Give PBAP permission only after user confirms
  Update the way OMS records details about overlays
  Reword bluetooth confirmation dialog
  Fix BluetoothPairingDialogTest to not expect device name

Change-Id: I32210660399c689c2a50616221d2e07aa615e75c
parents cfef9ae1 66bf121f
......@@ -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();
......
......@@ -37,8 +37,10 @@ public class AppStateInstallAppsBridgeTest {
.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