ã¿ãªããããã«ã¡ã¯ïŒ éèŠãªã€ãã³ãããŸããªãè¡ãããŸã-Android Oã®ãªãªãŒã¹ããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ã®æ°ããããŒãžã§ã³ã®ãµããŒãã¯ãæ·±å»ãªè£œåã®è²¬ä»»ã§ãã AndroidãæŽæ°ãããã³ã«ãå€ãã®éçºè ã¯æ¢åã®æ©èœã®æ©èœãç¶æããAndroidã®æ°ããããŒãžã§ã³ã«æ°ããæ©èœãè¿œå ããããã«äžçæžåœåãå¿ èŠããããŸãã
ãã®èšäºã§ã¯ãAndroid Oã®äž»ãªå€æŽç¹ã確èªãããããã®åœ±é¿ã®å¯èœæ§ãè©äŸ¡ããŸãã
Android Oã§ã®äœæ¥äžãGoogleéçºè ã¯ãŸãAndroidããã€ã¹ã§ã®é«éããããªãŒæ¶è²»ã®åé¡ã解決ãããããäž»ãªå€æŽã¯ããã¯ã°ã©ãŠã³ãã¿ã¹ã¯ã®æé©åãšã¢ããªã±ãŒã·ã§ã³ãªãœãŒã¹ã®æ¶è²»ã«é¢é£ããŠããŸãã
Android Oã®å€æŽã¯ã次ã®2ã€ã®ã«ããŽãªã«åé¡ã§ããŸãã
çŸåšã®ããã©ãŒãã³ã¹ããç Žå£ãããå¯èœæ§ãããããµããŒãã«è¿œå ã®åªåãå¿ èŠã§ãã
è åš ã¿ãŒã²ãã> = O ã¿ãŒã²ãã<o å¹æ ããã¯ã°ã©ãŠã³ããã±ãŒã·ã§ã³ã®å¶é 圱é¿ãåãã 圱é¿ãåãã äœçœ®æ å ±ãªã¯ãšã¹ãã®å¶é ããã¯ã°ã©ãŠã³ãå®è¡ã®å¶é 圱é¿ãåãã ããã£ã ãããã§ã¹ãã§å©çšå¯èœãªãããŒããã£ã¹ãã®ãªã¹ããå€æŽããŸãã
ããã¯ã°ã©ãŠã³ãã§ãµãŒãã¹ã®æéãå€æŽããŸããéç¥ãã£ã³ã㫠圱é¿ãåãã ããã£ã éç¥ãã£ãã«ã®æ¹å ãŠã£ã³ããŠãããŒãžã£ãŒ 圱é¿ãåãã ããã£ã éè€ãããŠã£ã³ããŠã®æäœãžã®åœ±é¿ ãã©ã€ãã·ãŒïŒBuild.Serial / net.dns / etcïŒ åœ±é¿ãåãã 圱é¿ãåãã ãŠãŒã¶ãŒèå¥åã®å¯çšæ§ãå€æŽãã AccountManagerã
getAccountsïŒïŒåœ±é¿ãåãã ããã£ã ããã€ã¹äžã®ã¢ã«ãŠã³ãã®ãªã¹ããèŠæ±ãããšãnullãè¿ãããŸã
- æ°æ©èœãå®è£
ããæ©äŒã
æ°æ©èœ ç³èŸŒã¿ Android Enterprise ããã€ã¹å¶åŸ¡ã®æ¹å ãªãŒããã£ã«ãã¬ãŒã ã¯ãŒã¯ ãªãŒãã³ã³ããªãŒãã®å ¥åãã£ãŒã«ã éç¥ãã£ã³ãã« UXã®åŒ·å ãã¯ãã£ã€ã³ãã¯ã㣠UXã®åŒ·å é©å¿ã¢ã€ã³ã³ ãã³ããŒãã¡ãŒã ãŠã§ã¢ãšã®äžè²«æ§ ã¢ã¯ã»ã·ããªãã£ãã¿ã³ãšæçŽãžã§ã¹ãã£ãŒ UXã®æ¹åïŒããã²ãŒã·ã§ã³ããŒã®ã¢ã¯ã»ã·ããªãã£ãã¿ã³ãæçŽã¹ãã£ããŒã«ãããžã§ã¹ãã£ãŒã®ãã£ããã£ïŒ Webview ApisïŒäŸïŒSafebrowsingïŒ Webviewã®çµã¿èŸŒã¿æ©èœã®æ¹å ã·ã§ãŒãã«ãããšãŠã£ãžã§ããã®åºå® ã©ã³ãã£ãŒã§ããã°ã©ã ã§ã·ã§ãŒãã«ãããšãŠã£ãžã§ãããäœæãã
ç§ãã¡ã®æèŠã§ã¯ããããã¯Android Oã®æãéèŠãªïŒå°ãªããšãKaspersky Labã®ïŒå€æŽç¹ã§ãããããããåå¥ã«æ€èšããŸãã
ããã¯ã°ã©ãŠã³ããã±ãŒã·ã§ã³ã®å¶é
ããã¯ãããã¯ã°ã©ãŠã³ãã§ã®ã¢ããªã®äœçœ®æ å ±ãªã¯ãšã¹ãã®æ°ã®å¶éã§ãã ãã®ãããAndroid Oããéå§ããã€ã³ã¹ããŒã«ãããŠããTargetSDKã«é¢ä¿ãªããã¢ããªã±ãŒã·ã§ã³ã¯1æéãããããããªå Žæã®æŽæ°ã®ã¿ãåä¿¡ã§ããŸãã åæã«ããããã®å¶éã¯ã次ã®ãã©ã¡ãŒã¿ãŒã®å°ãªããšã1ã€ãæå¹ãªã¢ããªã±ãŒã·ã§ã³ã«ã¯é©çšãããŸããã
- ã¢ããªã±ãŒã·ã§ã³ã¯ããã¯ã°ã©ãŠã³ãã§ã¯ãããŸããïŒéå§ç¶æ ãŸãã¯äžæåæ¢ç¶æ ã®ã¢ã¯ãã£ããã£ãå®è¡ãããŠããŸãïŒã
- ã¢ããªã±ãŒã·ã§ã³ã«ã¯ã¢ã¯ãã£ããªãã©ã¢ã°ã©ãŠã³ããµãŒãã¹ããããŸãã
- å¥ã®Foregroundã¢ããªã±ãŒã·ã§ã³ã«ã¯ãçŸåšã®ã¢ããªã±ãŒã·ã§ã³ãžã®æ¥ç¶ããããŸãïŒãã€ã³ããµãŒãã¹ãšã³ã³ãã³ããããã€ããŒã®äž¡æ¹ã䜿çšïŒã
ãããã£ãŠããã©ã¢ã°ã©ãŠã³ãã¢ããªã±ãŒã·ã§ã³ã®å Žåãåäœã¯ä»¥åã®ããŒãžã§ã³ã®Androidãšåãã«ãªããŸãã
ãã©ã¢ã°ã©ãŠã³ããµãŒãã¹ããªãå Žåããžãªãã±ãŒã·ã§ã³ãªã¯ãšã¹ããå€æŽãããŸãã
- èåãã±ãŒã·ã§ã³ãããã€ããŒïŒFLPïŒ
- ããã¯ã°ã©ãŠã³ãã¢ããªã±ãŒã·ã§ã³ã®å Žåãã¢ããªã±ãŒã·ã§ã³ãæ瀺çã«è¿œå ã®æŽæ°ãèŠæ±ããå Žåã§ããã·ã¹ãã ã¯1æéã«æ°åã ãæ°ããå Žæã決å®ããŸã
- ãã©ã¢ã°ã©ãŠã³ãã¢ããªã±ãŒã·ã§ã³ã®å Žåãäœæ¥ã®ããžãã¯ã¯å€æŽãããŸããã
- ãžãªãã§ã³ã·ã³ã°
- ããã¯ã°ã©ãŠã³ãã¢ããªã±ãŒã·ã§ã³ã¯ãFused Location Providerããã®æŽæ°ãããé »ç¹ã«geofencing-apiããæŽæ°ãåä¿¡ã§ããŸãã
- GNSS枬å®ãšGNSSããã²ãŒã·ã§ã³ã¡ãã»ãŒãž
- ããã¯ã°ã©ãŠã³ãã®ã¢ããªã±ãŒã·ã§ã³ã®å ŽåãGnssMeasurementããã³GnssNavigationMessageãµãŒãã¹ã®æŽæ°ã¯æäŸãããŸãã
- ãã±ãŒã·ã§ã³ãããŒãžã£ãŒ
- ããã¯ã°ã©ãŠã³ãã¢ããªã±ãŒã·ã§ã³ã®å Žåãã·ã¹ãã ã¯æ°ããå Žæã1æéã«æ°åãã決å®ããŸããã
ããã¯ã°ã©ãŠã³ãå®è¡ã®å¶é
ã¢ããªã±ãŒã·ã§ã³ã®ããã¯ã°ã©ãŠã³ãæäœã®å¶éã¯ãAndroid Oã®éèŠãªå€æŽã§ããããã¯ãtargetSdk "O"ã«åãæ¿ãããšãã«ã®ã¿é¡èã«ãªããŸãã targetSdk <= 25ã®å Žåãã¢ããªã±ãŒã·ã§ã³ãããã¯ã°ã©ãŠã³ãã«ãããã·ã¹ãã ãCachedç¶æ ã«ç§»è¡ããå ŽåïŒã·ã¹ãã ããã€ã§ãããã»ã¹ãèªç±ã«åŒ·å¶çµäºã§ããå ŽåïŒãåæã«ã¢ã¯ãã£ããªã³ã³ããŒãã³ãããªãå Žåãã·ã¹ãã ã¯ãã¹ãŠã®WakeLockïŒã€ã³ãžã±ãŒã¿ãŒã¢ããªã±ãŒã·ã§ã³ããã®ã¢ããªã±ãŒã·ã§ã³ã®ã¹ãªãŒãç¶æ ã«ãªã£ãŠã¯ãããªããšããããšã§ãã ã¢ããªã±ãŒã·ã§ã³ãtargetSDK <Oã§ãªãå Žåãèšå®ã§åäœããªã·ãŒãèšå®ããŠãã¢ããªã±ãŒã·ã§ã³ãtargetSDK Oã䜿çšããå Žåãšåãã«ãªãããã«æ³šæããããšãéèŠã§ãã
targetSdkã䜿çšããã¢ããªã±ãŒã·ã§ã³ã®å ŽåããOãããã¯ã°ã©ãŠã³ãå®è¡å¶éã¯2ã€ã®ã«ããŽãªã§æ§æãããŸãã
- ããã¯ã°ã©ãŠã³ããµãŒãã¹ãå¶éãã
ã¢ããªã±ãŒã·ã§ã³ãããã¯ã°ã©ãŠã³ãã«åãæ¿ãã£ãåŸãæ°åã§ããŠã£ã³ããŠãã衚瀺ããããã®éã«ãµãŒãã¹ãéå§ããŠåäœãããããšãã§ããŸãã ãã®ééãçµéãããšããã¹ãŠã®ãµãŒãã¹ãåæ¢ããæ°ãããµãŒãã¹ãèµ·åãããšã¢ããªã±ãŒã·ã§ã³ãã¯ã©ãã·ã¥ããŸãã Googleã¯ãå®è¡äžã®ããã¯ã°ã©ãŠã³ããµãŒãã¹ã®æ°ãæå°éã«æããããšããŠãããJobSchedulerãšGcmNetworkManagerã®äœ¿çšãææ¡ããŠããŸãã
ããã¯ã°ã©ãŠã³ãã§é·ãã¿ã¹ã¯ãå®è¡ããå¿ èŠãããå Žåã¯ãã¢ããªã±ãŒã·ã§ã³ãåäœããŠããããšããŠãŒã¶ãŒã«æ確ã«äŒããforegroundServiceã䜿çšããããšããå§ãããŸãã
Context.startForegroundService()
åŒã³åºãããåŸãContext.startForegroundService()
ã5ç§ä»¥å ã«åŒã³åºãããå¿ èŠãããããšã«æ³šæããŠãã ãããããããªããšãã·ã¹ãã ãANRã衚瀺ããå ŽåããããŸãã - ãããã§ã¹ãã«ãããŒããã£ã¹ããç»é²ããéã®å¶é
Androidã®æ°ããããŒãžã§ã³ã¯ãAndroid 7.0ã§éå§ãããäœæ¥ãç¶ç¶ããŸãïŒã¢ãã€ã«ã¹ããŒã·ã§ã³ãå€æŽããããã³ã«ãªãªãããããã¢ããªã±ãŒã·ã§ã³ã誰ããå¿ããªãããã«ïŒã ãããã第7ããŒãžã§ã³ã§ãããã§ã¹ãã«å°æ°ã®ãããŒããã£ã¹ãã®ã¿ãç»é²ããããšãäžå¯èœã ã£ãå Žåãä»ã§ã¯ãããŒããã£ã¹ãã®å€§éšåãååšããŸãã
éç¥ãã£ã³ãã«
éç¥ãã£ãã«-éç¥ãããŒãå¥ã°ã«ãŒãã«ã°ã«ãŒãåããããŒã«ããŠãŒã¶ãŒã¯çŽæ¥ç®¡çã§ããŸãã ã¢ããªã±ãŒã·ã§ã³ãtarget> = Oã§ãã«ããããŠããå Žåãå°ãªããšã1ã€ã®éç¥ãã£ãã«ããµããŒãããå¿ èŠããããŸãã targetApi <Oã®å Žåã補åå ã§ã®éç¥ã®åŠçã¯åããŸãŸã§ãã
ãŠã£ã³ããŠãããŒãžã£ãŒ
Android Oã§ã¯ãä»ã®ãŠã£ã³ããŠã®äžã«è¡šç€ºã§ããæ°ããã¿ã€ãã®ãŠã£ã³ããŠïŒtargetSDK OçšïŒãå°å
¥ãããŸãã-TYPE_APPLICATION_OVERLAYã åæã«ãããã€ãã®å€ããŠã£ã³ããŠã¿ã€ãã¯éæšå¥šã«ãªãããããã䜿çšããããšRuntimeExceptionãã¹ããŒãããŸãã
çŸåšããããã®ã¿ã€ãã®ãŠã£ã³ããŠã¯ãã·ã¹ãã ã¢ããªã±ãŒã·ã§ã³ã§ã®ã¿äœ¿çšã§ããŸãã
ãã©ã€ãã·ãŒïŒBuild.Serial / net.dns / etcïŒ
Android Oã§ã¯ããŠãŒã¶ãŒãèå¥åãžã®ã¢ã¯ã»ã¹ãå¶åŸ¡ã§ããããã«èšèšãããããã€ãã®æ©èœåŒ·åãå°å ¥ãããŠããŸãã ãããã®æ¹åç¹ã¯æ¬¡ã®ãšããã§ãã
- æ°žç¶çãªïŒãªã»ããäžå¯èœãªïŒããã€ã¹äŸåèå¥åã®äœ¿çšã«é¢ããå¶é
- ãããã¯ãŒã¯ã¹ãã£ã³äžã«MACã¢ãã¬ã¹ãã©ã³ãã åããããã®PixelãPixel XLãNexus 5xãªã©ã®ããã€ã¹äžã®Wi-Fiãããã»ãããã¡ãŒã ãŠã§ã¢ã®å€æŽã«é¢é£ããã¹ã¿ãã¯ã®Wi-Fiã·ã¹ãã æŽæ°
- ã¢ããªã±ãŒã·ã§ã³ãã¢ã«ãŠã³ãæ å ±ãèŠæ±ãããŠãŒã¶ãŒããŒã¿ããã匷åã«å¶åŸ¡ã§ããããã«ããã¡ã«ããºã ã®æŽæ°
AccountManager.getAccountsïŒïŒ
Android O以éãã¢ã«ãŠã³ãã®ãªã¹ãã«ã¢ã¯ã»ã¹ããã«ã¯GET_ACCOUNTSæš©éã§ã¯äžååã§ãã çŸåšãtargetSDK Oã䜿çšããã¢ããªã±ãŒã·ã§ã³ã«ã¯2ã€ã®ãªãã·ã§ã³ããããŸãã
-
AccountManager.newChooseAccountIntent()
䜿çšããŸãã - ãªãŒã»ã³ãã£ã±ãŒã¿ãŒã«ãã£ãŠå®çŸ©ãããã¡ãœããã䜿çšããŠãã¢ã«ãŠã³ãã«ã¢ã¯ã»ã¹ããŸãã
Android Enterprise
Googleã¯Android for Workãç©æ¥µçã«éçºããŠããŸãã Android Oã§ã¯ãããã€ã¹ããã詳现ã«å¶åŸ¡ã§ããŸãã ããšãã°ãäœæ¥ãããã¡ã€ã«ã®å Žåãèšå®ã§åå¥ã®ããã¯ãéå§ããå©çšå¯èœãªã·ã¹ãã ã¢ããããŒãã«é¢ããæ å ±ã確èªã§ããŸãã
ãªãŒããã£ã«ãã¬ãŒã ã¯ãŒã¯
Autofill Framework APIã®åºçŸã«ãããAccessabilityã䜿çšããå ŽåããããŠãŒã¶ãŒããŒã¿ãã¢ããªã±ãŒã·ã§ã³ã«ç°¡åã«å ¥åã§ããããã«ãªããŸããã ãã¬ãŒã ã¯ãŒã¯ãåŒã³åºããšãã¯ããªãŒãã³ã³ããªãŒãã®åŒã³åºããçºçãã補åã®packageNameãç §åããå ¥åçšã®ããŒã¿ãæäŸããå¿ èŠããããŸãã ãã°ã€ã³ãã£ãŒã«ããšãã¹ã¯ãŒããã£ãŒã«ããæ£ããèå¥ããã«ã¯ãautoIdã®UIèŠçŽ ãæ£ããèå¥ã§ããããã«ããresourceIdã³ã³ãããŒã«ãŸãã¯ãã®ä»ã®ãµãŒãã¹æ å ±ã䜿çšããŠããŒã¿ããŒã¹ãäœæããã³ç¶æããå¿ èŠããããŸãã
ãã¯ãã£ã€ã³ãã¯ãã£
Android Oã§ã¯ãç¹æ®ãªã¿ã€ãã®ãã«ããŠã£ã³ããŠã¢ãŒãã§ããPicture-In-Pictureã¢ãŒãã§ã¢ã¯ãã£ããã£ãå®è¡ã§ããŸãã ãããªã衚瀺ããã¢ããªã±ãŒã·ã§ã³å°çšã«ãã®ã¢ãŒãã䜿çšããããšããå§ãããŸãã
é©å¿ã¢ã€ã³ã³
Android Oããã¯ãã¢ããªã±ãŒã·ã§ã³çšã®ã©ã³ãã£ãŒã¢ã€ã³ã³ã®å¥ã®ããŒãžã§ã³ãæäŸã§ããŸããããã¯ãã·ã¹ãã ãããã€ã¹ã¡ãŒã«ãŒã䜿çšãã圢åŒã«ãã¹ã¯ã§ç°¡åã«åãåãããšãã§ããŸãã ãŸãããã®ãããªã¢ã€ã³ã³ãããå Žåãã·ã¹ãã ã¯ã¢ããªã±ãŒã·ã§ã³ã¢ã€ã³ã³ã®ã¢ãã¡ãŒã·ã§ã³ãäœæã§ããŸãã
ã·ã§ãŒãã«ãããšãŠã£ãžã§ããã®åºå®
Android Oã®æ°æ©èœã¯ãã©ã³ãã£ãŒã§ã®ããã°ã©ã ã«ããã·ã§ãŒãã«ãããšãŠã£ãžã§ããã®äœæã§ãã ã·ã§ãŒãã«ããã¯ãã¿ã¹ã¯ãã¯ãªãã¯ããŠç¹å®ã®æå³ã§ã¢ããªã±ãŒã·ã§ã³ã®ã¿ã¹ã¯ãå®è¡ã§ããåå¥ã®ã¢ã€ã³ã³ã§ãã ãŠã£ãžã§ãããŸãã¯ã·ã§ãŒãã«ãããæ£åžžã«æ¥ç¶ããã«ã¯ãã·ã¹ãã 確èªãã€ã¢ãã°ã§ãŠãŒã¶ãŒã®åæãå¿ èŠã§ãã
ãããã«
Androidã§å¿
èŠãªããšãäœã§ãã§ããããã«ãªã£ãã®ã¯éå»ã®ããšã§ãã Androidã¯ãæ°ããæ©èœãäœæããããã®ãåæ³çãªãããŒã«ãæ¡åŒµãããããã³ã°ã®ã®ã£ãããåããŠãæ£çŽã«æ©èœãããŸãã Android Oã¯æ¢åã®ã¢ããªã±ãŒã·ã§ã³ã®äžéšãç Žå£ããŸããããšã³ããŠãŒã¶ãŒã®æºè¶³åºŠãé«ããããšããŸãã ãã£ããããããšãïŒ
誰ããè¯ãã¢ããªã±ãŒã·ã§ã³ãäœæãããŠãŒã¶ãŒã«ã€ããŠèããAndroidããã€ã¹ã®å¹žããªææè
ã«ãªãããšãæã¿ãŸãã
PS
ãã®èšäºã®èè
ã¯ã¢ã¬ã¯ãµã³ããŒã»ã·ã³ãã£ã³ã»ã¢ãŠã·ã³ãã£ã³ã§ãã
ãµãŒã·ã£ã¯èšäºãæžããŠå€§èã«ç
æ°ã«ãªã£ãã®ã§ã圌ã¯Habrã«é¢ããèšäºãç§ã«èšããŸãã=ïŒ
圌ã®è¿
éãªå埩ãé¡ã£ãŠããŸãïŒ