Categories: IoT

The Crux of Android 14 Software Migration and Its Impression


First I wish to give an summary of the Meraki Programs Supervisor (SM) utility. Programs Supervisor is Meraki’s endpoint administration product. We assist administration for a lot of totally different platforms, together with iOS, Android, macOS, and Home windows. “Managing” a tool can imply monitoring its on-line standing, pushing profiles and apps to it, and/or imposing safety insurance policies, amongst different issues. With Programs Supervisor, this administration all occurs by means of Meraki’s on-line interface referred to as Dashboard. Examples and code snippets talked about on this weblog are extra particular to the Android SM utility.

Migration of purposes to any SDK primarily contains 2 duties from the developer’s perspective. One is – how the appliance behaves when put in on a tool with an Android model aside from the goal SDK of the app. And secondly, how the app will behave when the goal SDK is modified. Builders want to grasp what new options, or updates of any current function, and its affect on the appliance are.

This doc focuses on among the modifications impacting builders with Android 14 migration. It additionally covers migration of the Programs Supervisor app to Android 14, and challenges encountered throughout the migration and testing.

Font Scaling

In earlier variations of Android i.e., 13 Non-linear font scaling was supported as much as 130% however in Android 14, it’s supported as much as 200% which may affect the UI of the appliance. Within the utility if font dimensions are declared utilizing sp (scaled pixel) items there are possibilities of minimal affect on the appliance as a result of Android framework would apply these scaling elements. Due to nonlinear scaling of font density scaling is not going to be correct.
Key factors

  • TypedValue.applyDimension() to transform from sp items to pixels.
  • TypedValue.deriveDimension() to transform pixels to sp
  • LineHeight items needs to be laid out in sp to handle proportion together with textual content dimension.

Background Course of Limitation

Android OS is self sustaining to handle the assets effectively by improvising efficiency as effectively. One of many pointers to realize the identical is by caching purposes within the background and solely when the system wants reminiscence these purposes shall be faraway from reminiscence. All purposes ought to adjust to Google Play coverage and therefore killing of processes of different purposes are strictly restricted in Android 14. Therefore killBackgroundProcessess() can kill solely the background processes of your individual utility.

Foreground Service Varieties

In Android 10, a brand new attribute was launched to specify service sort for foreground providers. When utilizing location data within the foreground service it was required to specify the kind as “location”. Whereas in Android 11, mentioning service sort for utilization of digital camera or microphone in foreground service was mandated. However in Android 14 or above, all foreground providers have to be declared with their service sorts.

A few of the new service sorts have been additionally launched in Android 14 – well being, remoteMessaging, shortService, specialUse and systemExempted. If service isn’t related to any of the kinds specified, then it is suggested to vary logic to make use of Workmanager or user-initiated knowledge switch jobs. MissingForegroundServiceTypeException shall be thrown by the system in case service sort isn’t specified.

Service sort permissions have to be declared together with specifying the kind in service.

      <uses-permission 
android:title="android.permission.FOREGROUND_SERVICE_SYSTEM_EXEMPTED" />

      <service
            android:title=".kiosk.v2.service.KioskBreakoutService"
            android:title=".kiosk.v2.service.KioskBreakoutService"
            android:foregroundServiceType="systemExempted"
            android:exported="false" />

Limitations on Implicit Intent and Pending Intent

Implicit intents are solely delivered to exported parts. This restriction ensures the appliance’s implicit intents aren’t utilized by every other malicious apps. Additionally, all mutable pending intent should specify a element or bundle data to the intent, if not the system throws an exception.

Implicit intent needs to be export just like this:

<exercise
   android:title=".AppActivity"
   android:exported="true"> <!-- This have to be TRUE in any other case this may throw 
exception when beginning the activity-->
   <intent-filter>
      <motion android:title="com.instance.motion.APP_ACTION" />
      <class android:title="android.intent.class.DEFAULT" />
   </intent-filter>
</exercise>

If pending intent needs to be mutable, then element information have to be specified.

val flags = if (MerakiUtils.isApi31OrHigher()) {
   PendingIntent.FLAG_MUTABLE
} else {
   PendingIntent.FLAG_UPDATE_CURRENT
}

val pendingIntent = PendingIntent.getActivity(
   this,
   0,
   Intent(context, KioskActivity::class.java).apply {
      putExtra(ACTION, KioskActivity.BREAK_OUT_SINGLE_APP)
   },
   flags
)

Export conduct to be specified for Runtime-registered broadcasts

Previous to Android 13, there have been no restrictions on sending broadcasts to a dynamically registered receiver when it’s guarded by signature permission. Whereas in Android 13, aiming at making runtime receivers secure, an elective flag was launched to specify whether or not the receiver is exported and visual to different purposes. To guard apps from safety vulnerabilities, in Android 14 or above context-registered receivers are required to specify a flag RECEIVER_EXPORTED or RECEIVER_NOT_EXPORTED to point whether or not receiver needs to be exported or to not all different apps on the system. That is exempted for system broadcasts.

