Introduces RotationResolverService to the system

Rotation Resolver Service provides the suggested screen rotation
to the system server.

Bug: 162359770
Bug: 172370409
Test: atest RotationResolverManagerPerUserServiceTest
Change-Id: Ia43dfdba8502e04768933ef46a4ac8a687d4936c
This commit is contained in:
Yi Jiang
2020-11-13 12:27:55 -08:00
parent 80320a92f1
commit 0127af73ed
22 changed files with 1463 additions and 1 deletions

View File

@@ -169,6 +169,7 @@ import com.android.server.profcollect.ProfcollectForwardingService;
import com.android.server.recoverysystem.RecoverySystemService;
import com.android.server.restrictions.RestrictionsManagerService;
import com.android.server.role.RoleServicePlatformHelper;
import com.android.server.rotationresolver.RotationResolverManagerService;
import com.android.server.security.FileIntegrityService;
import com.android.server.security.KeyAttestationApplicationIdProviderService;
import com.android.server.security.KeyChainSystemService;
@@ -1628,7 +1629,7 @@ public final class SystemServer implements Dumpable {
startContentCaptureService(context, t);
startAttentionService(context, t);
startRotationResolverService(context, t);
startSystemCaptionsManagerService(context, t);
// App prediction manager service
@@ -2833,6 +2834,19 @@ public final class SystemServer implements Dumpable {
t.traceEnd();
}
private void startRotationResolverService(@NonNull Context context,
@NonNull TimingsTraceAndSlog t) {
if (!RotationResolverManagerService.isServiceConfigured(context)) {
Slog.d(TAG, "RotationResolverService is not configured on this device");
return;
}
t.traceBegin("StartRotationResolverService");
mSystemServiceManager.startService(RotationResolverManagerService.class);
t.traceEnd();
}
private static void startSystemUi(Context context, WindowManagerService windowManager) {
PackageManagerInternal pm = LocalServices.getService(PackageManagerInternal.class);
Intent intent = new Intent();