Loading packages/MediaUpdate/src/com/android/media/update/ApiFactory.java +4 −7 Original line number Diff line number Diff line Loading @@ -28,14 +28,11 @@ import com.android.widget.MediaController2Impl; import com.android.widget.VideoView2Impl; public class ApiFactory implements StaticProvider { private final Context mContext; public ApiFactory(Context context) { mContext = context; } public static Object initialize(Context context) throws ReflectiveOperationException { return new ApiFactory(context); public static Object initialize(Context appContext, Context libContext) throws ReflectiveOperationException { ApiHelper.initialize(appContext, libContext); return new ApiFactory(); } @Override Loading packages/MediaUpdate/src/com/android/media/update/ApiHelper.java 0 → 100644 +51 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.media.update; import android.content.Context; import android.content.res.Resources; public class ApiHelper { private static ApiHelper sInstance; private final Context mAppContext; private final Resources mLibResources; private final Resources.Theme mLibTheme; public static ApiHelper getInstance() { return sInstance; } static void initialize(Context appContext, Context libContext) { if (sInstance == null) { sInstance = new ApiHelper(appContext, libContext); } } private ApiHelper(Context appContext, Context libContext) { mAppContext = appContext; mLibResources = libContext.getResources(); mLibTheme = libContext.getTheme(); } public Resources getLibResources() { return mLibResources; } public Resources.Theme getLibTheme() { return mLibTheme; } } Loading
packages/MediaUpdate/src/com/android/media/update/ApiFactory.java +4 −7 Original line number Diff line number Diff line Loading @@ -28,14 +28,11 @@ import com.android.widget.MediaController2Impl; import com.android.widget.VideoView2Impl; public class ApiFactory implements StaticProvider { private final Context mContext; public ApiFactory(Context context) { mContext = context; } public static Object initialize(Context context) throws ReflectiveOperationException { return new ApiFactory(context); public static Object initialize(Context appContext, Context libContext) throws ReflectiveOperationException { ApiHelper.initialize(appContext, libContext); return new ApiFactory(); } @Override Loading
packages/MediaUpdate/src/com/android/media/update/ApiHelper.java 0 → 100644 +51 −0 Original line number Diff line number Diff line /* * Copyright 2018 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.media.update; import android.content.Context; import android.content.res.Resources; public class ApiHelper { private static ApiHelper sInstance; private final Context mAppContext; private final Resources mLibResources; private final Resources.Theme mLibTheme; public static ApiHelper getInstance() { return sInstance; } static void initialize(Context appContext, Context libContext) { if (sInstance == null) { sInstance = new ApiHelper(appContext, libContext); } } private ApiHelper(Context appContext, Context libContext) { mAppContext = appContext; mLibResources = libContext.getResources(); mLibTheme = libContext.getTheme(); } public Resources getLibResources() { return mLibResources; } public Resources.Theme getLibTheme() { return mLibTheme; } }