diff options
| author | MÃ¥rten Kongstad <marten.kongstad@sony.com> | 2018-10-26 15:36:20 +0200 |
|---|---|---|
| committer | Todd Kennedy <toddke@google.com> | 2018-11-27 15:00:27 -0800 |
| commit | fd20b8387d684afd685166af3b8d88ae4fb60aec (patch) | |
| tree | 075f889f8b50ba73cb6b7b39e1fd90e6fabcbb53 /core/java/android | |
| parent | cc64dadb05513a72467f7eb4527aa46f9df16d57 (diff) | |
Add new intent to signal that device customization is ready
Add a new intent to be broadcast when a new configuration has been
installed to signal that it is time to reboot the modem, refresh caches,
etc. To receive the intent, recipients must hold the new permission
"android.permission.RECEIVE_DEVICE_CUSTOMIZATION_READY".
This CL registers the intent, but does not send it: that is the
responsibility of the customization client, e.g. Phonesky. The sender is
expected to call PackageManager.sendDeviceCustomizationReadyBroadcast
and hold the new permission "android.permission.SEND_DEVICE_CUSTOMIZATION_READY".
Bug: 118462251
Test: manual (custom apps)
Change-Id: I9a723ca9ade16e8c5d316efbc7effd01e13ff2e7
Diffstat (limited to 'core/java/android')
| -rw-r--r-- | core/java/android/app/ApplicationPackageManager.java | 9 | ||||
| -rw-r--r-- | core/java/android/content/Intent.java | 12 | ||||
| -rw-r--r-- | core/java/android/content/pm/IPackageManager.aidl | 2 | ||||
| -rw-r--r-- | core/java/android/content/pm/PackageManager.java | 14 |
4 files changed, 37 insertions, 0 deletions
diff --git a/core/java/android/app/ApplicationPackageManager.java b/core/java/android/app/ApplicationPackageManager.java index 8a797dcaf449..7312b2c8163e 100644 --- a/core/java/android/app/ApplicationPackageManager.java +++ b/core/java/android/app/ApplicationPackageManager.java @@ -2981,4 +2981,13 @@ public class ApplicationPackageManager extends PackageManager { throw e.rethrowAsRuntimeException(); } } + + @Override + public void sendDeviceCustomizationReadyBroadcast() { + try { + mPM.sendDeviceCustomizationReadyBroadcast(); + } catch (RemoteException e) { + throw e.rethrowAsRuntimeException(); + } + } } diff --git a/core/java/android/content/Intent.java b/core/java/android/content/Intent.java index e7f0053721d1..6fd5061eee63 100644 --- a/core/java/android/content/Intent.java +++ b/core/java/android/content/Intent.java @@ -4116,6 +4116,18 @@ public class Intent implements Parcelable, Cloneable { */ public static final String ACTION_DOCK_ACTIVE = "android.intent.action.DOCK_ACTIVE"; + /** + * Broadcast Action: Indicates that a new device customization has been + * downloaded and applied (packages installed, runtime resource overlays + * enabled, xml files copied, ...), and that it is time for components that + * need to for example clear their caches to do so now. + * + * @hide + */ + @SystemApi + public static final String ACTION_DEVICE_CUSTOMIZATION_READY = + "android.intent.action.DEVICE_CUSTOMIZATION_READY"; + // --------------------------------------------------------------------- // --------------------------------------------------------------------- diff --git a/core/java/android/content/pm/IPackageManager.aidl b/core/java/android/content/pm/IPackageManager.aidl index d0eff2e0fda9..dbea821fab2b 100644 --- a/core/java/android/content/pm/IPackageManager.aidl +++ b/core/java/android/content/pm/IPackageManager.aidl @@ -676,4 +676,6 @@ interface IPackageManager { String getSystemTextClassifierPackageName(); boolean isPackageStateProtected(String packageName, int userId); + + void sendDeviceCustomizationReadyBroadcast(); } diff --git a/core/java/android/content/pm/PackageManager.java b/core/java/android/content/pm/PackageManager.java index a4b724ba48e7..6421dc5a3f68 100644 --- a/core/java/android/content/pm/PackageManager.java +++ b/core/java/android/content/pm/PackageManager.java @@ -6409,4 +6409,18 @@ public abstract class PackageManager { "isPackageStateProtected not implemented in subclass"); } + /** + * Notify to the rest of the system that a new device configuration has + * been prepared and that it is time to refresh caches. + * + * @see android.content.Intent#ACTION_DEVICE_CUSTOMIZATION_READY + * + * @hide + */ + @SystemApi + public void sendDeviceCustomizationReadyBroadcast() { + throw new UnsupportedOperationException( + "sendDeviceCustomizationReadyBroadcast not implemented in subclass"); + } + } |
