Bug:
115499280
Bug:
119501125
Test: manual - Tested the Gallery UI manually on Pixel phone and ran the following Gallery CTS tests.
$ make -j 40
-rw-r--r-- 1 rtenneti primarygroup
5505290 Jan 18 18:10 out/target/product/marlin/system/product/app/Gallery2/Gallery2.apk
$ adb install -r -d out/target/product/marlin/system/product/app/Gallery2/Gallery2.apk
$ forrest test \
--test_location=remote \
--test_bench_config=presubmit/avd-cf \
--gerrit_hostname android th:cl:878181:aosp_cf_x86_phone-userdebug:aosp-master \
atp:avd/avd_boot_test
https://forrest.googleplex.com/request/L36600000251931014
CTS tests for Gallery2 app
--------------------------
$ make CtsWidgetTestCases -j
-rw-r--r-- 1 rtenneti primarygroup
3308652 Jan 22 11:28 out/host/linux-x86/cts/android-cts/testcases/CtsWidgetTestCases.apk
./development/testrunner/runtest.py --path cts/tests/tests/widget/src/android/widget/cts/GalleryTest.java
android.widget.cts.GalleryTest:................
Time: 3.271
OK (16 tests)
./development/testrunner/runtest.py --path cts/tests/tests/view/src/android/view/cts/ViewTest.java
android.view.cts.ViewTest:...
Time: 45.6
OK (217 tests)
./development/testrunner/runtest.py --path cts/tests/tests/text/src/android/text/method/cts/CharacterPickerDialogTest.java
android.text.method.cts.CharacterPickerDialogTest:....
Time: 0.886
OK (4 tests)
./development/testrunner/runtest.py --path cts/tests/tests/widget/src/android/widget/cts/Gallery_LayoutParamsTest.java
android.widget.cts.Gallery_LayoutParamsTest:.
Time: 0.059
OK (1 test)
./development/testrunner/runtest.py --path cts/tests/tests/widget/src/android/widget/cts/AbsSpinnerTest.java
android.widget.cts.AbsSpinnerTest:.........
Time: 1.646
OK (9 tests)
Change-Id: I9cd9ae3aac2fe09d9da91e859828ab9eec49ccab
<original-package android:name="com.android.gallery3d" />
- <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="24" />
+ <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="28" />
<permission android:name="com.android.gallery3d.permission.GALLERY_PROVIDER"
android:protectionLevel="signatureOrSystem" />
<data android:scheme="package"/>
</intent-filter>
</receiver>
- <service android:name="com.android.gallery3d.app.PackagesMonitor$AsyncService"/>
+ <service android:name="com.android.gallery3d.app.PackagesMonitor$AsyncService"
+ android:permission="android.permission.BIND_JOB_SERVICE"
+ android:exported="true"/>
<service android:name="com.android.gallery3d.gadget.WidgetService"
android:permission="android.permission.BIND_REMOTEVIEWS"/>
<activity android:name="com.android.gallery3d.gadget.WidgetConfigure"
-keep interface com.actionbarsherlock.** { *; }
-keepattributes *Annotation*
+# Required for JobIntentService
+-keep class androidx.core.app.CoreComponentFactory { *; }
+
# Required for mp4parser
-keep public class * implements com.coremedia.iso.boxes.Box
import android.content.Intent;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
+import androidx.core.app.JobIntentService;
import com.android.gallery3d.picasasource.PicasaSource;
import com.android.gallery3d.util.LightCycleHelper;
@Override
public void onReceive(final Context context, final Intent intent) {
intent.setClass(context, AsyncService.class);
- context.startService(intent);
+ AsyncService.enqueueWork(context, intent);
}
- public static class AsyncService extends IntentService {
- public AsyncService() {
- super("GalleryPackagesMonitorAsync");
+ public static class AsyncService extends JobIntentService {
+ public static final int JOB_ID = 1;
+
+ public static void enqueueWork(Context context, Intent work) {
+ enqueueWork(context, AsyncService.class, JOB_ID, work);
}
@Override
- protected void onHandleIntent(Intent intent) {
+ protected void onHandleWork(Intent intent) {
onReceiveAsync(this, intent);
}
}