1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package com.android.server.locales; 18 19 import android.annotation.Nullable; 20 21 /** 22 * System-server internal interface to the {@link LocaleManagerService}. 23 * 24 * @hide Only for use within the system server. 25 */ 26 public abstract class LocaleManagerInternal { 27 /** 28 * Returns the app-specific locales to be backed up as a data-blob. 29 */ getBackupPayload(int userId)30 public abstract @Nullable byte[] getBackupPayload(int userId); 31 32 /** 33 * Restores the app-locales that were previously backed up. 34 * 35 * <p>This method will parse the input data blob and restore the locales for apps which are 36 * present on the device. It will stage the locale data for the apps which are not installed 37 * at the time this is called, to be referenced later when the app is installed. 38 */ stageAndApplyRestoredPayload(byte[] payload, int userId)39 public abstract void stageAndApplyRestoredPayload(byte[] payload, int userId); 40 } 41