ContextCompat.registerReceiver(
   requireContext(), receiver,intentFilter(),
   ContextCompat.RECEIVER_NOT_EXPORTED

Non-Dismissable foreground notifications

In Android 14 or larger, foreground notification might be dismissed by the consumer. However exceptions have been offered for Machine coverage Controller (DPC) and supporting packages for enterprise.

JobScheduler reinforces callback and community conduct

Previous to Android 14, for any job working for too lengthy, it might cease and fail silently. When App targets Android 14 and if the job exceeds the assured time on the primary thread, the app triggers an ANR with an error message “No response to onStartJob” or “No response to onStopJob”. It’s advised to make use of WorkManager for any asynchronous processing.

Modifications particular to Android Enterprise

Android Enterprise is a Google-led initiative to allow the usage of Android gadgets and apps within the office. Additionally it is termed as Android for Work. It helps to handle and distribute non-public apps alongside public apps, offering a unified enterprise app retailer expertise for finish customers.

GET_PROVISIONING_MODE intent conduct

For signing in with a Google account, GET_PROVISIONING_MODE was launched in Android 12 or larger. In Android 14 or larger, DPC apps obtain this intent which may carry the data to assist both Totally managed mode or work profile mode.

wipeDevice – for resetting system

Scope of wipeData is now restricted to profile homeowners solely. For apps concentrating on Android 14 or larger, this methodology would throw system error when referred to as in system proprietor mode. New methodology wipeDevice for use for resetting the system together with USES_POLICY_WIPE_DATA permission.

Newly added fields and strategies

ContactsContract.Contacts#ENTERPRISE_CONTENT_URI
ContactsContract.CommonDataKinds.Telephone#ENTERPRISE_CONTENT_URI

When cross-profile contacts coverage is allowed in DevicePolicyManager, these fields can be utilized for itemizing all work profile contacts and cellphone numbers from private apps together with READ_CONTACTS permission.

To assist setting contact entry coverage and callerID, under strategies are newly added;

setManagedProfileContactsAccessPolicy
getManagedProfileContactsAccessPolicy
setManagedProfileCallerIdAccessPolicy
getManagedProfileCallerIdAccessPolicy

Deprecated strategies

Under strategies are deprecated and in its place strategies specified within the earlier part needs to be used.

DevicePolicyManger#setCrossProfileContactsSearchDisabled
DevicePolicyManger#getCrossProfileContactsSearchDisabled
DevicePolicyManger#setCrossProfileCallerIdDisabled
DevicePolicyManger#getCrossProfileCallerIdDisabled

Challenges throughout Meraki Programs Supervisor App Migration

  • To make sure there was no UI breakage, we needed to recheck all of the code base of xml information associated to all fragments, alert dialog and textual content dimension dimensions.
  • Few APIs like wipeDevice(), weren’t talked about within the Android migration 14. In the course of the testing section it was discovered that wipeData() is deprecated in Android 14 and wipeDevice() was supposed for use for manufacturing unit resetting the system efficiently.
  • Profile data which might be fetched together with intent GET_PROVISIONING_MODE was additionally missed within the migration information. This was discovered throughout the regression testing section.
  • requestSingleUpdate() of location supervisor at all times requires mutable pending for location updation. However nowhere within the documentation, it’s prescribed about it. As a result of this there have been few utility crashes. Needed to determine this out throughout utility testing.

Helpful hyperlinks for reference

 

Share:


👇Observe extra 👇
👉 bdphone.com
👉 ultraactivation.com
👉 trainingreferral.com
👉 shaplafood.com
👉 bangladeshi.assist
👉 www.forexdhaka.com
👉 uncommunication.com
👉 ultra-sim.com
👉 forexdhaka.com
👉 ultrafxfund.com
👉 ultractivation.com
👉 bdphoneonline.com

Uncomm

Share
Published by
Uncomm

Recent Posts

Biman Bangladesh Airways plans to purchase 32 new aircrafts

Biman Bangladesh Airways has unveiled an formidable plan to develop its fleet to 47 plane…

9 mins ago

Samsung tackles grid stability with good house power system

Samsung has unveiled a brand new demand response program for its SmartThings platform, aiming to…

53 mins ago

টানা বৃষ্টিতে নোয়াখালী শহরে জলাবদ্ধতা, শহরবাসীর দুর্ভোগ

নোয়াখালী জেলাশহরে দুই দিনের ভারী ও টানা বর্ষণে জলাবদ্ধতার সৃষ্টি হয়েছে। এতে বাসিন্দারা দুর্ভোগে পড়েছে।…

1 hour ago

Resurrecting an inkjet printer, and dissecting a deceased cartridge

I bought my Epson Artisan 730 colour inkjet all-in-one (printer, copier, and scanner): in September…

2 hours ago

Interview on sensible cities with Curiosity Lab and NTXIA

Good cities are one of many thrilling, new methods we use new expertise to remodel…

2 hours ago

Orbit Fab completes floor check of satellite tv for pc fueling payload

WASHINGTON — Orbit Fab, a Colorado-based startup growing {hardware} for in-space satellite tv for pc…

2 hours ago